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

ocamlyacc: polymorphic variants are not fully supported in %type #3033

Closed
vicuna opened this issue Aug 2, 2004 · 2 comments
Closed

ocamlyacc: polymorphic variants are not fully supported in %type #3033

vicuna opened this issue Aug 2, 2004 · 2 comments
Labels

Comments

@vicuna
Copy link

vicuna commented Aug 2, 2004

Original bug ID: 3033
Reporter: administrator
Status: closed
Resolution: fixed
Priority: normal
Severity: minor
Category: ~DO NOT USE (was: OCaml general)

Bug description

Full_Name: Peter Jolly
Version: 3.08.0
OS: Cygwin (Win2k)
Submission from: 81-86-133-45.dsl.pipex.com (81.86.133.45)

The manual claims that %type<> accepts "arbitrary Caml type expressions".
However,
the ocamlyacc parser appears to assume that the only occurrences of the '>'
character
in such expressions will be in the context of '->' (yacc/reader.c line 834).
This
assumption appears to be incorrect:

$ cat foobar.mly
%token FOO BAR
%start foobar
%type <[> Foo | Bar]> foobar
%%
foobar: FOO { Foo } | BAR { Bar }

$ ocamlyacc foobar.mly
ocamlyacc: e - line 3 of "foobar.mly", syntax error
%type <[> Foo | Bar]> foobar
^

While the obvious workaround works, proper support for open types would save an
awful
lot of coercions.

@vicuna
Copy link
Author

vicuna commented Aug 20, 2004

Comment author: administrator

Full_Name: Peter Jolly
Version: 3.08.0

The manual claims that %type<> accepts "arbitrary Caml type expressions".
However, the ocamlyacc parser appears to assume that the only occurrences
of the '>' character in such expressions will be in the context of '->'
(yacc/reader.c line 834). This assumption appears to be incorrect:

Thanks for your bug report. This is now fixed in the CVS version.

-- Damien

@vicuna
Copy link
Author

vicuna commented Aug 20, 2004

Comment author: administrator

fixed -DD 2004-08-20

@vicuna vicuna closed this as completed Aug 20, 2004
@vicuna vicuna added the bug label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant