diff options
| author | Rose Hogenson <rhogenson@posteo.net> | 2022-06-25 19:32:04 -0700 |
|---|---|---|
| committer | Rose Hogenson <rhogenson@posteo.net> | 2022-06-25 19:32:04 -0700 |
| commit | 05463502db73ab9a5ac23e1f598e838fbe14b3f8 (patch) | |
| tree | b7ae8cb2f7da272db8c0006dd5e0d5400a702743 /csc/cps-test.csc | |
| parent | Continue work on continuation passing style. (diff) | |
| download | chromatopelma-05463502db73ab9a5ac23e1f598e838fbe14b3f8.tar.zst | |
More CPS.
Diffstat (limited to 'csc/cps-test.csc')
| -rw-r--r-- | csc/cps-test.csc | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/csc/cps-test.csc b/csc/cps-test.csc index 5bd6c1a..0aead27 100644 --- a/csc/cps-test.csc +++ b/csc/cps-test.csc @@ -3,12 +3,15 @@ map->alist) (only (csc ir1) make-constant + make-define-syntax + make-if make-lexical-ref make-lexical-set make-library-ref) (only (csc ir2) ir2=? make-atom + make-branch make-kargs make-ktail make-update) @@ -73,3 +76,26 @@ (make-update (make-lexical-ref 'var #f) (make-lexical-ref 'generated-symbol #f) 1)))) (soup->alist (ir1->ir2 (make-lexical-set (make-lexical-ref 'var #f) (make-constant 5)))))) + + +(test no-op-define-syntax + (assert-equal soup=? + (list + (cons 0 (make-kargs '() (make-atom (make-constant #f) 1))) + (cons 1 (make-ktail))) + (soup->alist (ir1->ir2 (make-define-syntax 'name '(transformer)))))) + + +(test branch + (assert-equal soup=? + (list + (cons 0 (make-kargs '() (make-atom (make-constant #t) 2))) + (cons 1 (make-ktail)) + (cons 2 (make-kargs (list (make-lexical-ref 'generated-symbol #f)) + (make-branch (make-lexical-ref 'generated-symbol #f) + 3 4))) + (cons 3 (make-kargs '() (make-atom (make-constant 1) 1))) + (cons 4 (make-kargs '() (make-atom (make-constant 2) 1)))) + (soup->alist (ir1->ir2 (make-if (make-constant #t) + (make-constant 1) + (make-constant 2)))))) |
