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

Too permissive BNF #5882

Closed
vicuna opened this issue Jan 10, 2013 · 1 comment
Closed

Too permissive BNF #5882

vicuna opened this issue Jan 10, 2013 · 1 comment

Comments

@vicuna
Copy link

vicuna commented Jan 10, 2013

Original bug ID: 5882
Reporter: norm
Assigned to: @garrigue
Status: closed (set by @garrigue on 2013-01-10T07:08:08Z)
Resolution: won't fix
Priority: normal
Severity: minor
Platform: Mac
OS: OS X
OS Version: 10.4.7
Category: documentation
Duplicate of: #3835

Bug description

The BNF produces "type s = [int]" which is probably a mistake.
See http://cap-lore.com/Languages/ocaml/bugs/a.html
for the complete production tree.

Steps to reproduce

OCaml version 4.00.1

type s = [int];;

Error: Syntax error

@vicuna
Copy link
Author

vicuna commented Jan 10, 2013

Comment author: @garrigue

As explained in #3835, this is actually valid for the specification, but not accepted due to a limitation of LR(1) parsing.
The workaround is to write
type s = [ | int ]
(which will of course fail in this case since int is not a polymorphic variant type).

There is no incentive to fix this bug, as the above definition is not useful anyway.

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

2 participants