summaryrefslogtreecommitdiff
path: root/src/parse/tokens.rs
diff options
context:
space:
mode:
authorLaurenz <laurmaedje@gmail.com>2021-01-20 21:33:13 +0100
committerLaurenz <laurmaedje@gmail.com>2021-01-20 21:33:13 +0100
commit84ba547c7c80e45cc8edafcde8714973bb2a3a2f (patch)
treee5b7eb97799def1907f9138cbe1fa001060c0196 /src/parse/tokens.rs
parentdd246e5bc944f90be7ba2981c2b73520a4bfbf45 (diff)
If expressions 🔀
Diffstat (limited to 'src/parse/tokens.rs')
-rw-r--r--src/parse/tokens.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/parse/tokens.rs b/src/parse/tokens.rs
index 68b31a87..312e941b 100644
--- a/src/parse/tokens.rs
+++ b/src/parse/tokens.rs
@@ -42,6 +42,11 @@ impl<'s> Tokens<'s> {
self.s.index().into()
}
+ /// Jump to the given position.
+ pub fn jump(&mut self, pos: Pos) {
+ self.s.jump(pos.to_usize());
+ }
+
/// The underlying scanner.
pub fn scanner(&self) -> &Scanner<'s> {
&self.s