Serialise bytecode to file

This commit is contained in:
2026-06-27 17:51:35 +10:00
parent b427787f73
commit ab6580b591
2 changed files with 12 additions and 2 deletions

View File

@@ -77,6 +77,11 @@ struct _SolsTokenTypeMap SolsTokenTypeMap[] = {
{"subtracts", STT_OP_SUBTO},
{"multiplies", STT_OP_MULTO},
{"divides", STT_OP_DIVTO},
{"function", STT_KW_DEF},
{"func", STT_KW_DEF},
{"fn", STT_KW_DEF},
{"ion", STT_KW_DEF},
{"fun", STT_KW_DEF},
{"class", STT_KW_STRUCT},
{"compilerpleasedothisforme", STT_KW_PRAGMA}
#endif

View File

@@ -231,8 +231,13 @@ int main(int argc, char** argv) {
break;
}
case SA_BYTECODE: {
// FIXME
//serializeProgramToFile(args.outputFile, &codegen.as.success);
GroundState state = {
.catches = NULL,
.labels = NULL,
.variables = NULL
};
GroundBytecode bc = Ground.New.Bytecode(&codegen.as.success, &state);
Ground.Bytecode.save(&bc, args.outputFile);
break;
}
case SA_COMPILE: {