From 841c8114a3defdef74042e0f92930debe9ff93fc Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Sun, 8 Dec 2024 13:45:01 -0500 Subject: Fix for set binop operations --- compile.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/compile.c b/compile.c index 7c4913d5..2f7b1b65 100644 --- a/compile.c +++ b/compile.c @@ -1852,25 +1852,19 @@ CORD compile_math_method(env_t *env, binop_e op, ast_t *lhs, ast_t *rhs, type_t } case BINOP_OR: case BINOP_CONCAT: { if (lhs_t->tag == SetType) { - arg_t *arg_spec = new(arg_t, .type=lhs_t, .next=new(arg_t, .type=lhs_t)); - return CORD_all("Table$with(", compile_arguments(env, lhs, arg_spec, args), - ", ", compile_type_info(env, lhs_t), ")"); + return CORD_all("Table$with(", compile(env, lhs), ", ", compile(env, rhs), ", ", compile_type_info(env, lhs_t), ")"); } goto fallthrough; } case BINOP_AND: { if (lhs_t->tag == SetType) { - arg_t *arg_spec = new(arg_t, .type=lhs_t, .next=new(arg_t, .type=lhs_t)); - return CORD_all("Table$overlap(", compile_arguments(env, lhs, arg_spec, args), - ", ", compile_type_info(env, lhs_t), ")"); + return CORD_all("Table$overlap(", compile(env, lhs), ", ", compile(env, rhs), ", ", compile_type_info(env, lhs_t), ")"); } goto fallthrough; } case BINOP_MINUS: { if (lhs_t->tag == SetType) { - arg_t *arg_spec = new(arg_t, .type=lhs_t, .next=new(arg_t, .type=lhs_t)); - return CORD_all("Table$without(", compile_arguments(env, lhs, arg_spec, args), - ", ", compile_type_info(env, lhs_t), ")"); + return CORD_all("Table$without(", compile(env, lhs), ", ", compile(env, rhs), ", ", compile_type_info(env, lhs_t), ")"); } goto fallthrough; } -- cgit v1.2.3