JQuery-expression-builder
JQuery-expression-builder copied to clipboard
Adding the inBrackets attribute to the Binary Node in Expression tree to keep the original brackets.
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.