From b5dea44ee7859a499ee4858ae234963bd9152551 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 10 Dec 2019 13:24:30 -0800 Subject: [PATCH] Assert that lexer advances over entire input (#560) --- src/lexer.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lexer.rs b/src/lexer.rs index cf02394..582563d 100644 --- a/src/lexer.rs +++ b/src/lexer.rs @@ -285,6 +285,9 @@ impl<'src> Lexer<'src> { self.token(Eof); + assert_eq!(self.token_start.offset, self.token_end.offset); + assert_eq!(self.token_start.offset, self.src.len()); + Ok(self.tokens) }