From 298a8f30698c109890d050019f2ff9cbbf693ce9 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Sat, 8 Dec 2018 00:23:06 -0800 Subject: [PATCH] Update test-syntax-rename to work with syntax changes. --- tests/runtime/test-syntax-rename.scm | 34 ++++++++++++++++------------ 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/tests/runtime/test-syntax-rename.scm b/tests/runtime/test-syntax-rename.scm index 16ce2f2a0..085101da2 100644 --- a/tests/runtime/test-syntax-rename.scm +++ b/tests/runtime/test-syntax-rename.scm @@ -31,20 +31,26 @@ USA. (define test-environment (the-environment)) +(define genv + (runtime-environment->syntactic test-environment)) + +(define (grename form) + (close-syntax form genv)) + (define-syntax outer - (sc-macro-transformer - (lambda (form use-env) + (er-macro-transformer + (lambda (form rename compare) + (declare (ignore compare)) (syntax-check '(_ identifier) form) - (let* ((raw (cadr form)) - (closed (close-syntax raw use-env))) - `(define-syntax ,(close-syntax 'inner use-env) - (sc-macro-transformer - (lambda (form use-env) - (syntax-check '(_) form) - `(,(quote-identifier ,raw) - ,(quote ,raw) - ,(quote-identifier ,closed) - ,(quote ,closed))))))))) + (let ((id (cadr form))) + `(,(rename 'define-syntax) inner + (,(rename 'sc-macro-transformer) + (,(rename 'lambda) (form use-env) + (,(rename 'list) + 'list + (,(rename 'grename) (,(rename 'quote) ,id)) + (,(rename 'grename) (,(rename 'quote-identifier) ,id)) + )))))))) ;; A fairly complicated test that shows how quote-identifier works, ;; how it's different from quote, and that weird binding combinations @@ -55,8 +61,8 @@ USA. '(let ((car 13)) (outer car) (let ((car 15)) - (car (inner)))))) + (cons car (inner)))))) (assert-equal (unsyntax (syntax expr test-environment)) '(let ((.car.1 13)) (let ((.car.2 15)) - (.car.2 (car car .car.1 car)))))))) \ No newline at end of file + (cons .car.2 (list car .car.1)))))))) \ No newline at end of file -- 2.25.1