diff options
| author | Rose Hogenson <rhogenson@posteo.net> | 2023-02-11 21:31:04 -0800 |
|---|---|---|
| committer | Rose Hogenson <rhogenson@posteo.net> | 2023-02-11 21:31:04 -0800 |
| commit | 5989629a7951e544ad4656672025a99ecd08c7c9 (patch) | |
| tree | 89e2ca80f73d8dcf16a9fadcea41b2e141bdf4eb /bytecode/oper.c | |
| parent | aafc502de6f9ecbeb4638b1862f4fa5ac82199d7 (diff) | |
| download | sml-5989629a7951e544ad4656672025a99ecd08c7c9.tar.zst | |
Change how slices work.
I'm switching to a more macro-heavy solution. Hopefully it
proves robust.
Diffstat (limited to 'bytecode/oper.c')
| -rw-r--r-- | bytecode/oper.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bytecode/oper.c b/bytecode/oper.c index fcb7d77..0bdb8f6 100644 --- a/bytecode/oper.c +++ b/bytecode/oper.c @@ -1,11 +1,12 @@ #include <stdbool.h> #include <stdlib.h> +#include "byte_slice.h" #include "encoding.h" #include "heap.h" #include "panic.h" -#include "slice.h" #include "value.h" +#include "value_slice.h" #include "oper.h" @@ -81,15 +82,15 @@ static void op(struct st *s, struct op oper) } } -void run(struct slice prog) +void run(uint8_t_slice prog) { struct st s = { .i = 0, .locals = { 0 }, }; - s.heap = new_heap((struct val_slice) { .size = NUM_LOCALS, .buf = s.locals }); + s.heap = new_heap((value_slice) { .size = NUM_LOCALS, .buf = s.locals }); while (true) { - struct result oper = parse(slice1(prog, s.i)); + struct result oper = parse(uint8_t_slice1(prog, s.i)); s.i += oper.n; op(&s, oper.op); } |
