Closed brandonspark closed 1 year ago
This fails for me on some basic expressions:
# generators.jl
(x for x in xs)
Works again if you add an if_clause
:
# generators.jl
(x for x in xs if x != missing)
We probably need tests without if clauses.
Nice, thanks for catching that @savq.
What: Currently, generators are only limitedly supported. We don't allow newlines between clauses of the comprehension, so things like
parse fine, but if you change it to any of the following:
it breaks.
Why: We should do this, because this actually happens.
How: Added some extra optional terminators. These should allow generous use of newlines and semicolons.
I also needed to add precedence to
for_clause
andif_clause
overfor_statement
andif_statement
. This was so generators would not parse as parenthesized expressions containingfor
statements, and related.