From 62a86122aa81c93fe7d1824999872f1e2ec8a7e5 Mon Sep 17 00:00:00 2001 From: Scott Owens Date: Tue, 22 Jan 2002 22:11:48 +0000 Subject: [PATCH] *** empty log message *** original commit: 8df669f6a6cd1ece741f95aba83d6e37b6b498cf --- collects/parser-tools/lex.ss | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/collects/parser-tools/lex.ss b/collects/parser-tools/lex.ss index 851a7a2..7206bd6 100644 --- a/collects/parser-tools/lex.ss +++ b/collects/parser-tools/lex.ss @@ -63,8 +63,8 @@ ;; c = char | eof ;; lex-buf = - ;; (make-lex-buffer input-port (c list) (c list) int int int (int list) boolean) - (define-struct lex-buffer (ip from to offset line col line-lengths tab-skips has-seen-eof?)) + ;; (make-lex-buffer input-port (c list) (c list) int int int (int list)) + (define-struct lex-buffer (ip from to offset line col line-lengths tab-skips)) ;; make-lex-buf: input-port -> lex-buf (define make-lex-buf @@ -74,7 +74,7 @@ ((not (input-port? ip)) (raise-type-error 'make-lex-buf "input-port" 0 ip)) (else - (make-lex-buffer ip null null 1 1 1 null null #f)))) + (make-lex-buffer ip null null 1 1 1 null null)))) ((ip offsets) (cond ((not (input-port? ip)) @@ -85,19 +85,12 @@ (not (andmap (lambda (x) (>= x 0)) offsets))) (raise-type-error 'make-lex-buf "list of 3 non-negative exact integers" 1 ip offsets)) (else - (make-lex-buffer ip null null (caddr offsets) (car offsets) (cadr offsets) null null #f)))))) + (make-lex-buffer ip null null (caddr offsets) (car offsets) (cadr offsets) null null)))))) (define (get-next lb) (cond ((null? (lex-buffer-from lb)) - (let ((res (read-char (lex-buffer-ip lb)))) - (if (eof-object? res) - (if (lex-buffer-has-seen-eof? lb) - (raise-read-error - (format "lex-buf: No characters left in input stream") - #f #f #f #f #f) - (set-lex-buffer-has-seen-eof?! lb #t))) - res)) + (read-char (lex-buffer-ip lb))) (else (begin0 (car (lex-buffer-from lb))