Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006061OCamllexing and parsingpublic2013-07-02 16:282017-03-07 14:24
Assigned To 
PlatformOSOS Version
Product Version4.01.0+dev 
Target VersionlaterFixed in Version 
Summary0006061: Confusing error message when parentheses enclose an invalid expression
DescriptionWhen 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: (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): (let x) [1;2;3];;
Error: Syntax error
TagsNo tags attached.
Attached Files

- Relationships
child of 0005068acknowledged ocamlc/camlp4 should give better error messages for syntax errors 

-  Notes
doligez (administrator)
2014-01-17 15:40

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...
doligez (administrator)
2017-02-24 16:20

Syntax error reports will improve after we switch to menhir.

- Issue History
Date Modified Username Field Change
2013-07-02 16:28 gasche New Issue
2013-07-02 16:28 gasche Relationship added child of 0005068
2013-07-02 16:29 gasche Status new => acknowledged
2013-07-12 17:12 doligez Product Version later => 4.01.0+dev
2013-07-12 17:12 doligez Target Version => later
2014-01-17 15:40 doligez Note Added: 0010805
2017-02-23 16:36 doligez Category OCaml general => -OCaml general
2017-02-24 16:20 doligez Note Added: 0017461
2017-02-24 16:20 doligez Category -OCaml general => lexing and parsing
2017-03-07 14:24 shinwell Severity minor => feature

Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker