aboutsummaryrefslogtreecommitdiff
path: root/src/compile
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-09-09 20:10:39 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-09-09 20:10:39 -0400
commit25d85a501d0e5fb8bd9a76376e3868713dd56fdb (patch)
tree9ba81bb51b41d19284ba02ec1197ae81f31b263c /src/compile
parentfb216e955f04a803f11953be27e76bd4d2c9e76d (diff)
parentd64dcab138a34d5f5105e08f0a840f7cb5a1d159 (diff)
Merge branch 'main' into table-colonstable-colons
Diffstat (limited to 'src/compile')
-rw-r--r--src/compile/headers.c2
-rw-r--r--src/compile/indexing.c4
-rw-r--r--src/compile/statements.c2
3 files changed, 4 insertions, 4 deletions
diff --git a/src/compile/headers.c b/src/compile/headers.c
index 6dc69f03..33a979cf 100644
--- a/src/compile/headers.c
+++ b/src/compile/headers.c
@@ -171,7 +171,7 @@ Text_t compile_statement_type_header(env_t *env, Path_t header_path, ast_t *ast)
Path_t build_dir = Path$resolved(Path$parent(header_path), Path$current_dir());
switch (use->what) {
case USE_MODULE: {
- module_info_t mod = get_module_info(ast);
+ module_info_t mod = get_used_module_info(ast);
glob_t tm_files;
const char *folder = mod.version ? String(mod.name, "_", mod.version) : mod.name;
if (glob(String(TOMO_PATH, "/lib/tomo_" TOMO_VERSION "/", folder, "/[!._0-9]*.tm"), GLOB_TILDE, NULL,
diff --git a/src/compile/indexing.c b/src/compile/indexing.c
index 39af1160..1510e924 100644
--- a/src/compile/indexing.c
+++ b/src/compile/indexing.c
@@ -52,13 +52,13 @@ Text_t compile_indexing(env_t *env, ast_t *ast) {
if (table_type->default_value) {
return Texts("Table$get_or_default(", compile_to_pointer_depth(env, indexing->indexed, 0, false), ", ",
compile_type(table_type->key_type), ", ", compile_type(table_type->value_type), ", ",
- compile(env, indexing->index), ", ",
+ compile_to_type(env, indexing->index, table_type->key_type), ", ",
compile_to_type(env, table_type->default_value, table_type->value_type), ", ",
compile_type_info(container_t), ")");
} else {
return Texts("Table$get_optional(", compile_to_pointer_depth(env, indexing->indexed, 0, false), ", ",
compile_type(table_type->key_type), ", ", compile_type(table_type->value_type), ", ",
- compile(env, indexing->index),
+ compile_to_type(env, indexing->index, table_type->key_type),
", "
"_, ",
promote_to_optional(table_type->value_type, Text("(*_)")), ", ",
diff --git a/src/compile/statements.c b/src/compile/statements.c
index bde9ae36..3fc44ac4 100644
--- a/src/compile/statements.c
+++ b/src/compile/statements.c
@@ -188,7 +188,7 @@ static Text_t _compile_statement(env_t *env, ast_t *ast) {
Text_t suffix = get_id_suffix(Path$as_c_string(path));
return with_source_info(env, ast, Texts("$initialize", suffix, "();\n"));
} else if (use->what == USE_MODULE) {
- module_info_t mod = get_module_info(ast);
+ module_info_t mod = get_used_module_info(ast);
glob_t tm_files;
const char *folder = mod.version ? String(mod.name, "_", mod.version) : mod.name;
if (glob(String(TOMO_PATH, "/lib/tomo_" TOMO_VERSION "/", folder, "/[!._0-9]*.tm"), GLOB_TILDE, NULL,