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 actually expected. The and operator takes a higher precedence than the or operator, which is why it is indented one further to display this. [Similar example using prettier]
Lua has no real ternary operator here, so they don't have the same precedence. This actually leads to another thing I wanted to implement that prettier does, but haven't yet: adding parentheses to disambiguate associative. The expression is actually evaluated as (foo and bar) or baz, and the parentheses could help to show this. For example if you wrote foo and false or true to replicate a ternary, and foo was truths, this would actually evaluated to true no matter what happens!
I haven't decided to add these parentheses yet due to how common the "ternary pattern" is, so it may be quite invasive
For the following config:
The output for the following line:
is:
The
and
andor
is not lined up. Is this the expected way or is it a bug?The text was updated successfully, but these errors were encountered: