aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRose Hogenson <rhogenson@posteo.net>2022-08-09 21:50:36 -0700
committerRose Hogenson <rhogenson@posteo.net>2022-08-09 21:50:36 -0700
commit13e380cadd4ceb2efbc9e7256ca4609f4ed04133 (patch)
treeac7c5d3ef9254f59fc24f49178151d4553270d2b /lib
parentFix the bugs in the number library. (diff)
downloadchromatopelma-13e380cadd4ceb2efbc9e7256ca4609f4ed04133.tar.zst
Fix a few small bugs.
N lines of code will have about 2N bugs.
Diffstat (limited to 'lib')
-rw-r--r--lib/csc/compiler.csc4
-rw-r--r--lib/csc/macros.csc2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/csc/compiler.csc b/lib/csc/compiler.csc
index d18c373..e2e682e 100644
--- a/lib/csc/compiler.csc
+++ b/lib/csc/compiler.csc
@@ -131,7 +131,6 @@
(define (ir1->bytecode expr)
- (printf "ir1 =\n{}\n" expr)
(define c (closure-convert (ir1->ir2 expr (lambda (x) *tail*))))
(printf "ir2 =\n{}\n" c)
(define b (ir2->ir3 c))
@@ -198,8 +197,9 @@
(match program
((('import . imports1) ('import . imports2) . rest)
- (compile (cons (list 'import (append imports1 imports2)) rest)))
+ (compile (cons (cons 'import (append imports1 imports2)) rest)))
((('import . imports) . body)
+ (printf "imports {}\n" imports)
(define compiled-body (ir1->bytecode (expand-body 'main body (make-import-map imports))))
(encode (link (revappend library-code (list compiled-body (list (list 'exit (list 'const 0))))))))
(_ (error "unexpected form in compile" program))))))
diff --git a/lib/csc/macros.csc b/lib/csc/macros.csc
index 739f532..fc8aa79 100644
--- a/lib/csc/macros.csc
+++ b/lib/csc/macros.csc
@@ -651,7 +651,7 @@
(let* ((transformer (expand-syntax-object transformer-form))
(body (expand-syntax-object (with-binding ident transformer body-form))))
body))
- (_ (raise-syntax-error "unexpected form in let-syntax"))))))
+ (_ (raise-syntax-error "unexpected form in let-syntax" x))))))
(define (split-args-rest formals)