pub(super) struct Lexer<'a> {
chars: CharIndices<'a>,
position: Position,
done: bool,
max_integer: BigInt,
}Fields§
§chars: CharIndices<'a>§position: Position§done: bool§max_integer: BigIntImplementations§
Source§impl<'a> Lexer<'a>
impl<'a> Lexer<'a>
pub(super) fn new(src: &'a str) -> Self
pub(super) fn next_token(&mut self) -> Result<SpannedToken, LexerError>
fn eat_word(&mut self, initial_char: char) -> Result<SpannedToken, LexerError>
fn lex_word(&mut self, initial_char: char) -> (Position, String, Position)
fn lookup_word_token( &self, word: String, start: Position, end: Position, ) -> Result<SpannedToken, LexerError>
fn eat_integer(&mut self, first_char: char) -> Result<SpannedToken, LexerError>
fn eat_while<F: Fn(char) -> bool>( &mut self, initial_char: Option<char>, predicate: F, ) -> String
fn single_char_token(&self, token: Token) -> Result<SpannedToken, LexerError>
fn next_char(&mut self) -> Option<char>
fn peek_char(&self) -> Option<char>
Auto Trait Implementations§
impl<'a> Freeze for Lexer<'a>
impl<'a> RefUnwindSafe for Lexer<'a>
impl<'a> Send for Lexer<'a>
impl<'a> Sync for Lexer<'a>
impl<'a> Unpin for Lexer<'a>
impl<'a> UnwindSafe for Lexer<'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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more