From 19ff46c53e800132f8d800b909b10f28f53b13e9 Mon Sep 17 00:00:00 2001 From: Rose Hogenson Date: Fri, 2 Sep 2022 17:07:29 -0700 Subject: Undo the hacky list constant changes. We will eventually implement list constants using some kind of rodata. --- lib/csc/macros-test.csc | 39 +++------------------------------------ lib/csc/macros.csc | 6 +----- 2 files changed, 4 insertions(+), 41 deletions(-) (limited to 'lib/csc') diff --git a/lib/csc/macros-test.csc b/lib/csc/macros-test.csc index 2af86b7..cce95ac 100644 --- a/lib/csc/macros-test.csc +++ b/lib/csc/macros-test.csc @@ -68,19 +68,7 @@ (test builtin-quote (assert-equal - (make-call-builtin 'cons - (list - (make-constant 'test) - (make-call-builtin 'cons - (list - (make-constant 1) - (make-call-builtin 'cons - (list - (make-constant 2) - (make-call-builtin 'cons - (list - (make-constant 3) - (make-constant '()))))))))) + (make-constant '(test 1 2 3)) (expand-body 'main '((quote (test 1 2 3))) builtins-environment) @@ -212,13 +200,7 @@ (test builtin-syntax-rules-ellipsis-zip (assert-equal - (make-call-builtin 'cons - (list - (make-call-builtin 'cons (list (make-constant 1) (make-constant 3))) - (make-call-builtin 'cons - (list - (make-call-builtin 'cons (list (make-constant 2) (make-constant 4))) - (make-constant '()))))) + (make-constant '((1 . 3) (2 . 4))) (expand-body 'main '((let-syntax ((zip @@ -232,22 +214,7 @@ (test builtin-syntax-rules-ellipsis-nested (assert-equal - (make-call-builtin 'cons - (list - (make-constant 1) - (make-call-builtin 'cons - (list - (make-constant 2) - (make-call-builtin 'cons - (list - (make-constant 3) - (make-call-builtin 'cons - (list - (make-constant 4) - (make-call-builtin 'cons - (list - (make-constant 5) - (make-constant '()))))))))))) + (make-constant '(1 2 3 4 5)) (expand-body 'main '((let-syntax ((append diff --git a/lib/csc/macros.csc b/lib/csc/macros.csc index f0b4d67..398f07b 100644 --- a/lib/csc/macros.csc +++ b/lib/csc/macros.csc @@ -362,11 +362,7 @@ (make-macro-transformer (lambda (syntax env) (syntax-case syntax - ((_ datum) - (let quote-expr ((datum datum)) - (syntax-case datum - ((head . tail) (make-call-builtin 'cons (list (quote-expr head) (quote-expr tail)))) - (_ (make-constant (clean-syntax datum)))))) + ((_ datum) (make-constant (clean-syntax datum))) (_ (raise-syntax-error "invalid form for quote" (clean-syntax syntax))))))) -- cgit v1.3.1