MiSawa / xq

Pure rust implementation of jq
MIT License
333 stars 18 forks source link

Update with nested array slicing behavior difference #48

Closed itchyny closed 2 years ago

itchyny commented 2 years ago

Using nested slicing on LHS of update operator causes behavior difference against jq.

❯ jq -nc '[1,2,3] | .[1:][:1] = [5]'
[1,5,3]

❯ xq -nc '[1,2,3] | .[1:][:1] = [5]'
[1,5]

❯ xq --version
xq 0.1.9-b5d6c8d747459413aadf8298237f1628edbbd9e7
MiSawa commented 2 years ago

Thank you for reporting!

Note for myself: This part require a fix. https://github.com/MiSawa/xq/blob/95558180fabd53143a91d72e226780939461f8c5/src/intrinsic/path.rs#L161