fredrikekre / Runic.jl

A code formatter for Julia with rules set in stone.
MIT License
98 stars 3 forks source link

Multiline generator-type syntax in a function is parsed incorrectly #16

Closed DanielVandH closed 3 months ago

DanielVandH commented 3 months ago
all(true for i in
    1
)

is converted into

all(
    true for i in
        1,
)

This new form does not parse correctly. It does pass if no function is provided, i.e. without all (but keeping ( )) it works fine. If not for the trailing comma after the iterator set this would be fine

The parse error is

julia> all(
           true for i in
               1,
       )
ERROR: ParseError:
# Error @ c:\Users\danjv\__test1.jl:4:1
        1,
)
╙ ── unexpected `)`
Stacktrace:
 [1] top-level scope
   @ c:\Users\danjv\__test1.jl:4