pub struct Lexer { /* private fields */ }Implementations§
Source§impl Lexer
impl Lexer
pub fn new(input: &str, source_type: &SourceType) -> Self
pub fn source_text(&self) -> Arc<str>
pub fn source_type(&self) -> SourceType
pub fn peek(&mut self) -> Result<&Token, Error>
pub fn peek_second(&mut self) -> Result<&Token, Error>
Sourcepub fn current_span(&self) -> Span
pub fn current_span(&self) -> Span
Current raw position as a Span. Does not trigger tokenization.
pub fn next_token(&mut self) -> Result<Token, Error>
Sourcepub fn checkpoint(&self) -> LexerCheckpoint
pub fn checkpoint(&self) -> LexerCheckpoint
Saved lexer position for speculative parsing.
pub fn restore(&mut self, checkpoint: LexerCheckpoint)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Lexer
impl RefUnwindSafe for Lexer
impl Send for Lexer
impl Sync for Lexer
impl Unpin for Lexer
impl UnsafeUnpin for Lexer
impl UnwindSafe for Lexer
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