]> granicus.if.org Git - jq/commit
Fix destructuring alternation fix-destructuring-alternation
authorWilliam Langford <wlangfor@gmail.com>
Sat, 18 Aug 2018 02:47:13 +0000 (22:47 -0400)
committerWilliam Langford <wlangfor@gmail.com>
Sat, 18 Aug 2018 03:15:48 +0000 (23:15 -0400)
commit0673dee1b38db5d49ae3f8cda0ba53fa4021c3ba
tree4b6f2dedc4115a3dcec65778d5faad42236fa459
parent3dc5f4e948b1114c37a9afd3060dacf099892689
Fix destructuring alternation

Attempting to use the existing FORK_OPT opcode resulted in difficulty
knowing when to pop an error message off the stack and when not to. This
commit makes DESTRUCTURE_ALT a real opcode that is identical to
FORK_OPT, except for never pushing the error message onto the stack when
continuing from an error backtrack.

Some small changes were necessary to the DUP/POP behavior surrounding
destructuring to accomodate this.
src/compile.c
src/execute.c
src/opcode_list.h
tests/jq.test