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.
49 lines
1.2 KiB
C
49 lines
1.2 KiB
C
OP(LOADK, CONSTANT, 1, 1)
|
|
OP(DUP, NONE, 1, 2)
|
|
OP(DUPN, NONE, 1, 2)
|
|
OP(DUP2, NONE, 2, 3)
|
|
OP(PUSHK_UNDER, CONSTANT, 1, 2)
|
|
OP(POP, NONE, 1, 0)
|
|
OP(LOADV, VARIABLE, 1, 1)
|
|
OP(LOADVN, VARIABLE, 1, 1)
|
|
OP(STOREV, VARIABLE, 1, 0)
|
|
OP(STORE_GLOBAL, GLOBAL, 0, 0)
|
|
OP(INDEX, NONE, 2, 1)
|
|
OP(INDEX_OPT, NONE, 2, 1)
|
|
OP(EACH, NONE, 1, 1)
|
|
OP(EACH_OPT, NONE, 1, 1)
|
|
OP(FORK, BRANCH, 0, 0)
|
|
OP(FORK_OPT, BRANCH, 0, 0)
|
|
OP(JUMP, BRANCH, 0, 0)
|
|
OP(JUMP_F,BRANCH, 1, 0)
|
|
OP(BACKTRACK, NONE, 0, 0)
|
|
OP(APPEND, VARIABLE,1, 0)
|
|
OP(INSERT, NONE, 4, 2)
|
|
OP(RANGE, VARIABLE, 1, 1)
|
|
|
|
OP(SUBEXP_BEGIN, NONE, 1, 2)
|
|
OP(SUBEXP_END, NONE, 2, 2)
|
|
|
|
OP(PATH_BEGIN, NONE, 1, 2)
|
|
OP(PATH_END, NONE, 2, 1)
|
|
|
|
OP(CALL_BUILTIN, CFUNC, -1, 1)
|
|
|
|
OP(CALL_JQ, UFUNC, 1, 1)
|
|
OP(RET, NONE, 1, 1)
|
|
OP(TAIL_CALL_JQ, UFUNC, 1, 1)
|
|
|
|
OP(CLOSURE_PARAM, DEFINITION, 0, 0)
|
|
OP(CLOSURE_REF, CLOSURE_REF_IMM, 0, 0)
|
|
OP(CLOSURE_CREATE, DEFINITION, 0, 0)
|
|
OP(CLOSURE_CREATE_C, DEFINITION, 0, 0)
|
|
|
|
OP(TOP, NONE, 0, 0)
|
|
OP(CLOSURE_PARAM_REGULAR, DEFINITION, 0, 0)
|
|
OP(DEPS, CONSTANT, 0, 0)
|
|
OP(MODULEMETA, CONSTANT, 0, 0)
|
|
OP(GENLABEL, NONE, 0, 1)
|
|
|
|
OP(DESTRUCTURE_ALT, BRANCH, 0, 0)
|
|
OP(STOREVN, VARIABLE, 1, 0)
|