javascript-cas icon indicating copy to clipboard operation
javascript-cas copied to clipboard

Bracket insertion is messy / inefficient

Open aantthony opened this issue 11 years ago • 0 comments

In order to quickly fix compilation of x - (y - z), I made it always insert the parentheses if the operator is not associative or the precedence requires it.

Each operator has an associative property which signifies the direction that it is grouped in, but it only needs to insert the parentheses if the precedence requires it, or the associative property is non-zero and points in the other direction.

aantthony avatar Apr 06 '14 13:04 aantthony