From addd54dc31603dc204773d3108dba4e000cd7657 Mon Sep 17 00:00:00 2001 From: A404M Date: Tue, 8 Oct 2024 04:16:27 +0330 Subject: added fasm support added compiler options tried to compile to fasm first --- src/vm/runner/runner.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/vm/runner/runner.c') diff --git a/src/vm/runner/runner.c b/src/vm/runner/runner.c index 9836ad0..742ec16 100644 --- a/src/vm/runner/runner.c +++ b/src/vm/runner/runner.c @@ -4,8 +4,6 @@ #include #include #include -#include -#include const BuiltinFunction BUILTIN_FUNCTIONS[] = { print, @@ -26,6 +24,20 @@ bool runner(SourceCode *sourceCode) { return false; } +bool runnerWithPrint(SourceCode *sourceCode) { + Instructions instructions = codeGeneratorWithPrint(sourceCode); + if (instructions.size != ERROR_SIZE) { + printf("----generated code:\n"); + printInstructions(instructions); + printf("----running:\n"); + bool ranSuccess = _runner(instructions); + deleteInstructions(instructions); + return ranSuccess; + } + fprintf(stderr,"error in code generator\n"); + return false; +} + bool _runner(Instructions instructions) { size_t stack_size = 0; void **stack = a404m_malloc(stack_size * sizeof(void *)); -- cgit v1.2.3