Jexl
Jexl copied to clipboard
Minus is not interpreted properly...
Hi @TomFrost
Minus is not interpreted properly...
[1, 2, 3] => OK https://czosel.github.io/jexl-playground/#/?input=%5B1%2C%202%2C%203%5D
[-1, 2, 3] => OK https://czosel.github.io/jexl-playground/#/?input=%5B-1%2C%202%2C%203%5D
[-1, -2, 3] => Error: Token - (binaryOp) unexpected in expression: [-1, - https://czosel.github.io/jexl-playground/#/?input=%5B-1%2C%20-2%2C%203%5D
Same issue with functions like: min(1, -2, 3)
Hi @TomFrost
If I'm not mistaken in the file /lib/Lexer.js
The variable minusNegatesAfter should also contains 'comma'
...
const minusNegatesAfter = [ 'binaryOp', 'unaryOp', 'openParen', 'openBracket', 'question', 'colon' ]
Hi @TomFrost
Do you have any update on this issue, please?
Hi, sorry for the late response on this! Spot-on diagnosis -- I'll look to include this in the next release.
@TomFrost Opened a pull request (https://github.com/TomFrost/Jexl/pull/122) with the suggested change from @OlivierB-OB