Fix single item numerical tables being parsed as complex tables
This commit is contained in:
parent
0266b3c616
commit
80f3af22ac
|
@ -596,7 +596,7 @@ namespace Porygon::Parser {
|
|||
auto firstItem = this->ParseStatement(this->Next());
|
||||
// If the first item is an expression, and is followed by a comma, we're dealing with a simple {1, 2, 3} kind of array
|
||||
if (firstItem->GetKind() == ParsedStatementKind::Expression &&
|
||||
(this->Peek()->GetKind() == TokenKind::CommaToken)) {
|
||||
(this->Peek()->GetKind() == TokenKind::CommaToken || this->Peek()->GetKind() == TokenKind::CloseCurlyBracket)) {
|
||||
auto statement = dynamic_cast<ParsedExpressionStatement*>(firstItem);
|
||||
auto expr = statement->GetExpression();
|
||||
statement->NullifyExpression();
|
||||
|
|
Loading…
Reference in New Issue