From c286937e0aa9b3a87c57126c92f9e916e171dd8d Mon Sep 17 00:00:00 2001 From: Alek Ratzloff Date: Tue, 15 Oct 2024 14:04:15 -0700 Subject: [PATCH] Maybe fix lexer lexeme issue once and for all This is an ongoing off-by-one bug that I have not expended enough brainpower to try to fix. Sometimes lexer outputs were getting chopped off by one character at the EOF. I have changed a <= to a < to detect if we're at EOF and that appears to have fixed everything. Getting really tired of this but hopefully that's all that's needed. Signed-off-by: Alek Ratzloff --- src/parser.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/parser.rs b/src/parser.rs index b653893..17effaf 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -76,7 +76,7 @@ impl Lexer { } pub fn is_eof(&self) -> bool { - self.index >= self.text.len() + self.index > self.text.len() } pub fn lexeme(&self) -> &str {