Fix single item numerical tables being parsed as complex tables

This commit is contained in:
Deukhoofd 2019-09-12 20:57:53 +02:00
parent 0266b3c616
commit 80f3af22ac
Signed by: Deukhoofd
GPG Key ID: ADF2E9256009EDCE
1 changed files with 1 additions and 1 deletions

View File

@ -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();