aboutsummaryrefslogtreecommitdiffstats
path: root/src/bytecode/chunk.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/bytecode/chunk.h')
-rwxr-xr-xsrc/bytecode/chunk.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/bytecode/chunk.h b/src/bytecode/chunk.h
index a3e02d1..c584d4a 100755
--- a/src/bytecode/chunk.h
+++ b/src/bytecode/chunk.h
@@ -22,9 +22,11 @@ typedef struct Chunk {
22 char *name; 22 char *name;
23 // Parameters 23 // Parameters
24 StringView *params; 24 StringView *params;
25 // Locals.
26 StringView *locals;
25} Chunk; 27} Chunk;
26 28
27#define NEW_CHUNK(NAME) chunk_init((StringView){(NAME), sizeof(NAME)}) 29#define NEW_CHUNK(NAME) chunk_init((StringView){(NAME), sizeof(NAME) - 1})
28 30
29Chunk * chunk_init(StringView name); 31Chunk * chunk_init(StringView name);
30void add_code(Chunk *chunk, u8 byte, size_t line, size_t col); 32void add_code(Chunk *chunk, u8 byte, size_t line, size_t col);