pub trait Lexer<'a> {
type Token: Copy + Eq;
type Position: Copy + Eq + Ord + Hash;
// Required methods
fn new(input: &'a str) -> Self;
fn pos(&self) -> Self::Position;
fn next(&self) -> (Option<Self::Token>, usize);
fn is_empty(&self) -> bool;
fn advance_to_pos(&self, pos: Self::Position);
fn fork(&self) -> Self;
}Expand description
A lexer for the parser.
Required Associated Types§
Required Methods§
Sourcefn advance_to_pos(&self, pos: Self::Position)
fn advance_to_pos(&self, pos: Self::Position)
Advance the lexer to the given position.
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.