Begin to codegen bytecode instructions

This commit is contained in:
Krzosa Karol
2022-06-21 15:49:39 +02:00
parent 6ed17a3c1c
commit 2c3a8dc764
6 changed files with 59 additions and 6 deletions

View File

@@ -161,8 +161,10 @@ want to export all the symbols, we can namespace them optionally.
#include "parsing.cpp"
#include "typechecking.h"
#include "typechecking.cpp"
#include "ccodegen.cpp"
#include "c_codegen.cpp"
#include "bytecode_interpreter.cpp"
#include "bytecode_codegen.cpp"
int main(int argument_count, char **arguments){
@@ -176,11 +178,9 @@ int main(int argument_count, char **arguments){
test_intern_table();
test_interpreter();
__debugbreak();
exit(0);
emit_line_directives = true;
String program_name = "main.kl"_s;
String program_name = "vm.kl"_s;
if(argument_count > 1){
program_name = string_from_cstring(arguments[1]);
}
@@ -211,6 +211,8 @@ int main(int argument_count, char **arguments){
arena_clear(&pctx->stage_arena);
compile_to_bc();
__debugbreak();
String result = get_compilation_result();
assert(os_write_file("program.c"_s, result));
{