diff options
Diffstat (limited to 'vm.c')
-rw-r--r-- | vm.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -233,8 +233,23 @@ int runvm(State *S) { goto done; break; + case OP_ARRNEW: { + ObjArr *a = objarr_new(S); + PUSH(VAL_OBJ(a)); + break; + } + case OP_ARRAPPEND: { + Val v = POP(); + Val a = PEEK(); + CHECK(IS_ARR(a), "can only append to array"); + ObjArr *arr = AS_ARR(a); + objarr_append(S, arr, v); + break; } + } + + } done:; return status; |