pub trait TreeIterExt {
// Required methods
fn collect_til_punct(&mut self, _: char) -> Vec<TokenTree>;
fn skip_puncts(&mut self, _: &str) -> Vec<TokenTree>;
fn next_if_num(&mut self) -> Option<Literal>;
fn try_next_float(&mut self) -> Option<(f32, LitFloat)>;
fn peek_punct(&mut self) -> char;
fn split_punct(self, _: char) -> Vec<TokenStream>;
}Expand description
This is an extension trait for the following impl:
ⓘ
#[extension(pub trait TreeIterExt)]
impl for PeekIter
Required Methods§
fn collect_til_punct(&mut self, _: char) -> Vec<TokenTree>
Sourcefn skip_puncts(&mut self, _: &str) -> Vec<TokenTree>
fn skip_puncts(&mut self, _: &str) -> Vec<TokenTree>
skip until [Self::next()] isn’t a TokenTree::Punct
Sourcefn next_if_num(&mut self) -> Option<Literal>
fn next_if_num(&mut self) -> Option<Literal>
only progress iter if next is a numeric literal & return it
Sourcefn try_next_float(&mut self) -> Option<(f32, LitFloat)>
fn try_next_float(&mut self) -> Option<(f32, LitFloat)>
Sourcefn peek_punct(&mut self) -> char
fn peek_punct(&mut self) -> char
get next punct as char without progressing iter, if not a punct its a 'n'
Sourcefn split_punct(self, _: char) -> Vec<TokenStream>
fn split_punct(self, _: char) -> Vec<TokenStream>
splits Tokens into multiple TokenStreams by a char delimiter.
- doesn’t include empty parts.