mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 14:54:07 +10:00
Allow trailing commas when writing a compound
This commit is contained in:
@@ -168,6 +168,10 @@ static Toy_Opcode compound(Toy_Parser* parser, Toy_ASTNode** nodeHandle) {
|
||||
consume(parser, TOY_TOKEN_COMMA, "Expected ',' in array or dictionary");
|
||||
}
|
||||
|
||||
if (match(parser, TOY_TOKEN_BRACKET_RIGHT)) { //allow for trailing commas
|
||||
break;
|
||||
}
|
||||
|
||||
iterations++;
|
||||
|
||||
Toy_ASTNode* left = NULL;
|
||||
|
||||
Reference in New Issue
Block a user