Closed bertyhell closed 1 year ago
@bertyhell - you should be setting the operator precedence by passing a second argument to addBinaryOp
, like addBinaryOp('OR', 1)
and addBinaryOp('AND', 2)
(see source code for default precedence) and the readme for usage instructions
that's it indeed, thank you
When i parse multiple binary operators on the root level i get an unexpected AST:
result:
expected result:
I can get the desired result by adding brackets, but is it possible without the user having to add all the brackets?
The strange thing is that this expression does provide the expected nested tree of binary operators: