pub struct Parser<'a> { /* private fields */ }Expand description
Parser for bash scripts.
Implementations§
Source§impl<'a> Parser<'a>
impl<'a> Parser<'a>
Sourcepub fn with_max_depth(input: &'a str, max_depth: usize) -> Self
pub fn with_max_depth(input: &'a str, max_depth: usize) -> Self
Create a new parser with a custom maximum AST depth.
Sourcepub fn with_fuel(input: &'a str, max_fuel: usize) -> Self
pub fn with_fuel(input: &'a str, max_fuel: usize) -> Self
Create a new parser with a custom fuel limit.
Sourcepub fn with_limits(input: &'a str, max_depth: usize, max_fuel: usize) -> Self
pub fn with_limits(input: &'a str, max_depth: usize, max_fuel: usize) -> Self
Create a new parser with custom depth and fuel limits.
THREAT[TM-DOS-022]: max_depth is clamped to HARD_MAX_AST_DEPTH (500)
to prevent stack overflow from misconfiguration. Even if the caller passes
max_depth = 1_000_000, the parser will cap it at 500.
Sourcepub fn current_span(&self) -> Span
pub fn current_span(&self) -> Span
Get the current token’s span.
Auto Trait Implementations§
impl<'a> Freeze for Parser<'a>
impl<'a> RefUnwindSafe for Parser<'a>
impl<'a> Send for Parser<'a>
impl<'a> Sync for Parser<'a>
impl<'a> Unpin for Parser<'a>
impl<'a> UnwindSafe for Parser<'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