Fix error recovery
This commit is contained in:
parent
541f3c0c19
commit
95db330460
|
@ -163,11 +163,11 @@ Value {{name}}<Value>::parse() {
|
|||
Token report = Token{tok.symbol, std::move(tok.value)};
|
||||
Value errorVal = error(std::move(report), expected);
|
||||
|
||||
while (!valueStack.empty() && (TABLE[stateStack.top()][verr] & 0x3) == ERROR) {
|
||||
while (!valueStack.empty() && !TABLE[stateStack.top()][verr]) {
|
||||
valueStack.pop();
|
||||
stateStack.pop();
|
||||
}
|
||||
if ((TABLE[stateStack.top()][verr] & 0x3) == ERROR) {
|
||||
if (!TABLE[stateStack.top()][verr]) {
|
||||
throw SyntaxError("Syntax error: could not recover");
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue