pub struct Scanner { /* private fields */ }Expand description
Scanner that tokenizes TOON input into a sequence of tokens.
Implementations§
Source§impl Scanner
impl Scanner
Sourcepub fn set_active_delimiter(&mut self, delimiter: Option<Delimiter>)
pub fn set_active_delimiter(&mut self, delimiter: Option<Delimiter>)
Set the active delimiter for tokenizing array elements.
Sourcepub fn current_position(&self) -> (usize, usize)
pub fn current_position(&self) -> (usize, usize)
Get the current position (line, column).
pub fn get_line(&self) -> usize
pub fn get_column(&self) -> usize
pub fn peek(&self) -> Option<char>
pub fn count_leading_spaces(&self) -> usize
pub fn count_spaces_after_newline(&self) -> usize
pub fn peek_ahead(&self, offset: usize) -> Option<char>
pub fn advance(&mut self) -> Option<char>
pub fn skip_whitespace(&mut self)
Sourcepub fn scan_token(&mut self) -> ToonResult<Token>
pub fn scan_token(&mut self) -> ToonResult<Token>
Scan the next token from the input.
pub fn get_last_line_indent(&self) -> usize
Sourcepub fn detect_delimiter(&mut self) -> Option<Delimiter>
pub fn detect_delimiter(&mut self) -> Option<Delimiter>
Detect the delimiter used in the input by scanning ahead.
Auto Trait Implementations§
impl Freeze for Scanner
impl RefUnwindSafe for Scanner
impl Send for Scanner
impl Sync for Scanner
impl Unpin for Scanner
impl UnwindSafe for Scanner
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