diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2024-12-08 13:45:01 -0500 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2024-12-08 13:45:01 -0500 |
| commit | 841c8114a3defdef74042e0f92930debe9ff93fc (patch) | |
| tree | 84cf39c4bc2669554af7ead77c1ebe075c0e9c2f /compile.c | |
| parent | 37f3e91f6c95d46f161dbde05b0a005fe7e7c17a (diff) | |
Fix for set binop operations
Diffstat (limited to 'compile.c')
| -rw-r--r-- | compile.c | 12 |
1 files changed, 3 insertions, 9 deletions
@@ -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; } |
