aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorRose Hogenson <rhogenson@posteo.net>2022-09-02 17:07:29 -0700
committerRose Hogenson <rhogenson@posteo.net>2022-09-02 17:07:29 -0700
commit19ff46c53e800132f8d800b909b10f28f53b13e9 (patch)
tree26fd8afe91917bee95b7aaca7a0db32501b09cfe /lib
parent49138077de7c97913c7bcb16099738f6183b39bd (diff)
downloadchromatopelma-19ff46c53e800132f8d800b909b10f28f53b13e9.tar.zst
Undo the hacky list constant changes.
We will eventually implement list constants using some kind of rodata.
Diffstat (limited to 'lib')
-rw-r--r--lib/csc/macros-test.csc39
-rw-r--r--lib/csc/macros.csc6
2 files changed, 4 insertions, 41 deletions
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)))))))