MiSawa / xq

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

Fix label with recursion #72

Closed MiSawa closed 2 years ago

MiSawa commented 2 years ago

Fix #65

itchyny commented 2 years ago

Great improvement, but maybe introduced a bug?

❯ xq -n 'def f: label $x | if . < 5 then ., (. + 1 | f, break $x, .) else . end; 1 | f'
1
2
3
4
5
Error: Breaking(LabelId(4))

❯ jq -n 'def f: label $x | if . < 5 then ., (. + 1 | f, break $x, .) else . end; 1 | f'
1
2
3
4
5
MiSawa commented 2 years ago

Ah hmmmm, thank you. Why....