diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2025-09-21 15:43:59 -0400 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2025-09-21 15:43:59 -0400 |
| commit | 71f73d8b3ce63f9a3685bc1a1686ef4fab3294a6 (patch) | |
| tree | 99fe1309fa4d24609867dcc62859caed909a76d9 /src/compile/expressions.c | |
| parent | f5612e38183dc20d18f207f8ab055574a4d93ad0 (diff) | |
Deprecate sets
Diffstat (limited to 'src/compile/expressions.c')
| -rw-r--r-- | src/compile/expressions.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/compile/expressions.c b/src/compile/expressions.c index 16b94d73..c511bea1 100644 --- a/src/compile/expressions.c +++ b/src/compile/expressions.c @@ -13,8 +13,7 @@ public Text_t compile_maybe_incref(env_t *env, ast_t *ast, type_t *t) { if (is_idempotent(ast) && can_be_mutated(env, ast)) { if (t->tag == ListType) return Texts("LIST_COPY(", compile_to_type(env, ast, t), ")"); - else if (t->tag == TableType || t->tag == SetType) - return Texts("TABLE_COPY(", compile_to_type(env, ast, t), ")"); + else if (t->tag == TableType) return Texts("TABLE_COPY(", compile_to_type(env, ast, t), ")"); } return compile_to_type(env, ast, t); } @@ -44,7 +43,6 @@ Text_t compile_empty(type_t *t) { case BoolType: return Text("((Bool_t)no)"); case ListType: return Text("((List_t){})"); case TableType: - case SetType: return Text("((Table_t){})"); case TextType: return Text("Text(\"\")"); case CStringType: return Text("\"\""); case PointerType: { @@ -93,8 +91,7 @@ Text_t compile(env_t *env, ast_t *ast) { if (t->tag == BoolType) return Texts("!(", compile(env, value), ")"); else if (t->tag == IntType || t->tag == ByteType) return Texts("~(", compile(env, value), ")"); else if (t->tag == ListType) return Texts("((", compile(env, value), ").length == 0)"); - else if (t->tag == SetType || t->tag == TableType) - return Texts("((", compile(env, value), ").entries.length == 0)"); + else if (t->tag == TableType) return Texts("((", compile(env, value), ").entries.length == 0)"); else if (t->tag == TextType) return Texts("(", compile(env, value), ".length == 0)"); else if (t->tag == OptionalType) return check_none(t, compile(env, value)); @@ -197,13 +194,6 @@ Text_t compile(env_t *env, ast_t *ast) { type_t *table_type = get_type(env, ast); return compile_typed_table(env, ast, table_type); } - case Set: { - DeclareMatch(set, ast, Set); - if (!set->items) return Text("((Table_t){})"); - - type_t *set_type = get_type(env, ast); - return compile_typed_set(env, ast, set_type); - } case Comprehension: { ast_t *base = Match(ast, Comprehension)->expr; while (base->tag == Comprehension) |
