File tree 2 files changed +7
-6
lines changed
2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change 84
84
#:requires requires))
85
85
(super-new )))
86
86
87
- (define (collect-from path)
87
+ (define (collect-from path ns )
88
88
(define text (new text%))
89
89
(send text load-file path)
90
90
(define collector (new collector% [src path] [text text]))
91
91
(define-values (src-dir file dir?) (split-path path))
92
92
(log:info "collect-from path: ~a " path)
93
93
(define in (open-input-string (send text get-text)))
94
94
95
- (try (define ns (make-base-namespace))
96
- (define-values (add-syntax done) (make-traversal ns src-dir))
95
+ (try (define-values (add-syntax done) (make-traversal ns src-dir))
97
96
(parameterize ([current-annotations collector]
98
97
[current-namespace ns]
99
98
[current-load-relative-directory src-dir])
@@ -125,4 +124,5 @@ modifier author: Lîm Tsú-thuàn(GitHub: @dannypsnl)
125
124
(bytes->string/utf-8 v)))
126
125
127
126
(module+ main
128
- (record-doc (collect-from (normalize-path "collector.rkt " ))))
127
+ (define ns (make-base-namespace))
128
+ (record-doc (collect-from (normalize-path "collector.rkt " ) ns)))
Original file line number Diff line number Diff line change 71
71
(define (make-record-maintainer file-path)
72
72
(thread
73
73
(thunk
74
- (define cached-record (collect-from file-path))
74
+ (define ns (make-base-namespace))
75
+ (define cached-record (collect-from file-path ns))
75
76
(let loop ()
76
77
(match (thread-receive)
77
78
[(list 'update )
78
79
(match-define (struct* record ([created-time created-time])) cached-record)
79
80
(when (< created-time (file-or-directory-modify-seconds file-path))
80
- (set! cached-record (collect-from file-path)))]
81
+ (set! cached-record (collect-from file-path ns )))]
81
82
82
83
[(list 'require-location? from require )
83
84
(define requires (record-requires cached-record))
You can’t perform that action at this time.
0 commit comments