stage1 基于新的ast实现部分sema

This commit is contained in:
zzy committed 2026-09-09 10:47:29 +08:00
1 parent 98b35a98e3
commit 8aa7a89c7e
5 files changed
+1316 -1061

No files matched your search

+19 -19
View File
@@ -91,25 +91,25 @@ static int compile_spl(const char *src, const char *fname, const char *outpath,
// memory leak
return 0;
}
// spl_sema_t sema;
// spl_type_t type;
// spl_scope_t scope;
// spl_type_init(&type);
// spl_scope_init(&scope);
// spl_sema_init(&sema, &ast, &type, &scope);
// sema.ast = *
// spl_sema_run(&sema);
// if (sema.error_count) {
// printf("sema errors=%d, no output\n", sema.error_count);
// // memory leak
// return 1;
// }
// if (dump == DUMP_SEMA) {
// spl_sema_dump(&sema);
// spl_ast_dump(&ast, ast.root);
// // memory leak
// return 0;
// }
spl_sema_t sema;
spl_type_t type;
spl_scope_t scope;
spl_type_init(&type);
spl_scope_init(&scope);
spl_sema_init(&sema, &ast, &type, &scope);
sema.ast = *
spl_sema_run(&sema);
if (sema.error_count) {
printf("sema errors=%d, no output\n", sema.error_count);
// memory leak
return 1;
}
if (dump == DUMP_SEMA) {
spl_sema_dump(&sema);
spl_ast_dump(&ast, ast.root);
// memory leak
return 0;
}
// spl_ast2ir_t a2ir;
// spl_ir_builder_t ir_builder;