diff --git a/pkgs/syntax-color-pkgs/syntax-color-lib/syntax-color/module-lexer.rkt b/pkgs/syntax-color-pkgs/syntax-color-lib/syntax-color/module-lexer.rkt index bbbe26e0e0..7d305551fe 100644 --- a/pkgs/syntax-color-pkgs/syntax-color-lib/syntax-color/module-lexer.rkt +++ b/pkgs/syntax-color-pkgs/syntax-color-lib/syntax-color/module-lexer.rkt @@ -94,7 +94,7 @@ to delegate to the scheme-lexer (in the 'no-lang-line mode). ;; sync ports (for ([i (in-range (file-position in) (file-position p))]) (read-byte-or-special in)) - (values lexeme 'error data 1 end-pos 0 'no-lang-line)] + (values lexeme 'error data new-token-start end-pos 0 'no-lang-line)] [else (for ([i (in-range (file-position in) (file-position lexer-port))]) (read-byte-or-special in)) diff --git a/pkgs/syntax-color-pkgs/syntax-color-test/tests/syntax-color/module-lexer.rkt b/pkgs/syntax-color-pkgs/syntax-color-test/tests/syntax-color/module-lexer.rkt index fa305b0f27..75b32bfd0e 100644 --- a/pkgs/syntax-color-pkgs/syntax-color-test/tests/syntax-color/module-lexer.rkt +++ b/pkgs/syntax-color-pkgs/syntax-color-test/tests/syntax-color/module-lexer.rkt @@ -64,6 +64,10 @@ (check-equal? (lex "#lang at-exp racket/baseBOGUS" #t) `(("#lang at-exp" error 1 30 #f) (,eof eof #f #f no-lang-line))) +(check-equal? (lex " #lang BOGUS" #t) + `((" " white-space 1 2 #f) + ("#lang BOGUS" error 2 13 before-lang-line) + (,eof eof #f #f no-lang-line))) (check same? (lex "#lang at-exp racket/base\n1\n" #t) `(("#lang at-exp racket/base" other 1 25 #f)