Fix wrong block statements consuming EOF token, causing a nullptr exception
This commit is contained in:
@@ -11,7 +11,7 @@ ParsedScriptStatement* Parser::Parse() {
|
|||||||
vector<ParsedStatement*> statements;
|
vector<ParsedStatement*> statements;
|
||||||
while (true){
|
while (true){
|
||||||
auto next = this -> Next();
|
auto next = this -> Next();
|
||||||
if (next->GetKind() == TokenKind::EndOfFile){
|
if (next == nullptr || next->GetKind() == TokenKind::EndOfFile){
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
statements.push_back(this -> ParseStatement(next));
|
statements.push_back(this -> ParseStatement(next));
|
||||||
|
|||||||
Reference in New Issue
Block a user