Commit 05bd07555542dc2d6c94ccc3075549f847a1b789

Thomas de Grivel 2018-06-18T10:28:15

better eof handling

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
diff --git a/parser.lisp b/parser.lisp
index c863dc6..b9940b0 100644
--- a/parser.lisp
+++ b/parser.lisp
@@ -123,8 +123,9 @@
            nil)
           (t
            (let ((token (parser-match-token pr 0)))
-             (incf (the fixnum (parser-match-start pr)))
-             token)))))
+             (when token
+               (incf (the fixnum (parser-match-start pr)))
+               token))))))
 
 (defmacro match-sequence (parser &body body)
   (let ((pr (gensym "PR-"))