Skip to content

Commit d7fa8b9

Browse files
committed
Fix a comment reader bug
Some languages have lexers that only work if the input port has line counting enabled. Found via running Resyntax on [this file](https://github.com/racket/typed-racket/blob/master/typed-racket-test/succeed/2d-typed.rkt) which uses `#lang 2d typed/racket/base`.
1 parent ef1a5e9 commit d7fa8b9

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

private/source.rkt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@
201201
(define (source-tokens src)
202202
(with-input-from-source src
203203
(λ ()
204+
(port-count-lines! (current-input-port))
204205
(define tokens (make-vector-builder))
205206
(let loop ([offset 0] [mode #false])
206207
(define-values (text raw-attributes delimiter-kind start end _ new-mode)

0 commit comments

Comments
 (0)