EricSmekens / jsep

JavaScript Expression Parser
http://ericsmekens.github.io/jsep/
MIT License
840 stars 136 forks source link

Using and/or wrapped in parenthesis is not working #226

Closed mateusmoury closed 2 years ago

mateusmoury commented 2 years ago

Hi!

Trying to build a very simple expression in the Demo section of https://ericsmekens.github.io/jsep/, but it throws an error, as if I'm missing a closing ):

Screen Shot 2022-06-02 at 20 26 19

Is this expected? I was planning to use jsep to build expressions like the following:

(x > 4 and w == "hey") or (x <= 4 and w == "hello")
6utt3rfly commented 2 years ago

@mateusmoury - you just have to add and (and or) as custom binary operators. The source code shows the default operators (in your example, &&)