File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 2727 [source-code-analysis? (-> any/c boolean?)]
2828 [source-code-analysis-code (-> source-code-analysis? source?)]
2929 [source-code-analysis-visited-forms (-> source-code-analysis? (listof syntax?))]
30+ [source-code-analysis-expansion-time-output (-> source-code-analysis? immutable-string?)]
3031 [syntax-source-location (-> syntax? source-location?)]
3132 [with-input-from-source (-> source? (-> any ) any )]))
3233
7879 #:guard (λ (original contents _ ) (values original (string->immutable-string contents))))
7980
8081
81- (define-record-type source-code-analysis (code visited-forms))
82+ (define-record-type source-code-analysis (code visited-forms expansion-time-output ))
8283(define-record-type source-location (source line column position span))
8384
8485
177178 (add-all-original-subforms! visited))]
178179 [(_ _ ) (void)])
179180
181+ (define output-port (open-output-string))
180182 (define expanded
181- (parameterize ([current-expand-observe observe-event!])
183+ (parameterize ([current-expand-observe observe-event!]
184+ [current-output-port output-port])
182185 (expand program-stx)))
186+
187+ (define output (get-output-string output-port))
183188 (define binding-table (fully-expanded-syntax-binding-table expanded))
184189 (define original-binding-table-by-position
185190 (for*/fold ([table (hash)])
221226 (sorting syntax-source-location<=> #:key syntax-source-location)
222227 #:into into-list))
223228
224- (source-code-analysis #:code code #:visited-forms visited)))
229+ (source-code-analysis #:code code #:visited-forms visited #:expansion-time-output output )))
225230
226231
227232(define (syntax-source-location stx)
You can’t perform that action at this time.
0 commit comments