From 24f5d4f4456fce3a9e8cd5a7c1225facd60ae979 Mon Sep 17 00:00:00 2001 From: ubq323 Date: Fri, 21 Jun 2024 18:59:44 +0100 Subject: put state and chunk into new compiler struct; refactor mildly --- vm.h | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'vm.h') diff --git a/vm.h b/vm.h index 6329655..c75df82 100644 --- a/vm.h +++ b/vm.h @@ -8,23 +8,7 @@ typedef struct _thread Thread; #include "val.h" -#include "state.h" - -typedef struct { - struct { - size_t len; - size_t cap; - uint8_t *d; - } bc; - struct { - size_t len; - size_t cap; - Val *d; - } consts; -} Chunk; -Chunk chunk_new(State *S); -size_t chunk_wbc(State *S, Chunk *ch, uint8_t byte); -size_t chunk_wconst(State *S, Chunk *ch, Val v); +#include "com.h" #define STACKSIZE 128 typedef struct _thread { -- cgit v1.2.3