You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the opposite of what I'd expect: based on the indentation, I would've thought it would be parsed as f({ a|> b }), not f({ a }) |> b. If I use an explicit slash:
f
* a \
|> b
then it compiles like I'd expect:
returnf({ -- 2b(a) -- 2
}) -- 3
I'm not sure if this is intentional? But it was certainly rather confusing 😅
The text was updated successfully, but these errors were encountered:
The multiline pipes are parsed as statements instead of parts of an expression for the moment. So that the newline characters are breaking the expression in the end of function call argument. If we make pipe syntax a higher precedence, the example codes above will be parsed as:
That makes sense, but I feel like the indentation is what makes this weirder? Like I'd certainly expect that behavior from, say:
f
* a
|> b
which is closer to the example you gave in terms of indentation. The weird part in the original example to me is that it's reaching across multiple levels of indentation.
Right now, if I compile this code:
the resulting Lua is:
This is the opposite of what I'd expect: based on the indentation, I would've thought it would be parsed as
f({ a|> b })
, notf({ a }) |> b
. If I use an explicit slash:then it compiles like I'd expect:
I'm not sure if this is intentional? But it was certainly rather confusing 😅
The text was updated successfully, but these errors were encountered: