about summary refs log tree commit diff
path: root/boot/ir.c
diff options
context:
space:
mode:
authorMel <mel@rnrd.eu>2026-05-26 04:31:41 +0200
committerMel <mel@rnrd.eu>2026-05-26 04:31:41 +0200
commita34b399c3a7df49baf4c9ce6a581de5b22fe342b (patch)
tree3ccca31ba2c8e3a40ff0ab0f94d910189f4bbe5d /boot/ir.c
parentbf82cbd2a7d4e234313e253cb6f7dd351b2c5c5a (diff)
downloadcatskill-a34b399c3a7df49baf4c9ce6a581de5b22fe342b.tar.zst
catskill-a34b399c3a7df49baf4c9ce6a581de5b22fe342b.zip
Support multi-level closure captures
Signed-off-by: Mel <mel@rnrd.eu>
Diffstat (limited to 'boot/ir.c')
-rw-r--r--boot/ir.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/boot/ir.c b/boot/ir.c
index f86d63f..af631f8 100644
--- a/boot/ir.c
+++ b/boot/ir.c
@@ -468,6 +468,9 @@ struct Function
     // synthetic structure containing all captured locals. (only stateful lambdas)
     Type_Id capture_state_type_id;
 
+    // for nested functions this is the enclosing function. nil for top-level.
+    struct Function* parent_function;
+
     // tree-side header which produced this function node.
     // required for synthesizing the closure type after function is lowered.
     struct Tree_Function_Header* ast_header;