Open normalser opened 8 years ago
The problem occurs at lexer rewrite pass. Specifically regarding implicit object. The comma after x
is interpreted as field separator of the implicit object (my mistake, not the real reason) rather than a part of the loophead.
IMHO this is (yet again) a problem with current (hacky) lexer design. It has something to do with how for
loop is handled right now, which I planned to fix (but couldn't find time as it's a big change).
Tokens after rewrite:
{ ID:a : FOR: ID:x }: , ID:y OF { } INDENT:0 ID:x DEDENT:0 NEWLINE:\n
Hi,
Sorry if duplicate (couldn't find one):
a: for x,y of {} => x
=> Fails withUnexpected '}'
a: for x of {} => x
=> Works finea= for x,y of {} => x
=> Works finea: for x,y in [] => x
=> Works fine