Remove unused code

This commit is contained in:
Bruce Hill 2024-05-27 18:02:40 -04:00
parent c9889582a7
commit cb634f61f7
3 changed files with 2 additions and 6 deletions

View File

@ -833,13 +833,10 @@ CORD compile_statement(env_t *env, ast_t *ast)
case Use: {
auto use = Match(ast, Use);
const char *path = use->raw_path;
const char *name = file_base_name(path);
if (strncmp(path, "./", 2) == 0 || strncmp(path, "../", 3) == 0) {
env->code->imports = CORD_all(env->code->imports, "#include \"", path, ".h\"\n");
env->code->object_files = CORD_all(env->code->object_files, "'", path, ".o' ");
} else {
env->code->imports = CORD_all(env->code->imports, "#include <", path, ".h>\n");
env->code->object_files = CORD_all(env->code->object_files, "-l", name, " ");
}
return CORD_EMPTY;
}
@ -2246,7 +2243,6 @@ module_code_t compile_file(ast_t *ast)
return (module_code_t){
.module_name=name,
.env=env,
.object_files=env->code->object_files,
.header=CORD_all(
// "#line 1 ", Text$quoted(ast->file->filename, false), "\n",
"#include <tomo/tomo.h>\n",

View File

@ -12,7 +12,7 @@
typedef struct {
const char *module_name;
env_t *env;
CORD header, c_file, object_files;
CORD header, c_file;
} module_code_t;
CORD expr_as_text(env_t *env, CORD expr, type_t *t, CORD color);

2
tomo.c
View File

@ -242,7 +242,7 @@ int transpile(const char *filename, bool force_retranspile, module_code_t *modul
ast_t *ast = parse_file(f, NULL);
if (!ast)
errx(1, "Could not compile!");
errx(1, "Could not compile %s", f);
if (verbose) {
FILE *out = popen(heap_strf("bat -P --file-name='%s'", filename), "w");