Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

camlp4 relaxes syntax for records update : { expr with ... } #5116

Closed
vicuna opened this issue Jul 28, 2010 · 3 comments
Closed

camlp4 relaxes syntax for records update : { expr with ... } #5116

vicuna opened this issue Jul 28, 2010 · 3 comments

Comments

@vicuna
Copy link

vicuna commented Jul 28, 2010

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

@vicuna
Copy link
Author

vicuna commented Jul 28, 2010

Comment author: @garrigue

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.

@vicuna
Copy link
Author

vicuna commented Jul 28, 2010

Comment author: ertai

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.

@vicuna
Copy link
Author

vicuna commented Jul 29, 2010

Comment author: @ygrek

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).

@vicuna vicuna closed this as completed Dec 7, 2016
@vicuna vicuna added this to the 4.00.2 milestone Mar 14, 2019
@vicuna vicuna added the bug label Mar 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant