diff options
Diffstat (limited to 'lib/csc/macros-test.csc')
| -rw-r--r-- | lib/csc/macros-test.csc | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/csc/macros-test.csc b/lib/csc/macros-test.csc index cce95ac..9c4aced 100644 --- a/lib/csc/macros-test.csc +++ b/lib/csc/macros-test.csc @@ -255,6 +255,25 @@ transform-ir1)) + (test builtin-syntax-rules-recursive + (assert-equal + (make-call-builtin 'add + (list (make-constant 1) + (make-call-builtin 'add + (list (make-constant 1) + (make-call-builtin 'add (list (make-constant 1) (make-constant 0))))))) + (expand-body 'main + '((let-syntax + ((macro-len + (syntax-rules () + ((macro-len ()) 0) + ((macro-len (_ tail ...)) + (call-builtin add 1 (macro-len (tail ...))))))) + (macro-len (a b c)))) + builtins-environment) + transform-ir1)) + + (define (test-ref sym) (make-lexical-ref sym (gensym))) |
