You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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.
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).
Original bug ID: 5116
Reporter: @ygrek
Assigned to: @xclerc
Status: closed (set by @diml on 2016-12-07T17:25:09Z)
Resolution: suspended
Priority: normal
Severity: minor
Version: 3.11.2
Target version: 4.00.2+dev
Category: -for Camlp4 use https://github.com/ocaml/camlp4/issues
Monitored by: @hcarty
Bug description
Camlp4 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
The text was updated successfully, but these errors were encountered: