JQuery-expression-builder icon indicating copy to clipboard operation
JQuery-expression-builder copied to clipboard

Adding the inBrackets attribute to the Binary Node in Expression tree to keep the original brackets.

Open FaizanZafar89 opened this issue 5 years ago • 0 comments

Hi Majid,

First of All, A very decent library. I was trying to use this in a use-case where i am saving the Expression as JSON tree and then evaluating the expression with variable values in the context. Its working beautifully.

The only problem is with displaying the Expression again. Now, you do provide a toString function but the it is adding the brackets to all the binary Nodes which will create too many brackets. So if we add the inBracket property with binary node while creating the tree, then it will be able to retain the original composition of brackets in the input.

So, in short right now (a+b+c) becomes ((a+b)+c), if this can be prevented in any way, please advise.

Thanks.

FaizanZafar89 avatar Nov 12 '21 21:11 FaizanZafar89