Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minus is not interpreted properly... #97

Open
OlivierB-OB opened this issue Dec 11, 2020 · 4 comments
Open

Minus is not interpreted properly... #97

OlivierB-OB opened this issue Dec 11, 2020 · 4 comments
Labels

Comments

@OlivierB-OB
Copy link

OlivierB-OB commented Dec 11, 2020

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)

@OlivierB-OB
Copy link
Author

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' ]

@prafullkulkarni
Copy link

Hi @TomFrost

Do you have any update on this issue, please?

@TomFrost
Copy link
Owner

Hi, sorry for the late response on this! Spot-on diagnosis -- I'll look to include this in the next release.

@Dossar
Copy link

Dossar commented Jun 9, 2022

@TomFrost Opened a pull request (#122) with the suggested change from @OlivierB-OB

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants