-
-
Notifications
You must be signed in to change notification settings - Fork 173
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Grammar parses != in right-associative way #373
Comments
My understanding is that associativity only specifies how multiple occurrences of the same operator are parenthesized. If you combine different operators then operator precedence governs how they are parenthesized and that takes precedence (pun intended) over associativity. |
Oh right, makes sense. Then I guess the grammar is also the proper reference for operator precedence (as it limits the possible parses one can get, as in this case) But then it looks like the parsing by the Haskell implementation not using the right operator precedence: in the |
Oh, that's a bug in the Haskell implementation. It has the precedence of the I can fix that |
Fixes dhall-lang/dhall-lang#373 The standard specifies that `!=` should have higher precedence than `==`, which this change fixes.
Fix is up here: dhall-lang/dhall-haskell#825 |
Fixes dhall-lang/dhall-lang#373 The standard specifies that `!=` should have higher precedence than `==`, which this change fixes.
According to the standard all operators are left-associative
For example, the following expression:
should parse in this way:
However, the only parse the grammar allows in this case is the following:
The issue should be here, as an "equal expression" can contain "not-equal-expression"s, but not viceversa 🤔
The text was updated successfully, but these errors were encountered: