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
Original bug ID: 3033 Reporter: administrator Status: closed Resolution: fixed Priority: normal Severity: minor Category: ~DO NOT USE (was: OCaml general)
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.
The text was updated successfully, but these errors were encountered:
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.
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.
The text was updated successfully, but these errors were encountered: