fixes for some tests

The `identifier-binding` function is now senstive to the "macro
introduction" scope that's on an indentifier provided to a currently
expanding macro. Unit tests for TR need to use
`syntax-local-intorduce` to remove it, in the same way that `tc-setup`
already does.

Also, recognize a class expansion when it's wrapped with
`#%expression`, since `class` now expands that way sometimes.
This commit is contained in:
Matthew Flatt 2015-05-19 19:56:43 -06:00
parent 8c006da763
commit 1842aaa2bd
2 changed files with 13 additions and 3 deletions

View File

@ -153,8 +153,8 @@
(let-values ([(field-name:id) accessor-or-mutator] ...)
:make-methods-body))))
(define-syntax-class class-expansion
#:literals (#%plain-app quote)
(define-syntax-class core-class-expansion
#:literals (let-values letrec-syntaxes+values #%plain-app quote)
#:attributes (superclass-expr
make-methods
initializer-body
@ -170,6 +170,16 @@
(quote :boolean)
(quote #f))))
(define-syntax-class class-expansion
#:literals (#%expression)
#:attributes (superclass-expr
make-methods
initializer-body
initializer-self-id
initializer-args-id)
(pattern :core-class-expansion)
(pattern (#%expression :core-class-expansion)))
;; This is similar to `type-declaration` from "internal-forms.rkt", but
;; the expansion is slightly different in a class so we use this instead.
(define-syntax-class class-type-declaration

View File

@ -51,7 +51,7 @@
;; tr-expand: syntax? -> syntax?
;; Expands out a form and annotates it with necesarry TR machinery.
(define (tr-expand stx)
(define expanded-stx (local-expand stx 'expression '()))
(define expanded-stx (syntax-local-introduce (local-expand stx 'expression '())))
(find-mutated-vars expanded-stx mvar-env)
expanded-stx)