Open qinjunhang opened 11 months ago
The lexer seems to not have a token for open/close parenthesis. Adding that would solve it.
let lexer = moo.compile({
space: {match: /\s+/, lineBreaks: true},
number: /-?(?:[0-9]|[1-9][0-9]+)(?:\.[0-9]+)?(?:[eE][-+]?[0-9]+)?\b/,
string: /"(?:\\["bfnrt\/\\]|\\u[a-fA-F0-9]{4}|[^"\\])*"/,
key: /[a-zA-Z-_]+/,
comparator: /=|<|<=|>=|>|!=/,
lparen: '(',
rparen: ')',
})
(Also, wql.ne
seems to have some ambiguities. Notably: in expression
, there is a _
both inside and outside condition
. Also, since there is a lexer, character classes like [a-zA-Z-_]
behave incorrectly. In this case, both [a-zA-Z-_]
and %string
can match at the same time.)
The content of wql.ne is: