now actually evaling the module
This commit is contained in:
parent
4ba8967187
commit
76e0b52d30
20
main.rkt
20
main.rkt
|
@ -3,6 +3,7 @@
|
|||
(require racket/dict
|
||||
racket/function
|
||||
syntax/modread
|
||||
syntax/parse
|
||||
"coverage.rkt"
|
||||
"strace.rkt")
|
||||
|
||||
|
@ -14,11 +15,26 @@
|
|||
(for ([p paths])
|
||||
(define stx
|
||||
(with-module-reading-parameterization (thunk (read-syntax p (open-input-file p)))))
|
||||
(define anned (annotate-top (expand stx) (namespace-base-phase ns)))
|
||||
(eval-syntax anned ns))
|
||||
(define-values (name anned)
|
||||
(syntax-parse (expand stx)
|
||||
#:datum-literals (module)
|
||||
[(~and s (module name:id lang forms ...))
|
||||
(values (syntax-e #'name)
|
||||
(annotate-top #'s (namespace-base-phase ns))
|
||||
#;
|
||||
#`(module name lang
|
||||
#,@(map (lambda (x) (annotate-top stx (namespace-base-phase ns)))
|
||||
(syntax-e #'(forms ...)))))]))
|
||||
(eval-syntax anned ns)
|
||||
(parameterize ([current-namespace ns])
|
||||
(namespace-require `',name)))
|
||||
coverage)
|
||||
|
||||
(define (clear-coverage!)
|
||||
(dict-clear! coverage)
|
||||
(set! ns (make-base-empty-namespace))
|
||||
(namespace-attach-module (current-namespace) "coverage.rkt" ns))
|
||||
|
||||
(module+ test
|
||||
(require racket/pretty)
|
||||
(pretty-print (test-files "tests/basic/prog.rkt")))
|
||||
|
|
Loading…
Reference in New Issue
Block a user