diff options
Diffstat (limited to 'com.h')
-rw-r--r-- | com.h | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -7,10 +7,24 @@ typedef struct _compiler Compiler; #include "chunk.h" +typedef struct { + char *name; + uint8_t slot; +} Local; + +#define MAX_LOCALS 256 +typedef struct _scope Scope; +struct _scope { + Scope *outer; + uint8_t nlocals; + Local locals[MAX_LOCALS]; +}; + struct _compiler { State *S; Chunk *ch; int stack_cur; + Scope *scope; }; Compiler compiler_new(Compiler *outer, Chunk *ch); |