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
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:
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: