Expose compiler in groundvm.h

This commit is contained in:
2026-01-21 15:54:18 +11:00
parent 063e85d24a
commit 3e9ce0dfc0
2 changed files with 6 additions and 0 deletions

View File

@@ -170,6 +170,7 @@ GroundProgram groundCreateProgram();
void groundAddInstructionToProgram(GroundProgram* program, GroundInstruction instruction); void groundAddInstructionToProgram(GroundProgram* program, GroundInstruction instruction);
GroundValue groundRunProgram(GroundProgram* program); GroundValue groundRunProgram(GroundProgram* program);
void groundPrintProgram(GroundProgram* program); void groundPrintProgram(GroundProgram* program);
char* groundCompileProgram(GroundProgram* program);
GroundInstruction groundCreateInstruction(GroundInstType type); GroundInstruction groundCreateInstruction(GroundInstType type);
void groundAddValueToInstruction(GroundInstruction* inst, GroundValue value); void groundAddValueToInstruction(GroundInstruction* inst, GroundValue value);

View File

@@ -1,5 +1,6 @@
#include "parser.h" #include "parser.h"
#include "interpreter.h" #include "interpreter.h"
#include "compiler.h"
#include "types.h" #include "types.h"
#include <stdlib.h> #include <stdlib.h>
@@ -123,3 +124,7 @@ void groundAddValueToScope(GroundScope* gs, const char* name, GroundValue value)
void groundAddFieldToStruct(GroundStruct* gstruct, char* name, GroundValue field) { void groundAddFieldToStruct(GroundStruct* gstruct, char* name, GroundValue field) {
addFieldToStruct(gstruct, name, field); addFieldToStruct(gstruct, name, field);
} }
char* groundCompileProgram(GroundProgram* program) {
return compileGroundProgram(program);
}