Original bug ID: 6061
Reporter: @gasche
Status: acknowledged (set by @gasche on 2013-07-02T14:29:00Z)
Resolution: open
Priority: normal
Severity: feature
Version: 4.01.0+dev
Target version: later
Category: lexing and parsing
Child of: #5068
Bug description
When a correctly-parenthesized expression is syntactically incorrect (inside the parens), the error message sometimes only mention the parentheses, which can be very confusing.
The original report comes from user BlankVerse which spelled "fn" instead of "fun", and got the following error:
List.map (fn x -> x) [1;2;3];;
^
Syntax error: ')' expected, the highlighted '(' might be unmatched
Some other wrong-expressions trigger the same behavior, such as "x let x", but some other do not, such as the following better message (pointing at the last parens):
List.map (let x) [1;2;3];;
^
Error: Syntax error