pub trait Lexer<'a> {
type Token: Eq;
type Position: Clone + Hash + Eq + PartialOrd;
// Required methods
fn new(input: &'a str) -> Self;
fn lexeme(&self) -> &str;
fn span(&self) -> Span;
fn pos(&self) -> &Self::Position;
fn next(&mut self) -> Option<Self::Token>;
fn is_empty(&self) -> bool;
fn advance_to_pos(&mut self, pos: &Self::Position);
fn fork(&self) -> Self;
}Expand description
A lexer for the parser.
Required Associated Types§
Required Methods§
Sourcefn advance_to_pos(&mut self, pos: &Self::Position)
fn advance_to_pos(&mut self, pos: &Self::Position)
Advance the lexer to the given lexeme.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.