jmespath-ts icon indicating copy to clipboard operation
jmespath-ts copied to clipboard

Catch invalid slice expressions at compile time

Open mkantor opened this issue 3 years ago • 0 comments

For programs which compile expressions and then later evaluate them it is nice to flag invalid syntax during the compilation stage.

As far as I can tell, invalid slices with a step of 0 were the only realistic situation where this wasn't already the case (it's validated by TreeInterpreter.ts but ignored in the compiler). This pull request changes that to make invalid slice expressions like a[2:1:0] trigger compilation errors.

mkantor avatar Dec 21 '21 15:12 mkantor