diff options
Diffstat (limited to 'src/util')
-rw-r--r-- | src/util/skip.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/util/skip.rs b/src/util/skip.rs index a8e4cfe..971beb6 100644 --- a/src/util/skip.rs +++ b/src/util/skip.rs @@ -1,14 +1,15 @@ //! Utilities to deal with lists of events. -use crate::tokenizer::{Event, TokenType}; +use crate::token::Token; +use crate::tokenizer::Event; /// Skip from `index`, optionally past `token_types`. -pub fn opt(events: &[Event], index: usize, token_types: &[TokenType]) -> usize { +pub fn opt(events: &[Event], index: usize, token_types: &[Token]) -> usize { skip_opt_with_direction(events, index, token_types, true) } /// Skip from `index`, optionally past `token_types`, backwards. -pub fn opt_back(events: &[Event], index: usize, token_types: &[TokenType]) -> usize { +pub fn opt_back(events: &[Event], index: usize, token_types: &[Token]) -> usize { skip_opt_with_direction(events, index, token_types, false) } @@ -16,7 +17,7 @@ pub fn opt_back(events: &[Event], index: usize, token_types: &[TokenType]) -> us fn skip_opt_with_direction( events: &[Event], index: usize, - token_types: &[TokenType], + token_types: &[Token], forward: bool, ) -> usize { let mut index = index; |