fix module require-cycle detection
svn: r5963
This commit is contained in:
parent
7091496cd0
commit
4fe6bd19a4
File diff suppressed because it is too large
Load Diff
|
@ -3226,6 +3226,7 @@
|
||||||
"(define -module-hash-table-table(make-hash-table 'weak)) "
|
"(define -module-hash-table-table(make-hash-table 'weak)) "
|
||||||
"(define -path-cache(make-hash-table 'weak 'equal)) "
|
"(define -path-cache(make-hash-table 'weak 'equal)) "
|
||||||
"(define -loading-filename(gensym))"
|
"(define -loading-filename(gensym))"
|
||||||
|
"(define -loading-prompt-tag(make-continuation-prompt-tag 'module-loading))"
|
||||||
"(define -prev-relto #f)"
|
"(define -prev-relto #f)"
|
||||||
"(define -prev-relto-dir #f)"
|
"(define -prev-relto-dir #f)"
|
||||||
"(define(make-standard-module-name-resolver orig-namespace)"
|
"(define(make-standard-module-name-resolver orig-namespace)"
|
||||||
|
@ -3380,9 +3381,13 @@
|
||||||
" (if (eq? #t suffix) \"\" suffix)"
|
" (if (eq? #t suffix) \"\" suffix)"
|
||||||
" filename)))"
|
" filename)))"
|
||||||
"(unless got"
|
"(unless got"
|
||||||
"(let((l(continuation-mark-set->list"
|
"(let((l(let((tag(if(continuation-prompt-available? -loading-prompt-tag)"
|
||||||
"(current-continuation-marks)"
|
" -loading-prompt-tag"
|
||||||
" -loading-filename))"
|
"(default-continuation-prompt-tag))))"
|
||||||
|
"(continuation-mark-set->list"
|
||||||
|
"(current-continuation-marks tag)"
|
||||||
|
" -loading-filename"
|
||||||
|
" tag)))"
|
||||||
"(ns(current-namespace)))"
|
"(ns(current-namespace)))"
|
||||||
"(for-each"
|
"(for-each"
|
||||||
"(lambda(s)"
|
"(lambda(s)"
|
||||||
|
@ -3395,12 +3400,16 @@
|
||||||
"(map cdr(reverse(cons s l))))))"
|
"(map cdr(reverse(cons s l))))))"
|
||||||
" l))"
|
" l))"
|
||||||
"(let((prefix(string->symbol abase)))"
|
"(let((prefix(string->symbol abase)))"
|
||||||
|
"((if(continuation-prompt-available? -loading-prompt-tag)"
|
||||||
|
"(lambda(f)(f))"
|
||||||
|
"(lambda(f)(call-with-continuation-prompt f -loading-prompt-tag)))"
|
||||||
|
"(lambda()"
|
||||||
"(with-continuation-mark -loading-filename(cons(current-namespace) normal-filename)"
|
"(with-continuation-mark -loading-filename(cons(current-namespace) normal-filename)"
|
||||||
"(parameterize((current-module-name-prefix prefix))"
|
"(parameterize((current-module-name-prefix prefix))"
|
||||||
"((current-load/use-compiled) "
|
"((current-load/use-compiled) "
|
||||||
" filename "
|
" filename "
|
||||||
"(string->symbol(bytes->string/latin-1(path->bytes no-sfx)))))))"
|
"(string->symbol(bytes->string/latin-1(path->bytes no-sfx))))))))"
|
||||||
"(hash-table-put! ht modname suffix))))"
|
"(hash-table-put! ht modname suffix)))))"
|
||||||
"(when(and(not(vector? s-parsed))"
|
"(when(and(not(vector? s-parsed))"
|
||||||
"(or(string? s)"
|
"(or(string? s)"
|
||||||
"(and(pair? s)"
|
"(and(pair? s)"
|
||||||
|
|
|
@ -3695,6 +3695,7 @@
|
||||||
(define -path-cache (make-hash-table 'weak 'equal)) ; weak map from `lib' path + corrent-library-paths to symbols
|
(define -path-cache (make-hash-table 'weak 'equal)) ; weak map from `lib' path + corrent-library-paths to symbols
|
||||||
|
|
||||||
(define -loading-filename (gensym))
|
(define -loading-filename (gensym))
|
||||||
|
(define -loading-prompt-tag (make-continuation-prompt-tag 'module-loading))
|
||||||
(define -prev-relto #f)
|
(define -prev-relto #f)
|
||||||
(define -prev-relto-dir #f)
|
(define -prev-relto-dir #f)
|
||||||
|
|
||||||
|
@ -3860,9 +3861,13 @@
|
||||||
filename)))
|
filename)))
|
||||||
(unless got
|
(unless got
|
||||||
;; Currently loading?
|
;; Currently loading?
|
||||||
(let ([l (continuation-mark-set->list
|
(let ([l (let ([tag (if (continuation-prompt-available? -loading-prompt-tag)
|
||||||
(current-continuation-marks)
|
-loading-prompt-tag
|
||||||
-loading-filename)]
|
(default-continuation-prompt-tag))])
|
||||||
|
(continuation-mark-set->list
|
||||||
|
(current-continuation-marks tag)
|
||||||
|
-loading-filename
|
||||||
|
tag))]
|
||||||
[ns (current-namespace)])
|
[ns (current-namespace)])
|
||||||
(for-each
|
(for-each
|
||||||
(lambda (s)
|
(lambda (s)
|
||||||
|
@ -3875,12 +3880,16 @@
|
||||||
(map cdr (reverse (cons s l))))))
|
(map cdr (reverse (cons s l))))))
|
||||||
l))
|
l))
|
||||||
(let ([prefix (string->symbol abase)])
|
(let ([prefix (string->symbol abase)])
|
||||||
|
((if (continuation-prompt-available? -loading-prompt-tag)
|
||||||
|
(lambda (f) (f))
|
||||||
|
(lambda (f) (call-with-continuation-prompt f -loading-prompt-tag)))
|
||||||
|
(lambda ()
|
||||||
(with-continuation-mark -loading-filename (cons (current-namespace) normal-filename)
|
(with-continuation-mark -loading-filename (cons (current-namespace) normal-filename)
|
||||||
(parameterize ([current-module-name-prefix prefix])
|
(parameterize ([current-module-name-prefix prefix])
|
||||||
((current-load/use-compiled)
|
((current-load/use-compiled)
|
||||||
filename
|
filename
|
||||||
(string->symbol (bytes->string/latin-1 (path->bytes no-sfx)))))))
|
(string->symbol (bytes->string/latin-1 (path->bytes no-sfx))))))))
|
||||||
(hash-table-put! ht modname suffix))))
|
(hash-table-put! ht modname suffix)))))
|
||||||
;; If a `lib' path, cache pathname manipulations
|
;; If a `lib' path, cache pathname manipulations
|
||||||
(when (and (not (vector? s-parsed))
|
(when (and (not (vector? s-parsed))
|
||||||
(or (string? s)
|
(or (string? s)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user