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,14 +0,0 @@
|
|||
case OP_LT: {
|
||||
Value b = pop_value(vm);
|
||||
Value a = pop_value(vm);
|
||||
if (a.type != VAL_INT || b.type != VAL_INT) {
|
||||
fprintf(stderr, "Runtime type error: LT expects ints, got %s and %s\n",
|
||||
value_type_name(a.type), value_type_name(b.type));
|
||||
exit(1);
|
||||
}
|
||||
Value res = make_int(a.i < b.i ? 1 : 0);
|
||||
free_value(a);
|
||||
free_value(b);
|
||||
push_value(vm, res);
|
||||
break;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue