From 6310ec69d2adb576a4db19a2b3b567571920e605 Mon Sep 17 00:00:00 2001 From: ionut Date: Thu, 14 May 2026 23:45:37 +0300 Subject: [PATCH] Lex is unemployed --- src/compiler.h | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/compiler.h b/src/compiler.h index 29653bf..2070c55 100644 --- a/src/compiler.h +++ b/src/compiler.h @@ -1,5 +1,27 @@ #include "types.h" +#include "vm.h" +#include "parser.h" + +typedef struct noomC_Local { + unsigned int startpc; + unsigned int endpc; + char *name; + bool dropped; + bool constant; + bool close; +} noomC_Local; typedef struct noomC_Compiler { - + // steal constants from this + struct noomC_Compiler *parent; + unsigned localc, constc; + unsigned localcap, constcap; + // constants index in the stack. + // We put it there so GC doesn't free them. + unsigned constidx; + unsigned curstack; + noomC_Local *locals; } noomC_Compiler; + +// pushes the compiled function on the stack, or just crashes lol +noom_Exit noomC_compile(noom_LuaVM *vm, noomP_Node *node);