From 13e380cadd4ceb2efbc9e7256ca4609f4ed04133 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Tue, 9 Aug 2022 21:50:36 -0700 Subject: Fix a few small bugs. N lines of code will have about 2N bugs. --- lib/csc/compiler.csc | 4 ++-- lib/csc/macros.csc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') 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) -- cgit v1.3.1