diff options
Diffstat (limited to 'src/parse/scanner.rs')
| -rw-r--r-- | src/parse/scanner.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/parse/scanner.rs b/src/parse/scanner.rs index 6db89132..81fa4fba 100644 --- a/src/parse/scanner.rs +++ b/src/parse/scanner.rs @@ -19,6 +19,11 @@ impl<'s> Scanner<'s> { Self { src, index: 0 } } + /// Whether the end of the string is reached. + pub fn eof(&self) -> bool { + self.index == self.src.len() + } + /// Consume the next char. #[inline] pub fn eat(&mut self) -> Option<char> { |
