|
|
@ -200,19 +200,17 @@
|
|
|
|
((eq? #\tab char-in)
|
|
|
|
((eq? #\tab char-in)
|
|
|
|
(let ((skip-amt (- 8 (modulo (lex-buffer-col lb) 8))))
|
|
|
|
(let ((skip-amt (- 8 (modulo (lex-buffer-col lb) 8))))
|
|
|
|
(set-lex-buffer-tab-skips! lb (cons skip-amt (lex-buffer-tab-skips lb)))
|
|
|
|
(set-lex-buffer-tab-skips! lb (cons skip-amt (lex-buffer-tab-skips lb)))
|
|
|
|
(set-lex-buffer-col! lb (+ skip-amt (lex-buffer-col lb)))
|
|
|
|
(set-lex-buffer-col! lb (+ skip-amt (lex-buffer-col lb)))))
|
|
|
|
(set-lex-buffer-offset! lb (+ skip-amt (lex-buffer-col lb)))))
|
|
|
|
|
|
|
|
((eq? #\newline char-in)
|
|
|
|
((eq? #\newline char-in)
|
|
|
|
(set-lex-buffer-line-lengths!
|
|
|
|
(set-lex-buffer-line-lengths!
|
|
|
|
lb
|
|
|
|
lb
|
|
|
|
(cons (lex-buffer-col lb)
|
|
|
|
(cons (lex-buffer-col lb)
|
|
|
|
(lex-buffer-line-lengths lb)))
|
|
|
|
(lex-buffer-line-lengths lb)))
|
|
|
|
(set-lex-buffer-line! lb (add1 (lex-buffer-line lb)))
|
|
|
|
(set-lex-buffer-line! lb (add1 (lex-buffer-line lb)))
|
|
|
|
(set-lex-buffer-col! lb 1)
|
|
|
|
(set-lex-buffer-col! lb 1))
|
|
|
|
(set-lex-buffer-offset! lb (add1 (lex-buffer-offset lb))))
|
|
|
|
|
|
|
|
(else
|
|
|
|
(else
|
|
|
|
(set-lex-buffer-col! lb (add1 (lex-buffer-col lb)))
|
|
|
|
(set-lex-buffer-col! lb (add1 (lex-buffer-col lb)))))
|
|
|
|
(set-lex-buffer-offset! lb (add1 (lex-buffer-offset lb)))))
|
|
|
|
(set-lex-buffer-offset! lb (add1 (lex-buffer-offset lb)))
|
|
|
|
char-in)))
|
|
|
|
char-in)))
|
|
|
|
|
|
|
|
|
|
|
|
;; push-back: lex-buf * int -> c list
|
|
|
|
;; push-back: lex-buf * int -> c list
|
|
|
@ -240,8 +238,6 @@
|
|
|
|
((eq? #\tab (car from))
|
|
|
|
((eq? #\tab (car from))
|
|
|
|
(set-lex-buffer-col! lb (- (lex-buffer-col lb)
|
|
|
|
(set-lex-buffer-col! lb (- (lex-buffer-col lb)
|
|
|
|
(car (lex-buffer-tab-skips lb))))
|
|
|
|
(car (lex-buffer-tab-skips lb))))
|
|
|
|
(set-lex-buffer-offset! lb (- (add1 (lex-buffer-offset lb))
|
|
|
|
|
|
|
|
(car (lex-buffer-tab-skips lb))))
|
|
|
|
|
|
|
|
(set-lex-buffer-tab-skips! lb (cdr (lex-buffer-tab-skips lb))))
|
|
|
|
(set-lex-buffer-tab-skips! lb (cdr (lex-buffer-tab-skips lb))))
|
|
|
|
(else
|
|
|
|
(else
|
|
|
|
(set-lex-buffer-col! lb (sub1 (lex-buffer-col lb)))))
|
|
|
|
(set-lex-buffer-col! lb (sub1 (lex-buffer-col lb)))))
|
|
|
|