Struct protobuf_support::lexer::tokenizer::Tokenizer
source · pub struct Tokenizer<'a> { /* private fields */ }
Implementations§
source§impl<'a> Tokenizer<'a>
impl<'a> Tokenizer<'a>
pub fn new(input: &'a str, comment_style: ParserLanguage) -> Tokenizer<'a>
pub fn loc(&self) -> Loc
pub fn lookahead_loc(&mut self) -> Loc
pub fn lookahead_some(&mut self) -> TokenizerResult<&Token>
pub fn next_some(&mut self) -> TokenizerResult<Token>
sourcepub fn advance(&mut self) -> TokenizerResult<Token>
pub fn advance(&mut self) -> TokenizerResult<Token>
Can be called only after lookahead, otherwise it’s error
sourcepub fn syntax_eof(&mut self) -> TokenizerResult<bool>
pub fn syntax_eof(&mut self) -> TokenizerResult<bool>
No more tokens
pub fn next_token_if_map<P, R>(&mut self, p: P) -> TokenizerResult<Option<R>>
pub fn next_token_check_map<P, R, E>(&mut self, p: P) -> Result<R, E>
pub fn next_ident_if_in( &mut self, idents: &[&str] ) -> TokenizerResult<Option<String>>
pub fn next_ident_if_eq(&mut self, word: &str) -> TokenizerResult<bool>
pub fn next_ident_expect_eq(&mut self, word: &str) -> TokenizerResult<()>
pub fn next_ident_if_eq_error( &mut self, word: &'static str ) -> TokenizerResult<()>
pub fn next_symbol_if_eq(&mut self, symbol: char) -> TokenizerResult<bool>
pub fn next_symbol_expect_eq( &mut self, symbol: char, desc: &'static str ) -> TokenizerResult<()>
pub fn next_symbol_expect_eq_oneof( &mut self, symbols: &[char] ) -> TokenizerResult<char>
pub fn lookahead_is_str_lit(&mut self) -> TokenizerResult<bool>
pub fn lookahead_is_int_lit(&mut self) -> TokenizerResult<bool>
pub fn lookahead_is_json_number(&mut self) -> TokenizerResult<bool>
pub fn lookahead_if_symbol(&mut self) -> TokenizerResult<Option<char>>
pub fn lookahead_is_symbol(&mut self, symbol: char) -> TokenizerResult<bool>
pub fn lookahead_is_ident(&mut self, ident: &str) -> TokenizerResult<bool>
pub fn next_ident(&mut self) -> TokenizerResult<String>
pub fn next_str_lit(&mut self) -> TokenizerResult<StrLit>
pub fn next_int_lit(&mut self) -> TokenizerResult<u64>
pub fn next_float_lit(&mut self) -> TokenizerResult<f64>
Trait Implementations§
Auto Trait Implementations§
impl<'a> RefUnwindSafe for Tokenizer<'a>
impl<'a> Send for Tokenizer<'a>
impl<'a> Sync for Tokenizer<'a>
impl<'a> Unpin for Tokenizer<'a>
impl<'a> UnwindSafe for Tokenizer<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more