macro stepper:
better module hiding display prefab structs updated tests svn: r14085
This commit is contained in:
parent
533c8dfd8b
commit
e11a24fda8
|
@ -3,7 +3,6 @@
|
||||||
(require scheme/match
|
(require scheme/match
|
||||||
"stx-util.ss"
|
"stx-util.ss"
|
||||||
"deriv-util.ss"
|
"deriv-util.ss"
|
||||||
"context.ss"
|
|
||||||
"deriv.ss"
|
"deriv.ss"
|
||||||
"reductions-engine.ss")
|
"reductions-engine.ss")
|
||||||
|
|
||||||
|
@ -61,7 +60,7 @@
|
||||||
[#:when (not (bound-identifier=? e1 e2))
|
[#:when (not (bound-identifier=? e1 e2))
|
||||||
[#:walk e2 'resolve-variable]])]
|
[#:walk e2 'resolve-variable]])]
|
||||||
[(Wrap p:module (e1 e2 rs ?1 ?2 tag rename check tag2 ?3 body shift))
|
[(Wrap p:module (e1 e2 rs ?1 ?2 tag rename check tag2 ?3 body shift))
|
||||||
(R ;; [#:hide-check rs] ;; FIXME: test and enable!!!
|
(R [#:hide-check rs]
|
||||||
[! ?1]
|
[! ?1]
|
||||||
[#:pattern (?module ?name ?language . ?body-parts)]
|
[#:pattern (?module ?name ?language . ?body-parts)]
|
||||||
[! ?2]
|
[! ?2]
|
||||||
|
|
|
@ -89,6 +89,13 @@
|
||||||
lp-datum)]
|
lp-datum)]
|
||||||
[(pair? obj)
|
[(pair? obj)
|
||||||
(pairloop obj)]
|
(pairloop obj)]
|
||||||
|
[(struct? obj)
|
||||||
|
;; Only traverse prefab structs
|
||||||
|
(let ([pkey (prefab-struct-key obj)])
|
||||||
|
(if pkey
|
||||||
|
(let-values ([(refold fields) (unfold-pstruct obj)])
|
||||||
|
(refold (map loop fields)))
|
||||||
|
obj))]
|
||||||
[(symbol? obj)
|
[(symbol? obj)
|
||||||
(unintern obj)]
|
(unintern obj)]
|
||||||
[(null? obj)
|
[(null? obj)
|
||||||
|
@ -117,6 +124,14 @@
|
||||||
flat=>stx
|
flat=>stx
|
||||||
stx=>flat))))
|
stx=>flat))))
|
||||||
|
|
||||||
|
;; unfold-pstruct : prefab-struct -> (values (list -> prefab-struct) list)
|
||||||
|
(define (unfold-pstruct obj)
|
||||||
|
(define key (prefab-struct-key obj))
|
||||||
|
(define fields (cdr (vector->list (struct->vector obj))))
|
||||||
|
(values (lambda (new-fields)
|
||||||
|
(apply make-prefab-struct key new-fields))
|
||||||
|
fields))
|
||||||
|
|
||||||
;; check+convert-special-expression : syntax -> #f/syntaxish
|
;; check+convert-special-expression : syntax -> #f/syntaxish
|
||||||
(define (check+convert-special-expression stx)
|
(define (check+convert-special-expression stx)
|
||||||
(define stx-list (stx->list stx))
|
(define stx-list (stx->list stx))
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
;; Printing parameters (mzscheme manual 7.9.1.4)
|
;; Printing parameters (mzscheme manual 7.9.1.4)
|
||||||
[print-unreadable #t]
|
[print-unreadable #t]
|
||||||
[print-graph #f]
|
[print-graph #f]
|
||||||
[print-struct #f]
|
[print-struct #t]
|
||||||
[print-box #t]
|
[print-box #t]
|
||||||
[print-vector-length #t]
|
[print-vector-length #t]
|
||||||
[print-hash-table #f]
|
[print-hash-table #f]
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
[expect-ok? (cdr key+expect-ok?)])
|
[expect-ok? (cdr key+expect-ok?)])
|
||||||
(check-hide d hide-none-policy expect-ok?)
|
(check-hide d hide-none-policy expect-ok?)
|
||||||
(check-hide d hide-all-policy expect-ok?)
|
(check-hide d hide-all-policy expect-ok?)
|
||||||
(check-hide d simple-policy expect-ok?))))]
|
(check-hide d T-policy expect-ok?))))]
|
||||||
[else #f]))
|
[else #f]))
|
||||||
|
|
||||||
(define (check-hide d policy expect-ok?)
|
(define (check-hide d policy expect-ok?)
|
||||||
|
@ -86,14 +86,14 @@
|
||||||
(error 'checker-for-hidden-steps "no steps given for ~s" label))
|
(error 'checker-for-hidden-steps "no steps given for ~s" label))
|
||||||
(test-case label
|
(test-case label
|
||||||
(let* ([d (trace/ns form (assq '#:kernel attrs))]
|
(let* ([d (trace/ns form (assq '#:kernel attrs))]
|
||||||
[rs (parameterize ((macro-policy simple-policy))
|
[rs (parameterize ((macro-policy T-policy))
|
||||||
(reductions d))])
|
(reductions d))])
|
||||||
(check-steps (cdr (assq '#:steps attrs)) rs)))]
|
(check-steps (cdr (assq '#:steps attrs)) rs)))]
|
||||||
[(assq '#:hidden-steps attrs)
|
[(assq '#:hidden-steps attrs)
|
||||||
=> (lambda (key+expected)
|
=> (lambda (key+expected)
|
||||||
(test-case label
|
(test-case label
|
||||||
(let* ([d (trace/ns form (assq '#:kernel attrs))]
|
(let* ([d (trace/ns form (assq '#:kernel attrs))]
|
||||||
[rs (parameterize ((macro-policy simple-policy))
|
[rs (parameterize ((macro-policy T-policy))
|
||||||
(reductions d))])
|
(reductions d))])
|
||||||
(check-steps (cdr (assq '#:hidden-steps attrs)) rs))))]
|
(check-steps (cdr (assq '#:hidden-steps attrs)) rs))))]
|
||||||
[else #f]))
|
[else #f]))
|
||||||
|
|
|
@ -8,12 +8,15 @@
|
||||||
trace/k
|
trace/k
|
||||||
hide-all-policy
|
hide-all-policy
|
||||||
hide-none-policy
|
hide-none-policy
|
||||||
simple-policy
|
|
||||||
|
T-policy
|
||||||
|
Tm-policy
|
||||||
|
|
||||||
stx/hide-none
|
stx/hide-none
|
||||||
stx/hide-all
|
stx/hide-all
|
||||||
stx/hide-standard
|
stx/hide-standard
|
||||||
stx/hide-simple)
|
stx/hide-T
|
||||||
|
stx/hide-Tm)
|
||||||
|
|
||||||
(define (trace/t expr)
|
(define (trace/t expr)
|
||||||
(trace/ns expr #f))
|
(trace/ns expr #f))
|
||||||
|
@ -133,22 +136,25 @@
|
||||||
(stx/hide-policy d hide-none-policy))
|
(stx/hide-policy d hide-none-policy))
|
||||||
(define (stx/hide-all d)
|
(define (stx/hide-all d)
|
||||||
(stx/hide-policy d hide-all-policy))
|
(stx/hide-policy d hide-all-policy))
|
||||||
(define (stx/hide-simple d)
|
|
||||||
(stx/hide-policy d simple-policy))
|
|
||||||
(define (stx/hide-standard d)
|
(define (stx/hide-standard d)
|
||||||
(stx/hide-policy d standard-policy))
|
(stx/hide-policy d standard-policy))
|
||||||
#|
|
|
||||||
(define (hide/standard d) (hide/policy d standard-policy))
|
|
||||||
(define (hide/all d) (hide/policy d hide-all-policy))
|
|
||||||
(define (hide/null d) (hide/policy d hide-none-policy))
|
|
||||||
(define (hide/except d syms)
|
|
||||||
(hide/policy d (lambda (id) (memq (syntax-e id) syms))))
|
|
||||||
(define (hide/simple d) (hide/policy d simple-policy))
|
|
||||||
|#
|
|
||||||
|
|
||||||
;; Simple hiding policy
|
(define (stx/hide-T d)
|
||||||
;; ALL MACROS & primitive tags are hidden
|
(stx/hide-policy d T-policy))
|
||||||
;; EXCEPT Tlist and Tlet (and #%module-begin)
|
(define (stx/hide-Tm d)
|
||||||
(define (simple-policy id)
|
(stx/hide-policy d Tm-policy))
|
||||||
|
|
||||||
|
;; T hiding policy
|
||||||
|
;; ALL macros & primitives are hidden
|
||||||
|
;; EXCEPT those starting with T (Tlist and Tlet)
|
||||||
|
(define (T-policy id)
|
||||||
(or (memq (syntax-e id) '())
|
(or (memq (syntax-e id) '())
|
||||||
(regexp-match #rx"^T" (symbol->string (syntax-e id)))))
|
(regexp-match #rx"^T" (symbol->string (syntax-e id)))))
|
||||||
|
|
||||||
|
;; Tm hiding policy
|
||||||
|
;; ALL MACROS & primitive tags are hidden
|
||||||
|
;; EXCEPT those starting with T (Tlist and Tlet)
|
||||||
|
;; EXCEPT module (=> #%module-begin gets tagged)
|
||||||
|
(define (Tm-policy id)
|
||||||
|
(or (memq (syntax-e id) '(module))
|
||||||
|
(regexp-match #rx"^T" (symbol->string (syntax-e id)))))
|
||||||
|
|
|
@ -1,7 +1,6 @@
|
||||||
|
|
||||||
#lang scheme/base
|
#lang scheme/base
|
||||||
(require (planet "test.ss" ("schematics" "schemeunit.plt" 2 8))
|
(require (planet "test.ss" ("schematics" "schemeunit.plt" 2 8))
|
||||||
(planet "graphical-ui.ss" ("schematics" "schemeunit.plt" 2 8))
|
|
||||||
macro-debugger/model/debug
|
macro-debugger/model/debug
|
||||||
"../test-setup.ss")
|
"../test-setup.ss")
|
||||||
(provide specialized-hiding-tests)
|
(provide specialized-hiding-tests)
|
||||||
|
@ -27,16 +26,19 @@
|
||||||
[(tthi form)
|
[(tthi form)
|
||||||
(test-trivial-hiding form form)]))
|
(test-trivial-hiding form form)]))
|
||||||
|
|
||||||
(define-syntax test-simple-hiding
|
(define-syntax-rule (test-T-hiding form hidden-e2)
|
||||||
(syntax-rules ()
|
(test-hiding/policy form hidden-e2 T-policy))
|
||||||
[(tsh form hidden-e2)
|
(define-syntax-rule (test-T-hiding/id form)
|
||||||
(test-hiding/policy form hidden-e2 simple-policy)]))
|
(test-T-hiding form form))
|
||||||
(define-syntax test-simple-hiding/id
|
|
||||||
(syntax-rules ()
|
(define-syntax-rule (test-Tm-hiding form hidden-e2)
|
||||||
[(tshi form) (test-simple-hiding form form)]))
|
(test-hiding/policy form hidden-e2 Tm-policy))
|
||||||
|
(define-syntax-rule (test-Tm-hiding/id form)
|
||||||
|
(test-Tm-hiding form form))
|
||||||
|
|
||||||
(define specialized-hiding-tests
|
(define specialized-hiding-tests
|
||||||
(test-suite "Specialized macro hiding tests"
|
(test-suite "Specialized macro hiding tests"
|
||||||
|
|
||||||
(test-suite "Result tests for trivial hiding"
|
(test-suite "Result tests for trivial hiding"
|
||||||
(test-suite "Atomic expressions"
|
(test-suite "Atomic expressions"
|
||||||
(test-trivial-hiding/id *)
|
(test-trivial-hiding/id *)
|
||||||
|
@ -74,7 +76,7 @@
|
||||||
(lambda (x y) x y))
|
(lambda (x y) x y))
|
||||||
(test-trivial-hiding (lambda (x) (define-values (y) (id x)) y)
|
(test-trivial-hiding (lambda (x) (define-values (y) (id x)) y)
|
||||||
(lambda (x) (letrec-values ([(y) x]) y))))
|
(lambda (x) (letrec-values ([(y) x]) y))))
|
||||||
#;
|
#|
|
||||||
;; Old hiding mechanism never did letrec transformation (unless forced)
|
;; Old hiding mechanism never did letrec transformation (unless forced)
|
||||||
(test-suite "Block normalization"
|
(test-suite "Block normalization"
|
||||||
(test-trivial-hiding/id (lambda (x y) x y))
|
(test-trivial-hiding/id (lambda (x y) x y))
|
||||||
|
@ -88,94 +90,119 @@
|
||||||
(test-trivial-hiding (lambda (x) (id (begin (define-values (y) x) x)))
|
(test-trivial-hiding (lambda (x) (id (begin (define-values (y) x) x)))
|
||||||
(lambda (x) (begin (define-values (y) x) x)))
|
(lambda (x) (begin (define-values (y) x) x)))
|
||||||
(test-trivial-hiding (lambda (x) (define-values (y) (id x)) y)
|
(test-trivial-hiding (lambda (x) (define-values (y) (id x)) y)
|
||||||
(lambda (x) (define-values (y) x) y))))
|
(lambda (x) (define-values (y) x) y)))
|
||||||
(test-suite "Result tests for simple hiding"
|
|#
|
||||||
|
)
|
||||||
|
|
||||||
|
(test-suite "Result tests for T hiding"
|
||||||
(test-suite "Atomic expressions"
|
(test-suite "Atomic expressions"
|
||||||
(test-simple-hiding/id *)
|
(test-T-hiding/id *)
|
||||||
(test-simple-hiding/id 1)
|
(test-T-hiding/id 1)
|
||||||
(test-simple-hiding/id unbound-var))
|
(test-T-hiding/id unbound-var))
|
||||||
(test-suite "Basic expressions"
|
(test-suite "Basic expressions"
|
||||||
(test-simple-hiding/id (if 1 2 3))
|
(test-T-hiding/id (if 1 2 3))
|
||||||
(test-simple-hiding/id (with-continuation-mark 1 2 3))
|
(test-T-hiding/id (with-continuation-mark 1 2 3))
|
||||||
(test-simple-hiding/id (define-values (x) 1))
|
(test-T-hiding/id (define-values (x) 1))
|
||||||
(test-simple-hiding/id (define-syntaxes (x) 1)))
|
(test-T-hiding/id (define-syntaxes (x) 1)))
|
||||||
(test-suite "Opaque macros"
|
(test-suite "Opaque macros"
|
||||||
(test-simple-hiding/id (id '1))
|
(test-T-hiding/id (id '1))
|
||||||
(test-simple-hiding/id (id 1))
|
(test-T-hiding/id (id 1))
|
||||||
(test-simple-hiding/id (id (id '1)))
|
(test-T-hiding/id (id (id '1)))
|
||||||
;; app is hidden:
|
;; app is hidden:
|
||||||
(test-simple-hiding/id (+ '1 '2)))
|
(test-T-hiding/id (+ '1 '2)))
|
||||||
(test-suite "Transparent macros"
|
(test-suite "Transparent macros"
|
||||||
(test-simple-hiding (Tlist x)
|
(test-T-hiding (Tlist x)
|
||||||
(list x))
|
(list x))
|
||||||
(test-simple-hiding (Tid x) x)
|
(test-T-hiding (Tid x) x)
|
||||||
(test-simple-hiding (Tlist (id x))
|
(test-T-hiding (Tlist (id x))
|
||||||
(list (id x)))
|
(list (id x)))
|
||||||
(test-simple-hiding (Tid (id x))
|
(test-T-hiding (Tid (id x))
|
||||||
(id x))
|
(id x))
|
||||||
(test-simple-hiding (id (Tlist x))
|
(test-T-hiding (id (Tlist x))
|
||||||
(id (list x)))
|
(id (list x)))
|
||||||
(test-simple-hiding (id (Tid x))
|
(test-T-hiding (id (Tid x))
|
||||||
(id x)))
|
(id x)))
|
||||||
(test-suite "Blocks"
|
(test-suite "Blocks"
|
||||||
(test-simple-hiding/id (lambda (x y) x y))
|
(test-T-hiding/id (lambda (x y) x y))
|
||||||
(test-simple-hiding (lambda (x y z) (begin x y) z)
|
(test-T-hiding (lambda (x y z) (begin x y) z)
|
||||||
(lambda (x y z) x y z))
|
(lambda (x y z) x y z))
|
||||||
(test-simple-hiding/id (lambda (x y z) x (begin y z))) ;; expression begin!
|
(test-T-hiding/id (lambda (x y z) x (begin y z))) ;; expression begin!
|
||||||
(test-simple-hiding (lambda (x) (define-values (y) x) y)
|
(test-T-hiding (lambda (x) (define-values (y) x) y)
|
||||||
(lambda (x) (letrec-values ([(y) x]) y)))
|
(lambda (x) (letrec-values ([(y) x]) y)))
|
||||||
(test-simple-hiding (lambda (x) (begin (define-values (y) x)) y)
|
(test-T-hiding (lambda (x) (begin (define-values (y) x)) y)
|
||||||
(lambda (x) (letrec-values ([(y) x]) y)))
|
(lambda (x) (letrec-values ([(y) x]) y)))
|
||||||
(test-simple-hiding (lambda (x) (begin (define-values (y) x) y) x)
|
(test-T-hiding (lambda (x) (begin (define-values (y) x) y) x)
|
||||||
(lambda (x) (letrec-values ([(y) x]) y x)))
|
(lambda (x) (letrec-values ([(y) x]) y x)))
|
||||||
(test-simple-hiding (lambda (x) (id x))
|
(test-T-hiding (lambda (x) (id x))
|
||||||
(lambda (x) (id x)))
|
(lambda (x) (id x)))
|
||||||
(test-simple-hiding (lambda (x) (Tid x))
|
(test-T-hiding (lambda (x) (Tid x))
|
||||||
(lambda (x) x))
|
(lambda (x) x))
|
||||||
(test-simple-hiding/id (lambda (x) (id (define-values (y) x)) x))
|
(test-T-hiding/id (lambda (x) (id (define-values (y) x)) x))
|
||||||
(test-simple-hiding (lambda (x) (id (define-values (y) x)) (Tid x))
|
(test-T-hiding (lambda (x) (id (define-values (y) x)) (Tid x))
|
||||||
(lambda (x) (id (define-values (y) x)) x))
|
(lambda (x) (id (define-values (y) x)) x))
|
||||||
(test-simple-hiding/id (lambda (x) (id (begin (define-values (y) x) x))))
|
(test-T-hiding/id (lambda (x) (id (begin (define-values (y) x) x))))
|
||||||
(test-simple-hiding (lambda (x) (begin (id (define-values (y) x)) y))
|
(test-T-hiding (lambda (x) (begin (id (define-values (y) x)) y))
|
||||||
(lambda (x) (id (define-values (y) x)) y))
|
(lambda (x) (id (define-values (y) x)) y))
|
||||||
(test-simple-hiding (lambda (x) (id (begin (Tid (define-values (y) x)))) (Tid y))
|
(test-T-hiding (lambda (x) (id (begin (Tid (define-values (y) x)))) (Tid y))
|
||||||
(lambda (x) (id (begin (define-values (y) x))) y))
|
(lambda (x) (id (begin (define-values (y) x))) y))
|
||||||
(test-simple-hiding (lambda (x) (id (begin (Tid (define-values (y) x)))) x (Tid y))
|
(test-T-hiding (lambda (x) (id (begin (Tid (define-values (y) x)))) x (Tid y))
|
||||||
(lambda (x) (id (begin (define-values (y) x))) x y))
|
(lambda (x) (id (begin (define-values (y) x))) x y))
|
||||||
(test-simple-hiding (lambda (x) (define-values (y) (id x)) y)
|
(test-T-hiding (lambda (x) (define-values (y) (id x)) y)
|
||||||
(lambda (x) (letrec-values ([(y) (id x)]) y)))
|
(lambda (x) (letrec-values ([(y) (id x)]) y)))
|
||||||
(test-simple-hiding (lambda (x y) x (id y))
|
(test-T-hiding (lambda (x y) x (id y))
|
||||||
(lambda (x y) x (id y)))
|
(lambda (x y) x (id y)))
|
||||||
(test-simple-hiding (lambda (x y) x (Tid y))
|
(test-T-hiding (lambda (x y) x (Tid y))
|
||||||
(lambda (x y) x y))
|
(lambda (x y) x y))
|
||||||
(test-simple-hiding (lambda (x) (id (define-values (y) x)) x (Tid y))
|
(test-T-hiding (lambda (x) (id (define-values (y) x)) x (Tid y))
|
||||||
(lambda (x) (id (define-values (y) x)) x y))
|
(lambda (x) (id (define-values (y) x)) x y))
|
||||||
(test-simple-hiding/id (lambda (x) (id (define-values (y) (id x))) y))
|
(test-T-hiding/id (lambda (x) (id (define-values (y) (id x))) y))
|
||||||
(test-simple-hiding (lambda (x) (id (define-values (y) (Tid x))) y)
|
(test-T-hiding (lambda (x) (id (define-values (y) (Tid x))) y)
|
||||||
(lambda (x) (id (define-values (y) x)) y)))
|
(lambda (x) (id (define-values (y) x)) y)))
|
||||||
(test-suite "Binding expressions"
|
(test-suite "Binding expressions"
|
||||||
(test-simple-hiding/id (lambda (x) x))
|
(test-T-hiding/id (lambda (x) x))
|
||||||
(test-simple-hiding/id (lambda (x) (id x))))
|
(test-T-hiding/id (lambda (x) (id x))))
|
||||||
(test-suite "Module declarations"
|
(test-suite "Module declarations"
|
||||||
(test-simple-hiding (module m mzscheme
|
(test-T-hiding (module m mzscheme
|
||||||
(require 'helper)
|
(require 'helper)
|
||||||
(define x 1))
|
(define x 1))
|
||||||
(module m mzscheme
|
(module m mzscheme
|
||||||
(#%module-begin
|
(require 'helper)
|
||||||
(require 'helper)
|
(define x 1)))
|
||||||
(define x 1))))
|
(test-Tm-hiding (module m mzscheme
|
||||||
(test-simple-hiding (module m mzscheme
|
(require 'helper)
|
||||||
(require 'helper)
|
(define x 1))
|
||||||
(define x (Tlist 1)))
|
(module m mzscheme
|
||||||
(module m mzscheme
|
(#%module-begin
|
||||||
(#%module-begin
|
(require 'helper)
|
||||||
(require 'helper)
|
(define x 1))))
|
||||||
(define x (list 1)))))
|
|
||||||
(test-simple-hiding (module m mzscheme
|
(test-T-hiding (module m mzscheme
|
||||||
(#%plain-module-begin
|
(require 'helper)
|
||||||
(require 'helper)
|
(define x (Tlist 1)))
|
||||||
(define x (Tlist 1))))
|
(module m mzscheme
|
||||||
(module m mzscheme
|
(require 'helper)
|
||||||
(#%plain-module-begin
|
(define x (list 1))))
|
||||||
(require 'helper)
|
(test-Tm-hiding (module m mzscheme
|
||||||
(define x (list 1)))))))))
|
(require 'helper)
|
||||||
|
(define x (Tlist 1)))
|
||||||
|
(module m mzscheme
|
||||||
|
(#%module-begin
|
||||||
|
(require 'helper)
|
||||||
|
(define x (list 1)))))
|
||||||
|
|
||||||
|
(test-T-hiding (module m mzscheme
|
||||||
|
(#%plain-module-begin
|
||||||
|
(require 'helper)
|
||||||
|
(define x (Tlist 1))))
|
||||||
|
(module m mzscheme
|
||||||
|
(#%plain-module-begin
|
||||||
|
(require 'helper)
|
||||||
|
(define x (list 1)))))
|
||||||
|
(test-Tm-hiding (module m mzscheme
|
||||||
|
(#%plain-module-begin
|
||||||
|
(require 'helper)
|
||||||
|
(define x (Tlist 1))))
|
||||||
|
(module m mzscheme
|
||||||
|
(#%plain-module-begin
|
||||||
|
(require 'helper)
|
||||||
|
(define x (list 1)))))))))
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
[#:steps
|
[#:steps
|
||||||
(tag-module-begin
|
(tag-module-begin
|
||||||
(module m '#%kernel (#%module-begin (define-values (x) 'a))))]
|
(module m '#%kernel (#%module-begin (define-values (x) 'a))))]
|
||||||
#:same-hidden-steps)
|
#:no-hidden-steps)
|
||||||
(test "module, MB, def, use"
|
(test "module, MB, def, use"
|
||||||
(module m '#%kernel (#%module-begin (define-values (x) 'a) x))
|
(module m '#%kernel (#%module-begin (define-values (x) 'a) x))
|
||||||
#:no-steps
|
#:no-steps
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
[#:steps
|
[#:steps
|
||||||
(tag-module-begin
|
(tag-module-begin
|
||||||
(module m '#%kernel (#%module-begin (define-values (x) 'a) x)))]
|
(module m '#%kernel (#%module-begin (define-values (x) 'a) x)))]
|
||||||
#:same-hidden-steps)
|
#:no-hidden-steps)
|
||||||
(test "module, MB, quote"
|
(test "module, MB, quote"
|
||||||
(module m '#%kernel (#%module-begin 'a))
|
(module m '#%kernel (#%module-begin 'a))
|
||||||
#:no-steps
|
#:no-steps
|
||||||
|
@ -37,12 +37,12 @@
|
||||||
(module m '#%kernel 'a)
|
(module m '#%kernel 'a)
|
||||||
[#:steps
|
[#:steps
|
||||||
(tag-module-begin (module m '#%kernel (#%module-begin 'a)))]
|
(tag-module-begin (module m '#%kernel (#%module-begin 'a)))]
|
||||||
#:same-hidden-steps)
|
#:no-hidden-steps)
|
||||||
(test "module, 2 quotes"
|
(test "module, 2 quotes"
|
||||||
(module m '#%kernel 'a 'b)
|
(module m '#%kernel 'a 'b)
|
||||||
[#:steps
|
[#:steps
|
||||||
(tag-module-begin (module m '#%kernel (#%module-begin 'a 'b)))]
|
(tag-module-begin (module m '#%kernel (#%module-begin 'a 'b)))]
|
||||||
#:same-hidden-steps)
|
#:no-hidden-steps)
|
||||||
(test "module, MB, begin"
|
(test "module, MB, begin"
|
||||||
(module m '#%kernel (#%module-begin (begin 'a 'b)))
|
(module m '#%kernel (#%module-begin (begin 'a 'b)))
|
||||||
[#:steps
|
[#:steps
|
||||||
|
@ -53,7 +53,7 @@
|
||||||
[#:steps
|
[#:steps
|
||||||
(tag-module-begin (module m '#%kernel (#%module-begin (begin 'a 'b))))
|
(tag-module-begin (module m '#%kernel (#%module-begin (begin 'a 'b))))
|
||||||
(splice-module (module m '#%kernel (#%module-begin 'a 'b)))]
|
(splice-module (module m '#%kernel (#%module-begin 'a 'b)))]
|
||||||
#:same-hidden-steps)
|
#:no-hidden-steps)
|
||||||
(test "module, MB, def in begin"
|
(test "module, MB, def in begin"
|
||||||
(module m '#%kernel (#%module-begin (begin (define-values (x) 'a) x)))
|
(module m '#%kernel (#%module-begin (begin (define-values (x) 'a) x)))
|
||||||
[#:steps
|
[#:steps
|
||||||
|
@ -67,7 +67,7 @@
|
||||||
(module m '#%kernel (#%module-begin (begin (define-values (x) 'a) x))))
|
(module m '#%kernel (#%module-begin (begin (define-values (x) 'a) x))))
|
||||||
(splice-module
|
(splice-module
|
||||||
(module m '#%kernel (#%module-begin (define-values (x) 'a) x)))]
|
(module m '#%kernel (#%module-begin (define-values (x) 'a) x)))]
|
||||||
#:same-hidden-steps)
|
#:no-hidden-steps)
|
||||||
|
|
||||||
(test "module, MB, defstx, use"
|
(test "module, MB, defstx, use"
|
||||||
(module m '#%kernel
|
(module m '#%kernel
|
||||||
|
@ -106,7 +106,11 @@
|
||||||
(#%module-begin
|
(#%module-begin
|
||||||
(#%require 'helper)
|
(#%require 'helper)
|
||||||
'a)))]
|
'a)))]
|
||||||
#:same-hidden-steps)
|
[#:hidden-steps
|
||||||
|
(macro
|
||||||
|
(module m '#%kernel
|
||||||
|
(#%require 'helper)
|
||||||
|
'a))])
|
||||||
|
|
||||||
(test "module k+helper, defs and opaque macros"
|
(test "module k+helper, defs and opaque macros"
|
||||||
(module m '#%kernel
|
(module m '#%kernel
|
||||||
|
@ -196,14 +200,12 @@
|
||||||
(tag-module-begin
|
(tag-module-begin
|
||||||
(module m mzscheme (#%module-begin (define-values (x) 'a) x)))
|
(module m mzscheme (#%module-begin (define-values (x) 'a) x)))
|
||||||
(macro
|
(macro
|
||||||
(module m mzscheme
|
(module m mzscheme
|
||||||
(#%plain-module-begin
|
(#%plain-module-begin
|
||||||
(#%require (for-syntax scheme/mzscheme))
|
(#%require (for-syntax scheme/mzscheme))
|
||||||
(define-values (x) 'a)
|
(define-values (x) 'a)
|
||||||
x)))]
|
x)))]
|
||||||
[#:hidden-steps
|
#:no-hidden-steps)
|
||||||
(tag-module-begin
|
|
||||||
(module m mzscheme (#%module-begin (define-values (x) 'a) x)))])
|
|
||||||
(test "module mz, def"
|
(test "module mz, def"
|
||||||
(module m mzscheme (define-values (x) 'a))
|
(module m mzscheme (define-values (x) 'a))
|
||||||
[#:steps
|
[#:steps
|
||||||
|
@ -214,9 +216,7 @@
|
||||||
(#%plain-module-begin
|
(#%plain-module-begin
|
||||||
(#%require (for-syntax scheme/mzscheme))
|
(#%require (for-syntax scheme/mzscheme))
|
||||||
(define-values (x) 'a))))]
|
(define-values (x) 'a))))]
|
||||||
[#:hidden-steps
|
#:no-hidden-steps)
|
||||||
(tag-module-begin
|
|
||||||
(module m mzscheme (#%module-begin (define-values (x) 'a))))])
|
|
||||||
(test "module mz, quote"
|
(test "module mz, quote"
|
||||||
(module m mzscheme 'a)
|
(module m mzscheme 'a)
|
||||||
[#:steps
|
[#:steps
|
||||||
|
@ -227,9 +227,7 @@
|
||||||
(#%plain-module-begin
|
(#%plain-module-begin
|
||||||
(#%require (for-syntax scheme/mzscheme))
|
(#%require (for-syntax scheme/mzscheme))
|
||||||
'a)))]
|
'a)))]
|
||||||
[#:hidden-steps
|
#:no-hidden-steps)
|
||||||
(tag-module-begin
|
|
||||||
(module m mzscheme (#%module-begin 'a)))])
|
|
||||||
|
|
||||||
(test "module mz, begin with 2 quotes"
|
(test "module mz, begin with 2 quotes"
|
||||||
(module m mzscheme (begin 'a 'b))
|
(module m mzscheme (begin 'a 'b))
|
||||||
|
@ -246,9 +244,7 @@
|
||||||
(#%plain-module-begin
|
(#%plain-module-begin
|
||||||
(#%require (for-syntax scheme/mzscheme))
|
(#%require (for-syntax scheme/mzscheme))
|
||||||
'a 'b)))]
|
'a 'b)))]
|
||||||
[#:hidden-steps
|
#:no-hidden-steps)
|
||||||
(tag-module-begin
|
|
||||||
(module m mzscheme (#%module-begin (begin 'a 'b))))])
|
|
||||||
|
|
||||||
(test "module mz, macro use, quote"
|
(test "module mz, macro use, quote"
|
||||||
(module m mzscheme (or 'a 'b) 'c)
|
(module m mzscheme (or 'a 'b) 'c)
|
||||||
|
@ -289,9 +285,7 @@
|
||||||
(let-values ([(or-part) 'a])
|
(let-values ([(or-part) 'a])
|
||||||
(if or-part or-part 'b))
|
(if or-part or-part 'b))
|
||||||
'c)))]
|
'c)))]
|
||||||
[#:hidden-steps
|
#:no-hidden-steps)
|
||||||
(tag-module-begin
|
|
||||||
(module m mzscheme (#%module-begin (or 'a 'b) 'c)))])
|
|
||||||
|
|
||||||
(test "module mz, macro use"
|
(test "module mz, macro use"
|
||||||
(module m mzscheme (or 'a 'b))
|
(module m mzscheme (or 'a 'b))
|
||||||
|
|
Loading…
Reference in New Issue
Block a user