Open SanderSpies opened 1 year ago
Make &, &&, |, ||, ++, and :: operators left associative.
The tradeoff here is between JS and OCaml.
Here’s the precedence list of JS: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence#table
and here of OCaml: https://v2.ocaml.org/api/Ocaml_operators.html
The important difference here is:
&, &&, |, ||, ^, :: right associative in OCaml (and current ReasonML default) &, &&, |, ||, + left associative in JS. :: is obviously not present in JS and I decided to make that left associative as well as it “feels” more correct here.
&, &&, |, ||, ^, ::
&, &&, |, ||, +
::
See also: https://github.com/reasonml/reason/issues/2672
Make &, &&, |, ||, ++, and :: operators left associative.
The tradeoff here is between JS and OCaml.
Here’s the precedence list of JS: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Operator_Precedence#table
and here of OCaml: https://v2.ocaml.org/api/Ocaml_operators.html
The important difference here is:
&, &&, |, ||, ^, ::
right associative in OCaml (and current ReasonML default)&, &&, |, ||, +
left associative in JS.::
is obviously not present in JS and I decided to make that left associative as well as it “feels” more correct here.See also: https://github.com/reasonml/reason/issues/2672