Refactored all OP_ functions to vm/CATEGORY/ and renamed the files.
This commit is contained in:
parent
108be8c41e
commit
50a91d0b6f
67 changed files with 91 additions and 92 deletions
|
|
@ -1,15 +0,0 @@
|
|||
case OP_SLICE: {
|
||||
Value end = pop_value(vm);
|
||||
Value start = pop_value(vm);
|
||||
Value arr = pop_value(vm);
|
||||
if (arr.type != VAL_ARRAY || start.type != VAL_INT || end.type != VAL_INT) {
|
||||
fprintf(stderr, "Runtime type error: SLICE expects (array, int, int)\n");
|
||||
exit(1);
|
||||
}
|
||||
Value out = array_slice(&arr, (int)start.i, (int)end.i);
|
||||
free_value(arr);
|
||||
free_value(start);
|
||||
free_value(end);
|
||||
push_value(vm, out);
|
||||
break;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue