aboutsummaryrefslogtreecommitdiff
path: root/src/tomo.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-28 16:10:37 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-28 16:10:37 -0400
commit312c0a22e76a66b2d905fa6fc8f1f233b85a672b (patch)
tree82098c5234d5b2ca0ff4ca37345656040093556e /src/tomo.c
parent9da5949b953ae5424afb77ff4280399eacf414d4 (diff)
Bugfix for compilation logic using sets
Diffstat (limited to 'src/tomo.c')
-rw-r--r--src/tomo.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/tomo.c b/src/tomo.c
index ec486101..3414d201 100644
--- a/src/tomo.c
+++ b/src/tomo.c
@@ -371,7 +371,7 @@ static void _compile_statement_header_for_library(libheader_info_t *info, ast_t
Path_t path = Path$from_str(use->path);
if (!Table$get(*info->used_imports, &path, Table$info(&Path$info, &Path$info))) {
- Table$set(info->used_imports, &path, ((Bool_t[1]){1}), Table$info(&Text$info, &Bool$info));
+ Table$set(info->used_imports, &path, NULL, Table$info(&Text$info, &Void$info));
CORD_put(compile_statement_type_header(info->env, info->header_path, ast), info->output);
CORD_put(compile_statement_namespace_header(info->env, info->header_path, ast), info->output);
}
@@ -404,10 +404,10 @@ static void _make_typedefs_for_library(libheader_info_t *info, ast_t *ast)
static void _compile_file_header_for_library(env_t *env, Path_t header_path, Path_t path, Table_t *visited_files, Table_t *used_imports, FILE *output)
{
- if (Table$get(*visited_files, &path, Table$info(&Path$info, &Bool$info)))
+ if (Table$has_value(*visited_files, path, Table$info(&Path$info, &Void$info)))
return;
- Table$set(visited_files, &path, ((Bool_t[1]){1}), Table$info(&Path$info, &Bool$info));
+ Table$set(visited_files, &path, NULL, Table$info(&Path$info, &Void$info));
ast_t *file_ast = parse_file(Path$as_c_string(path), NULL);
if (!file_ast) print_err("Could not parse file ", path);
@@ -652,7 +652,7 @@ bool is_config_outdated(Path_t path)
void build_file_dependency_graph(Path_t path, Table_t *to_compile, Table_t *to_link)
{
- if (Table$get(*to_compile, &path, Table$info(&Path$info, &Byte$info)))
+ if (Table$has_value(*to_compile, path, Table$info(&Path$info, &Byte$info)))
return;
staleness_t staleness = {
@@ -693,8 +693,7 @@ void build_file_dependency_graph(Path_t path, Table_t *to_compile, Table_t *to_l
case USE_MODULE: {
Text_t lib = Texts(Text("'" TOMO_HOME "/installed/"),
Text$from_str(use->path), Text("/lib"), Text$from_str(use->path), Text(SHARED_SUFFIX "'"));
- bool t = true;
- Table$set(to_link, &lib, &t, Table$info(&Text$info, &Bool$info));
+ Table$set(to_link, &lib, NULL, Table$info(&Text$info, &Void$info));
List_t children = Path$glob(Path$from_str(String(TOMO_HOME"/installed/", use->path, "/*.tm")));
for (int64_t i = 0; i < children.length; i++) {
@@ -706,14 +705,14 @@ void build_file_dependency_graph(Path_t path, Table_t *to_compile, Table_t *to_l
}
case USE_SHARED_OBJECT: {
Text_t lib = Text$from_str(use->path);
- Table$set(to_link, &lib, ((Bool_t[1]){1}), Table$info(&Text$info, &Bool$info));
+ Table$set(to_link, &lib, NULL, Table$info(&Text$info, &Void$info));
break;
}
case USE_ASM: {
Path_t asm_path = Path$from_str(use->path);
asm_path = Path$concat(Path$parent(path), asm_path);
Text_t linker_text = Path$as_text(&asm_path, NULL, &Path$info);
- Table$set(to_link, &linker_text, ((Bool_t[1]){1}), Table$info(&Text$info, &Bool$info));
+ Table$set(to_link, &linker_text, NULL, Table$info(&Text$info, &Void$info));
break;
}
default: case USE_HEADER: break;