Merge pull request #2997 from ericvergnaud/fix-js-code-gen

Potential fix to #2980
This commit is contained in:
ericvergnaud 2020-12-07 07:51:48 +08:00 committed by GitHub
commit c87e55b611
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -410,7 +410,7 @@ if(la_===<i><if(!choice.ast.greedy)>+1<endif>) {
StarBlock(choice, alts, sync, iteration) ::= <<
this.state = <choice.stateNumber>;
this._errHandler.sync(this);
let _alt = this._interp.adaptivePredict(this._input,<choice.decision>,this._ctx)
var _alt = this._interp.adaptivePredict(this._input,<choice.decision>,this._ctx)
while(_alt!=<choice.exitAlt> && _alt!=antlr4.atn.ATN.INVALID_ALT_NUMBER) {
if(_alt===1<if(!choice.ast.greedy)>+1<endif>) {
<iteration>
@ -426,7 +426,7 @@ while(_alt!=<choice.exitAlt> && _alt!=antlr4.atn.ATN.INVALID_ALT_NUMBER) {
PlusBlock(choice, alts, error) ::= <<
this.state = <choice.blockStartStateNumber>; <! alt block decision !>
this._errHandler.sync(this);
let _alt = 1<if(!choice.ast.greedy)>+1<endif>;
var _alt = 1<if(!choice.ast.greedy)>+1<endif>;
do {
switch (_alt) {
<alts:{alt|