Incorrect default value for start
when step
is negative in the slice selector
#546
Labels
Milestone
start
when step
is negative in the slice selector
#546
Package
Library
Describe the bug
According to RFC 9535, the default value for
start
depends on the sing ofstep
and islen - 1
whenstep < 0
. The JSONPath parser always uses0
as the default value forstart
.Minimal Reproducible Example
Expected behavior
$[::-1]
and$[0::-1]
are different queries, so their ASTs generated by the parser can't be equal.The
start
field of theSlice
struct should probably be of typeOption<Index>
and set toNone
if the value is omitted, just like theend
field.Workarounds (optional)
No response
Proposed solution (optional)
No response
Version of the release
v0.9.1
Rust version
1.80.1
Target triple
aarch64-apple-darwin
Features enabled
default
Codegen options
No response
Additional context (optional)
No response
The text was updated successfully, but these errors were encountered: