aboutsummaryrefslogtreecommitdiff
path: root/boot/visit
diff options
context:
space:
mode:
authorMel <mel@rnrd.eu>2026-05-24 20:01:38 +0200
committerMel <mel@rnrd.eu>2026-05-24 20:01:38 +0200
commitf028bc7ef3101facfa004c21f3aa5feb3dc6f107 (patch)
tree3458a0ec69c9552354cb7d3dde38d8f6edd0ad14 /boot/visit
parent99d57398863ab1734a9f81c2d336f82dab556383 (diff)
downloadcatskill-f028bc7ef3101facfa004c21f3aa5feb3dc6f107.tar.zst
catskill-f028bc7ef3101facfa004c21f3aa5feb3dc6f107.zip
Support named-unnamed call and construction arguments and fields with final resolved order
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'boot/visit')
-rw-r--r--boot/visit/ir.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/boot/visit/ir.c b/boot/visit/ir.c
index 5317276..6748384 100644
--- a/boot/visit/ir.c
+++ b/boot/visit/ir.c
@@ -321,8 +321,8 @@ void
walk_expression_call(struct Visit* visit, struct Expression* expr)
{
VISIT(visit_expression, expr->value.call.subject);
- FOR_EACH_ARRAY (struct Expression*, argument, &expr->value.call.arguments)
- VISIT(visit_expression, *argument);
+ FOR_EACH_ARRAY (struct Call_Argument, argument, &expr->value.call.arguments)
+ VISIT(visit_expression, argument->value);
}
void
@@ -859,9 +859,10 @@ printer_visit_expression_call(struct Visit* visit, struct Expression* expr)
PRINTER_PREAMBLE
PRINT("(call ");
VISIT(visit_expression, expr->value.call.subject);
- FOR_EACH_ARRAY (struct Expression*, argument, &expr->value.call.arguments) {
- PRINT(" ");
- VISIT(visit_expression, *argument);
+ FOR_EACH_ARRAY (struct Call_Argument, argument, &expr->value.call.arguments) {
+ PRINT(" (slot %lu ", argument->slot);
+ VISIT(visit_expression, argument->value);
+ PRINT(")");
}
PRINT(")");
}
@@ -996,6 +997,18 @@ printer_visit_lower_error(struct Visit* visit, struct Lower_Error* error)
case LOWER_ERROR_UNKNOWN_COMPOUND_ASSIGN:
PRINT("(unknown-compound-assign)");
return;
+ case LOWER_ERROR_UNKNOWN_NAMED_ARGUMENT:
+ PRINT("(unknown-named-argument %s)", string_c_str(error->name));
+ return;
+ case LOWER_ERROR_DUPLICATE_ARGUMENT:
+ PRINT("(duplicate-argument %s)", string_c_str(error->name));
+ return;
+ case LOWER_ERROR_TOO_MANY_ARGUMENTS:
+ PRINT("(too-many-arguments)");
+ return;
+ case LOWER_ERROR_NAMED_ARGUMENT_ON_UNKNOWN_CALLEE:
+ PRINT("(named-argument-on-unknown-callee)");
+ return;
case LOWER_ERROR_UNIMPLEMENTED:
PRINT("(unimplemented \"%s\")", string_c_str(error->detail));
return;