aboutsummaryrefslogtreecommitdiffstats
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/util/skip.rs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/util/skip.rs b/src/util/skip.rs
index 2c4198a..a8e4cfe 100644
--- a/src/util/skip.rs
+++ b/src/util/skip.rs
@@ -1,16 +1,18 @@
+//! Utilities to deal with lists of events.
+
use crate::tokenizer::{Event, TokenType};
-/// To do.
+/// Skip from `index`, optionally past `token_types`.
pub fn opt(events: &[Event], index: usize, token_types: &[TokenType]) -> usize {
skip_opt_with_direction(events, index, token_types, true)
}
-/// To do.
+/// Skip from `index`, optionally past `token_types`, backwards.
pub fn opt_back(events: &[Event], index: usize, token_types: &[TokenType]) -> usize {
skip_opt_with_direction(events, index, token_types, false)
}
-/// To do.
+/// Skip internals.
fn skip_opt_with_direction(
events: &[Event],
index: usize,