aboutsummaryrefslogtreecommitdiffstats
path: root/lib/csc
diff options
context:
space:
mode:
Diffstat (limited to 'lib/csc')
-rw-r--r--lib/csc/cps.csc6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/csc/cps.csc b/lib/csc/cps.csc
index 4fed47c..65bca89 100644
--- a/lib/csc/cps.csc
+++ b/lib/csc/cps.csc
@@ -54,6 +54,7 @@
(only (csc ir2)
%apply
%branch
+ %closure
%fix
%primitive
%tail
@@ -69,7 +70,6 @@
make-closure
make-fix
make-label
- make-label
make-primitive
make-variable
tail?)
@@ -494,8 +494,10 @@
((% %apply . _) expr)
((% %tail) expr)
((% %fix funs body)
- (set! functions (append funs functions))
+ (set! functions (append (map hoist funs) functions))
(hoist body))
+ ((% %closure name args body)
+ (make-closure name args (hoist body)))
(_ (error "Unexpected form in hoist" expr)))))
(make-fix functions body))