mirror of
https://gitlab.com/rnger/amath
synced 2025-10-05 10:29:29 +00:00
Improve error handling
This commit is contained in:
@ -76,12 +76,17 @@ SyntaxNode* Parser::Parse()
|
||||
delete result;
|
||||
}
|
||||
|
||||
result = new ErrorNode(lexer->GetInput(), token->GetPos());
|
||||
if (block != NOMEM) {
|
||||
block->Add(result);
|
||||
if (block == NOMEM) {
|
||||
block = new StatementBlockNode();
|
||||
}
|
||||
|
||||
GetToken();
|
||||
result = new ErrorNode(lexer->GetInput(), token->GetPos());
|
||||
block->Add(result);
|
||||
|
||||
// Skip until next statement
|
||||
do {
|
||||
GetToken();
|
||||
} while (token->symbol != symdelimiter && token->symbol != symend);
|
||||
}
|
||||
|
||||
current = token;
|
||||
|
Reference in New Issue
Block a user