🐐 Arrays with newlines

This commit is contained in:
2026-04-22 15:29:38 +02:00
parent 60b45869fb
commit 634c5a2f93
2 changed files with 32 additions and 2 deletions
+2 -2
View File
@@ -273,14 +273,14 @@ class Parser():
@self.pg.production('array_items : ')
@self.pg.production('array_items : expression')
@self.pg.production('array_items : expression SYMBOL_COMMA array_items')
@self.pg.production('array_items : expression SYMBOL_COMMA opt_newline array_items')
def array_items(calls):
if len(calls) == 0:
return []
elif len(calls) == 1:
return [calls[0]]
else:
return [calls[0]] + calls[2]
return [calls[0]] + calls[3]
@self.pg.production('expression : id')
def expression_id(tokens):