summaryrefslogtreecommitdiff
path: root/src/parse
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse')
-rw-r--r--src/parse/scanner.rs5
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> {