@@ -2340,25 +2340,40 @@ toExprReport source context expr startRow startCol =
2342 OperatorRight op row col ->
2342 OperatorRight op row col ->
2344+ surroundings = A.Region (A.Position startRow startCol) (A.Position row col)
2343− let region = toRegion row col in
2345+ region = toRegion row col
2346+ isMath = elem op ["-","+","*","/","^"]
2344 Report.Report "MISSING EXPRESSION" region [] $
2348 Report.Report "MISSING EXPRESSION" region [] $
2345− Code.toSnippet source region Nothing
2349+ Code.toSnippet source surroundings (Just region)
2347 D.reflow $
2351 D.reflow $
2348− "I was expecting to see an expression after this " ++ Name.toChars op ++ " operator:"
2352+ "I just saw a " ++ Name.toChars op ++ " "
2353+ ++ (if isMath then "sign" else "operator")
2354+ ++ ", so I am getting stuck here:"
2350− D.stack
2356+ if isMath then
2351− [ D.fillSep $
2357+ D.fillSep
2352− ["You","can","just","put","anything","for","now,","like"
2358+ ["I","was","expecting","to","see","an","expression","next."
2353− ,D.dullyellow "42","or",D.dullyellow"\"hello\"" <> "."
2359+ ,"Something","like",D.dullyellow "42","or",D.dullyellow "1000"
2354− ,"Once","there","is","something","there,","I","can","probably"
2360+ ,"that","makes","sense","with","a",D.fromName op,"sign."
2355− ,"give","a","more","specific","hint!"
2361+ ]
2362+ else if op == "&&" || op == "||" then
2364+ ["I","was","expecting","to","see","an","expression","next."
2365+ ,"Something","like",D.dullyellow "True","or",D.dullyellow "False"
2366+ ,"that","makes","sense","with","boolean","logic."
2357− , D.toSimpleNote $
2368+ else if op == "|>" then
2358− "This can also happen if run into reserved words like `let` or `as` unexpectedly.\
2369+ D.reflow $
2359− \ Or if I run into operators in unexpected spots. Point is, there are a\
2370+ "I was expecting to see a function next."
2360− \ couple ways I can get confused and give sort of weird advice!"
2371+ else if op == "<|" then
2373+ "I was expecting to see an argument next."
2376+ "I was expecting to see an expression next."
2364 OperatorReserved operator row col ->
2379 OperatorReserved operator row col ->