Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Confusing error message when parentheses enclose an invalid expression #6061

Closed
vicuna opened this issue Jul 2, 2013 · 3 comments
Closed

Comments

@vicuna
Copy link

vicuna commented Jul 2, 2013

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

@vicuna
Copy link
Author

vicuna commented Jan 17, 2014

Comment author: @damiendoligez

So, it used to be that the only syntax error message of the compiler was the plain "Syntax error". Users were unhappy about that and demanded more details...

@vicuna
Copy link
Author

vicuna commented Feb 24, 2017

Comment author: @damiendoligez

Syntax error reports will improve after we switch to menhir.

@github-actions
Copy link

This issue has been open one year with no activity. Consequently, it is being marked with the "stale" label. What this means is that the issue will be automatically closed in 30 days unless more comments are added or the "stale" label is removed. Comments that provide new information on the issue are especially welcome: is it still reproducible? did it appear in other contexts? how critical is it? etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant