Merge branch 'master' into tree-patterns
This commit is contained in:
commit
02f937b115
|
@ -359,7 +359,11 @@ LeftRecursiveRuleFunction(currentRule,code,locals,ruleCtx,altLabelCtxs,
|
|||
<ruleCtx>
|
||||
<altLabelCtxs:{l | <altLabelCtxs.(l)>}; separator="\n">
|
||||
|
||||
<if(currentRule.modifiers)><currentRule.modifiers:{f | <f> }><else>public final <endif><currentRule.ctxType> <currentRule.name>(int _p<currentRule.args:{a | , <a>}>) throws RecognitionException {
|
||||
<if(currentRule.modifiers)><currentRule.modifiers:{f | <f> }><else>public final <endif><currentRule.ctxType> <currentRule.name>(<currentRule.args; separator=", ">) throws RecognitionException {
|
||||
return <currentRule.name>(0<currentRule.args:{a | , <a.name>}>);
|
||||
}
|
||||
|
||||
private <currentRule.ctxType> <currentRule.name>(int _p<currentRule.args:{a | , <a>}>) throws RecognitionException {
|
||||
ParserRuleContext _parentctx = _ctx;
|
||||
int _parentState = getState();
|
||||
<currentRule.ctxType> _localctx = new <currentRule.ctxType>(_ctx, _parentState<currentRule.args:{a | , <a.name>}>);
|
||||
|
|
|
@ -73,7 +73,6 @@ public class TestLeftRecursion extends BaseTest {
|
|||
@Test public void testDirectCallToLeftRecursiveRule() throws Exception {
|
||||
String grammar =
|
||||
"grammar T;\n" +
|
||||
"@parser::members{public AContext a() { return a(0); }}\n" +
|
||||
"a @after {System.out.println($ctx.toStringTree(this));} : a ID\n" +
|
||||
" | ID" +
|
||||
" ;\n" +
|
||||
|
|
Loading…
Reference in New Issue