diff options
author | Titus Wormer <tituswormer@gmail.com> | 2022-07-07 18:56:06 +0200 |
---|---|---|
committer | Titus Wormer <tituswormer@gmail.com> | 2022-07-07 18:56:06 +0200 |
commit | 92b42e06f943338ce8b54b7e22cbb116ff598fa6 (patch) | |
tree | ff51df093f52dc33bfac5e1c236b41cfbd21c220 /src/util/skip.rs | |
parent | fdb1f1694f44cfbc59d303a10371300b48d74627 (diff) | |
download | markdown-rs-92b42e06f943338ce8b54b7e22cbb116ff598fa6.tar.gz markdown-rs-92b42e06f943338ce8b54b7e22cbb116ff598fa6.tar.bz2 markdown-rs-92b42e06f943338ce8b54b7e22cbb116ff598fa6.zip |
Refactor to move token types to `token`
Diffstat (limited to 'src/util/skip.rs')
-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; |