Force usage of previousContext in Cpp

This commit is contained in:
parrt 2018-11-09 11:31:59 -08:00
parent 5aa0df9c45
commit f6c6217804
1 changed files with 1 additions and 0 deletions

View File

@ -510,6 +510,7 @@ LeftRecursiveRuleFunction(currentRule, args, code, locals, ruleCtx, altLabelCtxs
size_t parentState = getState();
<parser.name>::<currentRule.ctxType> *_localctx = _tracker.createInstance\<<currentRule.ctxType>\>(_ctx, parentState<currentRule.args: {a | , <a.name>}>);
<parser.name>::<currentRule.ctxType> *previousContext = _localctx;
(void)previousContext; // Silence compiler, in case the context is not used by generated code.
size_t startState = <currentRule.startState>;
enterRecursionRule(_localctx, <currentRule.startState>, <parser.name>::Rule<currentRule.name; format = "cap">, precedence);