pub struct Lexer<'a> { /* private fields */ }Expand description
Lexer for bash scripts.
Implementations§
Source§impl<'a> Lexer<'a>
impl<'a> Lexer<'a>
Sourcepub fn with_max_subst_depth(input: &'a str, max_depth: usize) -> Self
pub fn with_max_subst_depth(input: &'a str, max_depth: usize) -> Self
Create a new lexer with a custom max substitution nesting depth. Limits recursion in read_command_subst_into().
Sourcepub fn with_profile(input: &'a str, shell_profile: &ShellProfile) -> Self
pub fn with_profile(input: &'a str, shell_profile: &ShellProfile) -> Self
Create a new lexer using the provided shell profile.
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 without decoding or materializing any payload text.
Sourcepub fn next_lexed_token(&mut self) -> Option<LexedToken<'a>>
pub fn next_lexed_token(&mut self) -> Option<LexedToken<'a>>
Get the next source-backed token from the input, skipping line comments.
Sourcepub fn next_lexed_token_with_comments(&mut self) -> Option<LexedToken<'a>>
pub fn next_lexed_token_with_comments(&mut self) -> Option<LexedToken<'a>>
Get the next source-backed token from the input, preserving line comments.
Sourcepub fn read_heredoc(&mut self, delimiter: &str, strip_tabs: bool) -> HeredocRead
pub fn read_heredoc(&mut self, delimiter: &str, strip_tabs: bool) -> HeredocRead
Read here document content until the delimiter line is found
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