Skip to content

Data type using one terminal behaves differently from that terminal #1357

Answered by msujew
drhagen asked this question in Q&A
Discussion options

You must be logged in to vote

@drhagen I've created issue #1358 from this, see there for more info on this.

As for the behavior difference, its a bug, since we didn't expect people to use data type rule without property assignment. That breaks a few things in the parser. Using this grammar instead works as expected:

grammar HelloWorld

entry Model:
    ((persons+=Person) eol=EOL)*;

Person:
    'person' name=ID;

hidden terminal WS: /[ \t]+/;
terminal ID: /[_a-zA-Z][\w_]*/;
terminal NEWLINE: '\n';
EOL returns string:
    NEWLINE;

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@drhagen
Comment options

@msujew
Comment options

Answer selected by drhagen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants