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

Using "constructor" as a literal causes a parse error #387

Open
jarble opened this issue Jun 24, 2019 · 0 comments
Open

Using "constructor" as a literal causes a parse error #387

jarble opened this issue Jun 24, 2019 · 0 comments

Comments

@jarble
Copy link

jarble commented Jun 24, 2019

While I was testing Jison here, I found that Jison was unable to generate a parser from this simple grammar, since it contains the literal "constructor":

/* lexical grammar */
%lex
%%

\s+                   /* skip whitespace */
"constructor"         return 'constructor'
<<EOF>>               return 'EOF'
.                     return 'INVALID'

/lex

/* operator associations and precedence */

%start expressions

%% /* language grammar */

expressions
    :  "constructor" EOF
        {return "constructor";}
    ;

It works when I replace "constructor" with "constructor1", but it can't generate a parser from the grammar above. Is this a bug?

GerHobbelt added a commit to GerHobbelt/jison that referenced this issue Nov 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant