MiSawa / xq

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

Fix path tracking on value arguments #154

Closed itchyny closed 2 years ago

itchyny commented 2 years ago

I received a bug report to gojq (https://github.com/itchyny/gojq/issues/186). This bug is reproducible in xq as well. I fixed the bug.

 $ xq -n 'def f($x): .y; path(f(.x))'
[
  "x",
  "y"
]
 $ jq -n 'def f($x): .y; path(f(.x))'
[
  "y"
]
MiSawa commented 2 years ago

Ah hmmm, I think I don't fully understand the semantic of path, but what jq does should be correct I guess. Thank you for porting the fix! Merging with a belief that this didn't cause the CI/tidy failure and #155 resolved it.