mirror of
https://github.com/CatalaLang/catala.git
synced 2024-11-08 07:51:43 +03:00
2003566867
Closes #373 This forbids expressions such as `a and b or c`, avoiding the need to set an implicit priority between `and`, `or` and `xor`, which I find error-prone. Instead, when that appears, a message asking for explicit parentheses will be shown to the user. Implementation note: since that would be extremely tedious to do in the parser directly, the parser is set to allow right-associativity without discrimination for the logical operators, and the check is done during desugaring. This required to explicit parentheses in the surface AST to discriminate the case where the priority was explicit. |
||
---|---|---|
.. | ||
bad | ||
good |