pub struct CharNavigator<'a> { /* private fields */ }Expand description
Character navigation helper for tokenizer
Provides character-level navigation with position tracking and lookahead capabilities for efficient tokenization.
Implementations§
Sourcepub fn new(source: &'a str, position: usize, line: usize, column: usize) -> Self
pub fn new(source: &'a str, position: usize, line: usize, column: usize) -> Self
Create new character navigator
Sourcepub fn peek_char(&mut self) -> Result<char>
pub fn peek_char(&mut self) -> Result<char>
Peek at current character without advancing
§Errors
Returns an error if the current position contains invalid UTF-8 or is at end of input.
Sourcepub fn peek_next(&self) -> Result<char>
pub fn peek_next(&self) -> Result<char>
Peek at next character without advancing
§Errors
Returns an error if the next position is at end of input.
Sourcepub fn advance_char(&mut self) -> Result<char>
pub fn advance_char(&mut self) -> Result<char>
Sourcepub fn skip_whitespace(&mut self)
pub fn skip_whitespace(&mut self)
Skip whitespace (excluding newlines)
Trait Implementations§
Source§fn clone(&self) -> CharNavigator<'a>
fn clone(&self) -> CharNavigator<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
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