Skip to content

Commit

Permalink
[llk] after failing a user action, advance to next token to avoid pot…
Browse files Browse the repository at this point in the history
…ential loop

action could be before the first token of a rule, and this token can be in the sync-set
  • Loading branch information
vovkos committed Jun 14, 2024
1 parent c7d7675 commit 4400caa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/llk_Parser.h
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ class Parser {
if (action == RecoveryAction_Fail)
return MatchResult_Fail;
else if (action == RecoveryAction_Synchronize)
return MatchResult_Continue;
return MatchResult_NextToken; // advance to next token to avoid a potential loop
}
}
} else if (node->m_index < T::NamedSymbolCount + T::CatchSymbolCount) {
Expand Down Expand Up @@ -711,7 +711,7 @@ class Parser {
if (action == RecoveryAction_Fail)
return MatchResult_Fail;
else if (action == RecoveryAction_Synchronize)
return MatchResult_Continue;
return MatchResult_NextToken; // advance to next token to avoid a potential loop
}

popPrediction();
Expand Down

0 comments on commit 4400caa

Please sign in to comment.