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 accepts illegal (?) code #3835

Closed
vicuna opened this issue Nov 4, 2005 · 2 comments
Closed

Camlp4 accepts illegal (?) code #3835

vicuna opened this issue Nov 4, 2005 · 2 comments

Comments

@vicuna
Copy link

vicuna commented Nov 4, 2005

Original bug ID: 3835
Reporter: administrator
Status: closed (set by @damiendoligez on 2006-01-24T13:50:01Z)
Resolution: won't fix
Priority: low
Severity: tweak
Category: ~DO NOT USE (was: OCaml general)
Has duplicate: #5882
Related to: #3957
Monitored by: @mmottl

Bug description

Hi,

the following code snippet is accepted by camlp4 but produces a syntax
error with the parser used by OCaml:


type t = [ `T ]
type u = [ t ]

Maybe I'm wrong, but the above code, though inelegant, does not seem
unacceptable to me.

Best regards,
Markus

--
Markus Mottl http://www.ocaml.info markus.mottl@gmail.com

@vicuna
Copy link
Author

vicuna commented Nov 5, 2005

Comment author: administrator

Camlp4 conforms to the spec here. - MM

@vicuna
Copy link
Author

vicuna commented Jan 24, 2006

Comment author: @damiendoligez

This is a bug in the yacc parser, due to limitations of LR(1) parsing.
I can't find an easy fix, and I don't think it's worth the trouble.

Workaround: don't omit the optional vertical bar:

type u = [ | t ];;

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