aboutsummaryrefslogtreecommitdiff
path: root/src/compile/functions.c
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-09-21 15:43:59 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-09-21 15:43:59 -0400
commit71f73d8b3ce63f9a3685bc1a1686ef4fab3294a6 (patch)
tree99fe1309fa4d24609867dcc62859caed909a76d9 /src/compile/functions.c
parentf5612e38183dc20d18f207f8ab055574a4d93ad0 (diff)
Deprecate sets
Diffstat (limited to 'src/compile/functions.c')
-rw-r--r--src/compile/functions.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/src/compile/functions.c b/src/compile/functions.c
index d113316b..e2fa8a11 100644
--- a/src/compile/functions.c
+++ b/src/compile/functions.c
@@ -302,8 +302,7 @@ Text_t compile_lambda(env_t *env, ast_t *ast) {
assert(b);
Text_t binding_code = b->code;
if (entry->b->type->tag == ListType) userdata = Texts(userdata, ", LIST_COPY(", binding_code, ")");
- else if (entry->b->type->tag == TableType || entry->b->type->tag == SetType)
- userdata = Texts(userdata, ", TABLE_COPY(", binding_code, ")");
+ else if (entry->b->type->tag == TableType) userdata = Texts(userdata, ", TABLE_COPY(", binding_code, ")");
else userdata = Texts(userdata, ", ", binding_code);
}
userdata = Texts(userdata, ")");
@@ -388,11 +387,6 @@ static void add_closed_vars(Table_t *closed_vars, env_t *enclosing_scope, env_t
add_closed_vars(closed_vars, enclosing_scope, env, item->ast);
break;
}
- case Set: {
- for (ast_list_t *item = Match(ast, Set)->items; item; item = item->next)
- add_closed_vars(closed_vars, enclosing_scope, env, item->ast);
- break;
- }
case Table: {
add_closed_vars(closed_vars, enclosing_scope, env, Match(ast, Table)->default_value);
add_closed_vars(closed_vars, enclosing_scope, env, Match(ast, Table)->fallback);
@@ -413,7 +407,7 @@ static void add_closed_vars(Table_t *closed_vars, env_t *enclosing_scope, env_t
return add_closed_vars(closed_vars, enclosing_scope, env, loop);
}
- // List/Set/Table comprehension:
+ // List/Table comprehension:
ast_t *body = comp->expr;
if (comp->filter) body = WrapAST(comp->expr, If, .condition = comp->filter, .body = body);
ast_t *loop = WrapAST(ast, For, .vars = comp->vars, .iter = comp->iter, .body = body);
@@ -839,7 +833,6 @@ Text_t compile_method_call(env_t *env, ast_t *ast) {
switch (self_value_t->tag) {
case ListType: return compile_list_method_call(env, ast);
- case SetType: return compile_set_method_call(env, ast);
case TableType: return compile_table_method_call(env, ast);
default: {
DeclareMatch(methodcall, ast, MethodCall);