compiler now compiles some things
This commit is contained in:
parent
9616fb616e
commit
ce345f2440
13 changed files with 425 additions and 74 deletions
|
|
@ -1,11 +1,14 @@
|
|||
#ifndef CHUNK_H
|
||||
#define CHUNK_H
|
||||
|
||||
#define CHUNK_DEBUG 0
|
||||
|
||||
#include "common.h"
|
||||
#include "object.h"
|
||||
|
||||
/** Bytecode chunk */
|
||||
typedef struct Bc {
|
||||
I ref;
|
||||
U8 *items;
|
||||
Z count, capacity;
|
||||
struct {
|
||||
|
|
@ -14,9 +17,12 @@ typedef struct Bc {
|
|||
} constants;
|
||||
} Bc;
|
||||
|
||||
Bc *chunk_new(V);
|
||||
V chunk_acquire(Bc *);
|
||||
V chunk_release(Bc *);
|
||||
|
||||
V chunk_emit_byte(Bc *, U8);
|
||||
V chunk_emit_sleb128(Bc *, I);
|
||||
I chunk_add_constant(Bc *, O);
|
||||
V chunk_free(Bc *);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue