From 71f73d8b3ce63f9a3685bc1a1686ef4fab3294a6 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 21 Sep 2025 15:43:59 -0400 Subject: Deprecate sets --- src/compile/binops.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/compile/binops.c') diff --git a/src/compile/binops.c b/src/compile/binops.c index 9710019b..0bff98c0 100644 --- a/src/compile/binops.c +++ b/src/compile/binops.c @@ -160,8 +160,8 @@ Text_t compile_binary_op(env_t *env, ast_t *ast) { return Texts("(", lhs, " + ", rhs, ")"); } case Minus: { - if (overall_t->tag == SetType) - return Texts("Table$without(", lhs, ", ", rhs, ", ", compile_type_info(overall_t), ")"); + if (overall_t->tag == TableType) + return Texts("Table$minus(", lhs, ", ", rhs, ", ", compile_type_info(overall_t), ")"); if (overall_t->tag != IntType && overall_t->tag != NumType && overall_t->tag != ByteType) code_err(ast, "Math operations are only supported for values of the same " @@ -204,8 +204,8 @@ Text_t compile_binary_op(env_t *env, ast_t *ast) { case And: { if (overall_t->tag == BoolType) return Texts("(", lhs, " && ", rhs, ")"); else if (overall_t->tag == IntType || overall_t->tag == ByteType) return Texts("(", lhs, " & ", rhs, ")"); - else if (overall_t->tag == SetType) - return Texts("Table$overlap(", lhs, ", ", rhs, ", ", compile_type_info(overall_t), ")"); + else if (overall_t->tag == TableType) + return Texts("Table$and(", lhs, ", ", rhs, ", ", compile_type_info(overall_t), ")"); else code_err(ast, "The 'and' operator isn't supported between ", type_to_text(lhs_t), " and ", type_to_text(rhs_t), " values"); @@ -218,18 +218,18 @@ Text_t compile_binary_op(env_t *env, ast_t *ast) { return Texts("(", lhs, " || ", rhs, ")"); } else if (overall_t->tag == IntType || overall_t->tag == ByteType) { return Texts("(", lhs, " | ", rhs, ")"); - } else if (overall_t->tag == SetType) { - return Texts("Table$with(", lhs, ", ", rhs, ", ", compile_type_info(overall_t), ")"); + } else if (overall_t->tag == TableType) { + return Texts("Table$or(", lhs, ", ", rhs, ", ", compile_type_info(overall_t), ")"); } else { - code_err(ast, "The 'or' operator isn't supported between ", type_to_text(lhs_t), " and ", type_to_text(rhs_t), - " values"); + code_err(ast, "The 'or' operator isn't supported between ", type_to_text(lhs_t), " and ", + type_to_text(rhs_t), " values"); } } case Xor: { // TODO: support optional values in `xor` expressions if (overall_t->tag == BoolType || overall_t->tag == IntType || overall_t->tag == ByteType) return Texts("(", lhs, " ^ ", rhs, ")"); - else if (overall_t->tag == SetType) + else if (overall_t->tag == TableType) return Texts("Table$xor(", lhs, ", ", rhs, ", ", compile_type_info(overall_t), ")"); else code_err(ast, "The 'xor' operator isn't supported between ", type_to_text(lhs_t), " and ", -- cgit v1.2.3