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 seems to be due to a conflict between the bitwise or operator | and a closure |x, y| ...
This may not be easy to solve... say... foo | bar | baz may be interpreted as: foo, |bar| baz (closure) or foo | bar| baz (operators). Same with || it seems, which is recognized as a closure with no arguments instead of the logical OR operator.
Right now, it favors closures over bitwise OR because bitwise operators are rare. However, you can claim that it is better to favor the logical OR for || over a closure...
I'm not sure if this can be easily resolved without adding complexity to the syntax highlighting...
Thanks for this, I'm using rhai as my Advent og Code challenge when I noticed this issue.
I think it is because of the closure handling. Maybe the order is wrong?
To reproduce just add code with a logical or anywhere and the code until the next logical or is not highlighted.
The text was updated successfully, but these errors were encountered: