riichard/boolean-parser-js

Queries starting and ending with a nested query create infinite loop. (a AND b) OR (x AND y)

riichard opened this issue · 0 comments

This is because removeOuterBrackets() doesn't recognise that these are outer brackets. Making the split-root function parse the string as follows.

(a AND b) OR (x AND y)

Which after removeOuterBrackets() becomes:

a AND b) OR (x AND y

Which then becomes this with the splitRoot('AND', str) function:

  1. a
  2. b) OR (x
  3. y

The removeOuterBrackets() part creates an issue. Best is to bring some intelligence to there.