diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-02-17 23:54:00 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-02-18 01:06:20 +0100 |
| commit | acae6e2a54f11b27bae343a15d9eff952323fe28 (patch) | |
| tree | 60b7f021a66436f9035441f40be965ffb9df3897 /src/parse/scanner.rs | |
| parent | 980f898d553bec35bd94171d47fd86cb13e39b23 (diff) | |
List label styling
Diffstat (limited to 'src/parse/scanner.rs')
| -rw-r--r-- | src/parse/scanner.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/parse/scanner.rs b/src/parse/scanner.rs index 81fa4fba..685503c3 100644 --- a/src/parse/scanner.rs +++ b/src/parse/scanner.rs @@ -90,6 +90,12 @@ impl<'s> Scanner<'s> { self.rest().chars().next() } + /// Get the nth-previous eaten char. + #[inline] + pub fn prev(&self, n: usize) -> Option<char> { + self.eaten().chars().nth_back(n) + } + /// Checks whether the next char fulfills a condition. /// /// Returns `default` if there is no next char. |
