Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0006400OCamlOCaml generalpublic2014-05-07 01:472014-09-14 22:46
Reporterwhitequark 
Assigned To 
PrioritynormalSeverityminorReproducibilityhave not tried
StatusacknowledgedResolutionopen 
PlatformOSOS Version
Product Version 
Target Versionafter-4.02.1Fixed in Version 
Summary0006400: Error message for _ in expression is incomprehensible
DescriptionFor example:

   # [{pstr_desc = Pstr_extension (extension_of_error error, _)}];;
   Error: Syntax error: operator expected.

First, the error message makes no sense at all. Second, the `_' is underlined, which adds to the confusion.
Tagspatch
Attached Filespatch file icon expr_comma_list.patch [^] (546 bytes) 2014-05-07 08:29 [Show Content]
diff file icon patch_6400.diff [^] (375 bytes) 2014-05-14 09:36 [Show Content]

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

-  Notes
(0011375)
gasche (developer)
2014-05-07 08:29

For the record, the reason why you get this error is that the error production that fires is

 [{pstr_desc = Pstr_extension (ERROR)}]

and that (ERROR) is interpreted as an infix operator (+) where the operator is erroneous.

Adding a couple error production seems to fix that, but I'm not sure that's a good long-term solution.
(0011388)
whitequark (developer)
2014-05-07 17:16

Agreed; it seems like migrating to Merlin would be a much better one.
(0011453)
frisch (developer)
2014-05-14 09:38

I've attached a different patch, which recognizes "_" in the "expr" grammar entry. This explicitly reserves this syntax in expression, which could be useful later (e.g. if add "implicits" to the language; or just as a placeholder for extension node expanders).

- Issue History
Date Modified Username Field Change
2014-05-07 01:47 whitequark New Issue
2014-05-07 08:29 gasche Note Added: 0011375
2014-05-07 08:29 gasche File Added: expr_comma_list.patch
2014-05-07 08:30 gasche Relationship added child of 0005068
2014-05-07 17:16 whitequark Note Added: 0011388
2014-05-13 09:29 doligez Tag Attached: patch
2014-05-14 09:36 frisch File Added: patch_6400.diff
2014-05-14 09:38 frisch Note Added: 0011453
2014-05-30 13:48 shinwell Status new => acknowledged
2014-07-16 18:03 doligez Target Version => 4.02.1+dev
2014-09-04 00:25 doligez Target Version 4.02.1+dev => undecided
2014-09-14 22:46 doligez Target Version undecided => after-4.02.1


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker