diff --git a/include/groundvm.h b/include/groundvm.h index 58bb07a..c35c5a5 100644 --- a/include/groundvm.h +++ b/include/groundvm.h @@ -170,6 +170,7 @@ GroundProgram groundCreateProgram(); void groundAddInstructionToProgram(GroundProgram* program, GroundInstruction instruction); GroundValue groundRunProgram(GroundProgram* program); void groundPrintProgram(GroundProgram* program); +char* groundCompileProgram(GroundProgram* program); GroundInstruction groundCreateInstruction(GroundInstType type); void groundAddValueToInstruction(GroundInstruction* inst, GroundValue value); diff --git a/src/interface.c b/src/interface.c index 2f41515..511cb43 100644 --- a/src/interface.c +++ b/src/interface.c @@ -1,5 +1,6 @@ #include "parser.h" #include "interpreter.h" +#include "compiler.h" #include "types.h" #include @@ -123,3 +124,7 @@ void groundAddValueToScope(GroundScope* gs, const char* name, GroundValue value) void groundAddFieldToStruct(GroundStruct* gstruct, char* name, GroundValue field) { addFieldToStruct(gstruct, name, field); } + +char* groundCompileProgram(GroundProgram* program) { + return compileGroundProgram(program); +}