Skip to content

Commit

Permalink
add test for antlr#2016 and fix java.
Browse files Browse the repository at this point in the history
Signed-off-by: Terence Parr <parrt@antlr.org>
  • Loading branch information
parrt committed Aug 27, 2022
1 parent 1cb4669 commit 653f461
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[notes]
Checks that this compiles; see https://github.com/antlr/antlr4/issues/2016

[type]
Parser

[grammar]
grammar Test;
expression: op=NOT args+=expression
| args+=expression (op=AND args+=expression)+
| args+=expression (op=OR args+=expression)+
| IDENTIFIER
;
AND : 'and' ;
OR : 'or' ;
NOT : 'not' ;
IDENTIFIER : [a-zA-Z_][a-zA-Z0-9_]* ;
WS : [ \t\r\n]+ -> skip ;

[start]
expression

[input]
a and b
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,6 @@ _localctx.<label>.add(_prevctx);
_localctx.<label> = _prevctx;
<endif>
<endif>
<if(label)>_localctx.<label> = _prevctx;<endif>
pushNewRecursionContext(_localctx, _startState, RULE_<ruleName>);
>>

Expand Down

0 comments on commit 653f461

Please sign in to comment.