pub struct Lexer { /* private fields */ }Implementations§
Source§impl Lexer
impl Lexer
pub fn new(input: &str, source_type: &SourceType) -> Self
pub fn peek(&mut self) -> Result<&Token, Error>
pub fn peek_second(&mut self) -> Result<&Token, Error>
pub fn next_token(&mut self) -> Result<Token, Error>
Sourcepub fn next_logical_name(&mut self) -> Result<Token, Error>
pub fn next_logical_name(&mut self) -> Result<Token, Error>
Opaque spec / repo / registry name for name positions only.
If a normal peek already materialized a prefix token, rewind and rescan
so connectors (/, ., -) are absorbed into one TokenKind::LogicalName.
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