Fix wrong block statements consuming EOF token, causing a nullptr exception
This commit is contained in:
parent
e233616b8e
commit
ed6fbdbef0
|
@ -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));
|
||||||
|
|
Loading…
Reference in New Issue