From 6adb10f3b756b64c3a4fad84958486eadff1f8e4 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Sun, 2 Oct 2022 11:36:06 -0400 Subject: [PATCH] scanner: Fix recording of !><= at very end Since we keep these in the `in` state, if we see EOF we can't end until we actually clear `in`! --- scanner.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scanner.scm b/scanner.scm index b35ff63..2466a2a 100644 --- a/scanner.scm +++ b/scanner.scm @@ -39,10 +39,10 @@ (get-tokens (add1 i2) (add1 i2) line #f))) (let ((c (peek i))) - (if (not c) + (if (and (not in) (not c)) (list (make-token 'EOF "" #f line)) (cond - ((eq? in 'comment) (if (eq? #\newline c) + ((eq? in 'comment) (if (or (not c) (eq? #\newline c)) (get-tokens (add1 i) (add1 i) (add1 line) #f) (get-tokens s (add1 i) line 'comment))) ((eq? in 'string) #f) -- libgit2 1.1.1