Skip to content

Commit

Permalink
fix side effects of expand that would print something and messes wi…
Browse files Browse the repository at this point in the history
…th stdout
  • Loading branch information
6cdh authored and jeapostrophe committed Jan 30, 2025
1 parent 991db89 commit 6b0758d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion check-syntax.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,10 @@
(define original-stx (with-module-reading-parameterization
(λ () (read-syntax src in))))
;; 90 seconds limit for possible infinity recursive macro expand
(define stx (timeout 90 (expand original-stx)))
(define stx
;; parameterize current output port to fix side effects of `expand`.
(parameterize ([current-output-port (open-output-string)])
(timeout 90 (expand original-stx))))
(add-syntax stx)
(set! valid #t)
(done)
Expand Down

0 comments on commit 6b0758d

Please sign in to comment.