aboutsummaryrefslogtreecommitdiff
path: root/src/compile
diff options
context:
space:
mode:
Diffstat (limited to 'src/compile')
-rw-r--r--src/compile/cli.c2
-rw-r--r--src/compile/lists.c2
-rw-r--r--src/compile/tables.c10
3 files changed, 7 insertions, 7 deletions
diff --git a/src/compile/cli.c b/src/compile/cli.c
index 5130b97b..63a467ca 100644
--- a/src/compile/cli.c
+++ b/src/compile/cli.c
@@ -38,7 +38,7 @@ static Text_t get_flag_options(type_t *t, Text_t separator) {
} else if (t->tag == ListType) {
Text_t item_option = get_flag_options(Match(t, ListType)->item_type, separator);
return Texts(item_option, "1 ", item_option, "2...");
- } else if (t->tag == TableType && Match(t, TableType)->value_type == EMPTY_TYPE) {
+ } else if (t->tag == TableType && Match(t, TableType)->value_type == PRESENT_TYPE) {
Text_t item_option = get_flag_options(Match(t, TableType)->key_type, separator);
return Texts(item_option, "1 ", item_option, "2...");
} else if (t->tag == TableType) {
diff --git a/src/compile/lists.c b/src/compile/lists.c
index 97b0b85d..31255c1e 100644
--- a/src/compile/lists.c
+++ b/src/compile/lists.c
@@ -254,7 +254,7 @@ Text_t compile_list_method_call(env_t *env, ast_t *ast) {
} else if (streq(call->name, "unique")) {
self = compile_to_pointer_depth(env, call->self, 0, false);
(void)compile_arguments(env, ast, NULL, call->args);
- return Texts("Table$from_entries(", self, ", Table$info(", compile_type_info(item_t), ", &Empty$$info))");
+ return Texts("Table$from_entries(", self, ", Table$info(", compile_type_info(item_t), ", &Present$$info))");
} else if (streq(call->name, "pop")) {
EXPECT_POINTER();
arg_t *arg_spec = new (arg_t, .name = "index", .type = INT_TYPE, .default_val = FakeAST(Int, "-1"));
diff --git a/src/compile/tables.c b/src/compile/tables.c
index 54276c3b..e624f9fb 100644
--- a/src/compile/tables.c
+++ b/src/compile/tables.c
@@ -13,7 +13,7 @@ static ast_t *add_to_table_comprehension(ast_t *entry, ast_t *subject) {
return WrapAST(
entry, MethodCall, .name = "set", .self = subject,
.args = new (arg_ast_t, .value = e->key,
- .next = new (arg_ast_t, .value = e->value ? e->value : WrapAST(entry, Var, .name = "EMPTY"))));
+ .next = new (arg_ast_t, .value = e->value ? e->value : WrapAST(entry, Var, .name = "PRESENT"))));
}
Text_t compile_typed_table(env_t *env, ast_t *ast, type_t *table_type) {
@@ -51,10 +51,10 @@ Text_t compile_typed_table(env_t *env, ast_t *ast, type_t *table_type) {
for (ast_list_t *entry = table->entries; entry; entry = entry->next) {
DeclareMatch(e, entry->ast, TableEntry);
- code = Texts(
- code, ",\n\t{", compile_to_type(key_scope, e->key, key_t), ", ",
- compile_to_type(value_scope, e->value ? e->value : WrapAST(entry->ast, Var, .name = "EMPTY"), value_t),
- "}");
+ code = Texts(code, ",\n\t{", compile_to_type(key_scope, e->key, key_t), ", ",
+ compile_to_type(value_scope, e->value ? e->value : WrapAST(entry->ast, Var, .name = "PRESENT"),
+ value_t),
+ "}");
}
return Texts(code, ")");
}