expander: add missing available-module trigger
Repairs `(dynamic-require module-path (void))`. Related to #3128
This commit is contained in:
parent
cd096e0e6b
commit
40045ce1a6
|
@ -3284,6 +3284,36 @@ case of module-leve bindings; it doesn't cover local bindings.
|
|||
(test (dynamic-require ''exports-a-quoted-uninterned-symbol 'sym)
|
||||
(dynamic-require ''imports-a-quoted-uninterned-symbol 'get-sym2)))
|
||||
|
||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
;; Check that `(dynamic-require .... (void))` visits
|
||||
;; available modules as it should
|
||||
|
||||
(parameterize ([current-namespace (make-base-namespace)])
|
||||
(eval '(module defines-a-for-syntax racket/base
|
||||
(require (for-syntax racket/base))
|
||||
(provide (for-syntax a))
|
||||
(define-for-syntax a (make-parameter 'not-done))))
|
||||
(eval '(module uses-a-module-1 racket/base
|
||||
(require 'defines-a-for-syntax
|
||||
(for-syntax racket/base))
|
||||
(begin-for-syntax (a 'done))))
|
||||
(eval '(module uses-a-module-2 racket/base
|
||||
(require 'defines-a-for-syntax
|
||||
(for-syntax racket/base))
|
||||
(provide m)
|
||||
(define-syntax m
|
||||
(let ([val (a)])
|
||||
(lambda (stx)
|
||||
#`'#,val)))))
|
||||
|
||||
;; makes `uses-a-module-1` available:
|
||||
(eval '(require 'uses-a-module-1))
|
||||
;; needs available module visited for `val` to be 'done:
|
||||
(dynamic-require ''uses-a-module-2 (void))
|
||||
;; check `val` via `m`:
|
||||
(namespace-require ''uses-a-module-2)
|
||||
(test 'done eval '(m)))
|
||||
|
||||
;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
||||
|
||||
(report-errs)
|
||||
|
|
|
@ -48,6 +48,7 @@
|
|||
(namespace-module-instantiate! ns mpi phase #:run-phase phase)]
|
||||
[(void? sym)
|
||||
;; Just visit
|
||||
(namespace-visit-available-modules! ns phase)
|
||||
(namespace-module-visit! ns mpi phase #:visit-phase phase)]
|
||||
[else
|
||||
;; Extract a particular value via phase 0....
|
||||
|
|
|
@ -18297,7 +18297,7 @@ static const char *startup_source =
|
|||
"(if(output-port? orig-o_0)"
|
||||
"(void)"
|
||||
"(let-values()"
|
||||
" (raise-argument-error 'fasl->s-exp \"(or/c output-port? #f)\" orig-o_0))))"
|
||||
" (raise-argument-error 's-exp->fasl \"(or/c output-port? #f)\" orig-o_0))))"
|
||||
"(void))"
|
||||
"(values))))"
|
||||
"(let-values((()"
|
||||
|
@ -18310,7 +18310,7 @@ static const char *startup_source =
|
|||
"(void)"
|
||||
"(let-values()"
|
||||
"(raise-argument-error"
|
||||
" 'fasl->s-exp"
|
||||
" 's-exp->fasl"
|
||||
" \"(or/c (procedure-arity-includes/c 1) #f)\""
|
||||
" handle-fail_0))))"
|
||||
"(void))"
|
||||
|
@ -18325,7 +18325,7 @@ static const char *startup_source =
|
|||
"(void)"
|
||||
"(let-values()"
|
||||
"(raise-argument-error"
|
||||
" 'fasl->s-exp"
|
||||
" 's-exp->fasl"
|
||||
" \"(or/c (procedure-arity-includes/c 1) #f)\""
|
||||
" external-lift?_0))))"
|
||||
"(void))"
|
||||
|
@ -51278,11 +51278,17 @@ static const char *startup_source =
|
|||
" phase18_0)))"
|
||||
"(if(void? sym_0)"
|
||||
"(let-values()"
|
||||
"(begin"
|
||||
"(namespace-visit-available-modules! ns_0 phase_0)"
|
||||
"(let-values(((ns20_0) ns_0)"
|
||||
"((mpi21_0) mpi_0)"
|
||||
"((phase22_0) phase_0)"
|
||||
"((phase23_0) phase_0))"
|
||||
"(namespace-module-visit!.1 phase23_0 ns20_0 mpi21_0 phase22_0)))"
|
||||
"(namespace-module-visit!.1"
|
||||
" phase23_0"
|
||||
" ns20_0"
|
||||
" mpi21_0"
|
||||
" phase22_0))))"
|
||||
"(let-values()"
|
||||
"(let-values(((m_0)(namespace->module ns_0 mod-name_0)))"
|
||||
"(let-values((()"
|
||||
|
@ -51593,28 +51599,48 @@ static const char *startup_source =
|
|||
"(let-values(((p_0)(->path f_0)))((1/current-load/use-compiled) p_0 #f))))))))"
|
||||
"(define-values"
|
||||
"(embedded-load)"
|
||||
"(lambda(start_0 end_0 str_0 as-predefined?_0)"
|
||||
"(let-values(((embedded-load_0)"
|
||||
"(lambda(start2_0 end3_0 bstr4_0 as-predefined?5_0 in-path1_0)"
|
||||
"(begin"
|
||||
" 'embedded-load"
|
||||
"(let-values(((start_0) start2_0))"
|
||||
"(let-values(((end_0) end3_0))"
|
||||
"(let-values(((bstr_0) bstr4_0))"
|
||||
"(let-values(((as-predefined?_0) as-predefined?5_0))"
|
||||
"(let-values(((in-path_0) in-path1_0))"
|
||||
"(let-values()"
|
||||
"(let-values(((s_0)"
|
||||
"(if str_0"
|
||||
" str_0"
|
||||
"(let-values(((sp_0)(find-system-path 'exec-file)))"
|
||||
"(let-values(((exe_0)(find-executable-path sp_0 #f)))"
|
||||
"(if bstr_0"
|
||||
" bstr_0"
|
||||
"(let-values(((path_0)"
|
||||
"(if(bytes? in-path_0)"
|
||||
"(let-values()(bytes->path in-path_0))"
|
||||
"(if(string? in-path_0)"
|
||||
"(let-values() in-path_0)"
|
||||
"(let-values()"
|
||||
"(find-executable-path"
|
||||
"(find-system-path 'exec-file)"
|
||||
" #f))))))"
|
||||
"(let-values(((start_1)"
|
||||
"(if(string? start_0)"
|
||||
"(let-values(((or-part_0)(1/string->number start_0)))"
|
||||
"(if or-part_0 or-part_0 0))))"
|
||||
"(if or-part_0 or-part_0 0))"
|
||||
" start_0)))"
|
||||
"(let-values(((end_1)"
|
||||
"(if(string? end_0)"
|
||||
"(let-values(((or-part_0)(1/string->number end_0)))"
|
||||
"(if or-part_0 or-part_0 0))))"
|
||||
"(let-values(((exe4_0) exe_0)"
|
||||
"((temp5_0)"
|
||||
"(if or-part_0 or-part_0 0))"
|
||||
"(let-values(((or-part_0) end_0))"
|
||||
"(if or-part_0 or-part_0(file-size path_0))))))"
|
||||
"(let-values(((path9_0) path_0)"
|
||||
"((temp10_0)"
|
||||
"(lambda()"
|
||||
"(begin"
|
||||
" 'temp5"
|
||||
" 'temp10"
|
||||
"(begin"
|
||||
"(file-position(current-input-port) start_1)"
|
||||
"(read-bytes(max 0(- end_1 start_1))))))))"
|
||||
"(with-input-from-file.1 'binary exe4_0 temp5_0)))))))))"
|
||||
"(with-input-from-file.1 'binary path9_0 temp10_0))))))))"
|
||||
"(let-values(((p_0)(open-input-bytes s_0)))"
|
||||
"((letrec-values(((loop_0)"
|
||||
"(lambda()"
|
||||
|
@ -51624,7 +51650,9 @@ static const char *startup_source =
|
|||
"(with-continuation-mark"
|
||||
" parameterization-key"
|
||||
"(extend-parameterization"
|
||||
"(continuation-mark-set-first #f parameterization-key)"
|
||||
"(continuation-mark-set-first"
|
||||
" #f"
|
||||
" parameterization-key)"
|
||||
" 1/read-accept-compiled"
|
||||
" #t"
|
||||
" 1/read-accept-reader"
|
||||
|
@ -51641,12 +51669,18 @@ static const char *startup_source =
|
|||
"(with-continuation-mark"
|
||||
" parameterization-key"
|
||||
"(extend-parameterization"
|
||||
"(continuation-mark-set-first #f parameterization-key)"
|
||||
"(continuation-mark-set-first"
|
||||
" #f"
|
||||
" parameterization-key)"
|
||||
" current-module-declare-as-predefined"
|
||||
" as-predefined?_0)"
|
||||
"(let-values()((1/current-eval) e_0)))"
|
||||
"(loop_0)))))))))"
|
||||
" loop_0)))))))"
|
||||
" loop_0))))))))))))))"
|
||||
"(case-lambda"
|
||||
"((start_0 end_0 bstr_0 as-predefined?_0)(begin(embedded-load_0 start_0 end_0 bstr_0 as-predefined?_0 #f)))"
|
||||
"((start_0 end_0 bstr_0 as-predefined?_0 in-path1_0)"
|
||||
"(embedded-load_0 start_0 end_0 bstr_0 as-predefined?_0 in-path1_0)))))"
|
||||
"(define-values(->path)(lambda(s_0)(begin(if(string? s_0)(string->path s_0) s_0))))"
|
||||
"(define-values"
|
||||
"(find-main-collects)"
|
||||
|
|
Loading…
Reference in New Issue
Block a user