pub struct Lexer<'a> { /* private fields */ }Expand description
Source-backed lexer for shell scripts.
The public lexer surface is intended for lower-level tooling and benchmarks. It tokenizes using the default bash profile; use the parser constructors when dialect or zsh option state matters.
Implementations§
Source§impl<'a> Lexer<'a>
impl<'a> Lexer<'a>
Sourcepub fn next_token_kind(&mut self) -> Option<TokenKind>
pub fn next_token_kind(&mut self) -> Option<TokenKind>
Get the next token kind from the input.
This skips whitespace and line comments, matching
Lexer::next_lexed_token. It is useful for callers that only need the
token stream shape.
Sourcepub fn next_lexed_token(&mut self) -> Option<LexedToken<'a>>
pub fn next_lexed_token(&mut self) -> Option<LexedToken<'a>>
Trait Implementations§
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> UnsafeUnpin 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