Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005770OCamlOCaml generalpublic2012-10-01 20:202013-07-02 16:22
Reportermauny 
Assigned Tofrisch 
PrioritylowSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformallOSallOS Versionall
Product Version4.00.0 
Target VersionlaterFixed in Version4.01.0+dev 
Summary0005770: Syntax error messages involving unclosed parens are sometimes incorrect
DescriptionParsing invalid patterns inside well-balanced parentheses produces an error message saying that parens don't match.

I provide a patch that fixes the problem by adding a few more error rules in the parser and relevant error messages.
Steps To Reproduce$ echo 'match x with (1 as ) -> 0;;' > /tmp/a.ml
$ ocamlc /tmp/a.ml -o /tmp/a
File "/tmp/a.ml", line 1, characters 19-20:
Error: Syntax error: ')' expected
File "/tmp/a.ml", line 1, characters 13-14:
Error: This '(' might be unmatched
Additional InformationAfter applying the patch, the new error message is

File "/tmp/a.ml", line 1, characters 19-20:
Error: Syntax error: identifier expected.
TagsNo tags attached.
Attached Filespatch file icon parser-msgs.patch [^] (3,952 bytes) 2012-10-01 20:20 [Show Content]

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

-  Notes
(0008268)
frisch (developer)
2012-10-16 16:05

Thanks, I've applied your patch on the trunk (commit 13019) and adapted labltk/browser to support the new error.

- Issue History
Date Modified Username Field Change
2012-10-01 20:20 mauny New Issue
2012-10-01 20:20 mauny File Added: parser-msgs.patch
2012-10-16 16:05 frisch Note Added: 0008268
2012-10-16 16:05 frisch Status new => resolved
2012-10-16 16:05 frisch Fixed in Version => 4.01.0+dev
2012-10-16 16:05 frisch Resolution open => fixed
2012-10-16 16:05 frisch Assigned To => frisch
2013-07-02 16:22 gasche Relationship added child of 0005068


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker