-
Notifications
You must be signed in to change notification settings - Fork 109
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 rules in proposed spec text seem incomplete #290
Comments
It actually doesn't matter whether the pipe is left- or right-associative; either associativity gives identical evaluation results. I'm not sure if that affects your point, just saying. |
Oh, excellent point! If it works as right-associative, then I'm no longer concerned about the proposed operator precedence. Thanks. In that case, I think we just need the proposed spec to include a modification to the expansion rules for AssignmentExpression to indicate that it can be a PipeExpression. |
Based on the description in README.md, it seems that the pipeline operator is intended to be left-associative:
a |> b |> c
is equivalent to(a |> b) |> c
. The proposed spec text defines the following production:However, the proposed text does not include any rules for how ShortCircuitExpression can be a PipeExpression, which I assume would be necessary for parsing
a |> b |> c
.Furthermore, in order for the grammar to be unambiguous, the right side of the PipeExpression production should be something which can't be a PipeExpression. If we assume ShortCircuitExpression can be a PipeExpression, then PipeBody can also be a PipeExpression with the current production rules, which causes ambiguity. I expect the production to be of the form:
I expect it will be somewhat difficult to define unambiguous grammar rules for a new left-associative operator which is at the same precedence level as a bunch of existing right-associative operators; this may be indicative of a fundamental problem with the currently proposed precedence level.
The text was updated successfully, but these errors were encountered: