Merge pull request #1462 from pboyer/lafix

Fix for #1459
This commit is contained in:
Terence Parr 2016-12-08 12:19:14 -08:00 committed by GitHub
commit 2dddd007e4
1 changed files with 3 additions and 6 deletions

View File

@ -644,10 +644,7 @@ p.GetErrorHandler().Sync(p)
<endif>
la_ := p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), <choice.decision>, p.GetParserRuleContext())
switch la_ {
switch p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), <choice.decision>, p.GetParserRuleContext()) {
<if(alts)>
<alts:{alt | case <i>:
<alt>}; separator="\n\n">
@ -658,10 +655,10 @@ switch la_ {
OptionalBlock(choice, alts, error) ::= <<
p.SetState(<choice.stateNumber>)
p.GetErrorHandler().Sync(p)
la_ := p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), <choice.decision>, p.GetParserRuleContext())
<if(alts)>
<alts:{alt | if la_ == <i><if(!choice.ast.greedy)>+1<endif> {
<alts:{alt | if p.GetInterpreter().AdaptivePredict(p.GetTokenStream(), <choice.decision>, p.GetParserRuleContext()) == <i><if(!choice.ast.greedy)>+1<endif> {
<alt>
}; separator="} else ">
<endif>