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

The precedence of reserved symbols and predefined tokens was different in Haskell and OCaml versions. #166

Merged
merged 1 commit into from
Sep 7, 2016

Conversation

tetsuo-jp
Copy link

-- I fixed the order in the OCaml backend.
-- The following file produces different results in Haskell and OCaml
versions.
{-
% bnfc -m -ocaml A.cf
% make
% echo ":a" | ./TestA
[Abstract syntax]

MyId (MyIdent ":a")

[Linearized tree]

:a
% bnfc -m -haskell A.cf
% make
% echo ":a" | ./TestA

Parse Successful!

[Abstract Syntax]

Keyword

[Linearized tree]

:a
-}

Keyword. Exp ::= ":a" ;
MyId. Exp ::= MyIdent ;

token MyIdent (':' letter)

…n Haskell version.

-- The following file produces different results in Haskell and OCaml
versions.
{-
% bnfc -m -ocaml A.cf
% make
% echo ":a" | ./TestA
[Abstract syntax]

MyId (MyIdent ":a")

[Linearized tree]

:a
% bnfc -m -haskell A.cf
% make
% echo ":a" | ./TestA

Parse Successful!

[Abstract Syntax]

Keyword

[Linearized tree]

:a
-}

Keyword. Exp ::= ":a" ;
MyId.    Exp ::= MyIdent ;

token MyIdent (':' letter)
@gdetrez gdetrez self-assigned this Aug 22, 2016
@gdetrez gdetrez modified the milestone: 2.9 Sep 7, 2016
@gdetrez gdetrez merged commit 4b3b789 into BNFC:master Sep 7, 2016
gdetrez added a commit that referenced this pull request Sep 7, 2016
@gdetrez
Copy link
Contributor

gdetrez commented Sep 7, 2016

Thanks 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants