Mantis Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0005116OCamlCamlp4public2010-07-28 14:522013-06-17 15:23
Reporterygrek 
Assigned Toxclerc 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionsuspended 
PlatformOSOS Version
Product Version3.11.2 
Target Version4.00.2+devFixed in Version 
Summary0005116: camlp4 relaxes syntax for records update : { expr with ... }
DescriptionCamlp4 accepts syntax which is rejected by ocamlc (requires parentheses around `Gc.get ()` ) :

$ cat a.ml
let _ = { Gc.get () with Gc.minor_heap_size = 2 * 1024 * 1024 }
$ ocamlc -pp camlp4o -c a.ml
$ ocamlc -c a.ml
File "a.ml", line 1, characters 17-18:
Error: Syntax error
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
(0005626)
garrigue (manager)
2010-07-28 15:18

Since the syntax provided by camlp4o is already an extension of ocaml, I don't see any real problem here.
By the way, the need for parentheses in ocaml is only a consequence of the limitations of LALR parsing.
(0005627)
ertai (developer)
2010-07-28 19:09

Camlp4 usual parsing technique is LL(something) and so cannot parse this either. However their is a backtracking hack in Camlp4 to make it work. Maybe we will switch to allowing only simple expressions here.
(0005628)
ygrek (reporter)
2010-07-29 08:31

I just expected camp4o to abide by the ocamlc syntax rules for regular ocaml code (without stream parsers or loaded extensions), otherwise it makes some minor surprises when moving code between files (which are not all processed by camlp4o).

- Issue History
Date Modified Username Field Change
2010-07-28 14:52 ygrek New Issue
2010-07-28 14:52 ygrek Status new => assigned
2010-07-28 14:52 ygrek Assigned To => ertai
2010-07-28 15:18 garrigue Note Added: 0005626
2010-07-28 19:09 ertai Note Added: 0005627
2010-07-29 08:31 ygrek Note Added: 0005628
2011-10-26 08:40 ertai Assigned To ertai => xclerc
2012-07-10 20:00 doligez Target Version => 4.01.0+dev
2012-07-31 13:36 doligez Target Version 4.01.0+dev => 4.00.1+dev
2012-09-19 13:48 doligez Target Version 4.00.1+dev => 4.01.0+dev
2013-06-17 15:23 gasche Status assigned => resolved
2013-06-17 15:23 gasche Resolution open => suspended
2013-06-17 15:23 gasche Target Version 4.01.0+dev => 4.00.2+dev


Copyright © 2000 - 2011 MantisBT Group
Powered by Mantis Bugtracker