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 28, 2022
1 parent e1ff5bd commit 23ae7df
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 23ae7df

Please sign in to comment.