Commit bdb00df5f8e4d8adf240000a6949e5cede18a195

Thomas de Grivel 2018-06-18T10:24:01

fix eof

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/token-stream.lisp b/token-stream.lisp
index 1e0dffd..2cbd57e 100644
--- a/token-stream.lisp
+++ b/token-stream.lisp
@@ -178,11 +178,8 @@ stack."))
      (let ((length (- (the fixnum (fill-pointer (lexer-buffer lx)))
                       (the fixnum (lexer-match-start lx)))))
        (declare (type fixnum length))
-       (when (lexer-input-ended lx)
-         (if (= 0 length)
-             (signal (make-instance 'end-of-file :stream lx))
-             (return)))
-       (unless (< length n)
+       (when (or (lexer-input-ended lx)
+                 (<= n length))
          (return))
        (lexer-input lx))))