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
{{ message }}
This repository was archived by the owner on Jan 26, 2022. It is now read-only.
On the left, |> is as tight as assignment operators. This allows parsing x = y |> z as x = (y |> z), and x ? y : z |> w as (x ? y : z) |> w.
That ternary example is super confusing, and it's different than how arrows are parsed:
// arrow:x ? y : z=>w;// parsed asx ? y : (z=>w);
The spec seems to say arrows and pipelines would bind at the same level, so I'd think the ternary example would be x ? y : (z |> w)
When I load this into AST explorer, I actually get the same results for pipeline and arrow, but maybe that's just because babel hasn't fixed the right-associativity of the operator yet.
Spinning this out of #11:
That ternary example is super confusing, and it's different than how arrows are parsed:
The spec seems to say arrows and pipelines would bind at the same level, so I'd think the ternary example would be
x ? y : (z |> w)When I load this into AST explorer, I actually get the same results for pipeline and arrow, but maybe that's just because babel hasn't fixed the right-associativity of the operator yet.
/cc @nicolo-ribaudo