diff --git a/collects/parser-tools/lex.ss b/collects/parser-tools/lex.ss index c56c4b3..3f2abc4 100644 --- a/collects/parser-tools/lex.ss +++ b/collects/parser-tools/lex.ss @@ -154,17 +154,21 @@ (cond ((= 0 num-to-add) (values from to)) (else - (if (eq? #\newline (car from)) - (begin - (set-lex-buffer-line! - lb - (sub1 (lex-buffer-line lb))) - (set-lex-buffer-offset! - lb - (car (lex-buffer-line-lengths lb))) - (set-lex-buffer-line-lengths! - lb - (cdr (lex-buffer-line-lengths lb))))) + (cond + ((eq? #\newline (car from)) + (set-lex-buffer-line! + lb + (sub1 (lex-buffer-line lb))) + (set-lex-buffer-offset! + lb + (car (lex-buffer-line-lengths lb))) + (set-lex-buffer-line-lengths! + lb + (cdr (lex-buffer-line-lengths lb)))) + (else + (set-lex-buffer-col! + lb + (sub1 (lex-buffer-col lb))))) (switch-buffers (cdr from) (cons (car from) to) (sub1 num-to-add)))))))