pub struct Parser<R: BufRead> { /* private fields */ }Expand description
Implements parsing for shell programs.
Implementations§
Source§impl<R: BufRead> Parser<R>
impl<R: BufRead> Parser<R>
Sourcepub fn new(reader: R, options: &ParserOptions) -> Self
pub fn new(reader: R, options: &ParserOptions) -> Self
§Arguments
reader- The reader to use for input.options- The options to use when parsing.
Sourcepub fn parse_program(&mut self) -> Result<Program, ParseError>
pub fn parse_program(&mut self) -> Result<Program, ParseError>
Parses the input into an abstract syntax tree (AST) of a shell program.
Sourcepub fn parse_function_parens_and_body(
&mut self,
) -> Result<FunctionBody, ParseError>
pub fn parse_function_parens_and_body( &mut self, ) -> Result<FunctionBody, ParseError>
Parses a function definition body from the input. The body is expected to be preceded by “()”, but no function name.
Sourcepub fn builder() -> ParserBuilder<R>
pub fn builder() -> ParserBuilder<R>
Create a new parser instance through a builder
Auto Trait Implementations§
impl<R> Freeze for Parser<R>where
R: Freeze,
impl<R> RefUnwindSafe for Parser<R>where
R: RefUnwindSafe,
impl<R> Send for Parser<R>where
R: Send,
impl<R> Sync for Parser<R>where
R: Sync,
impl<R> Unpin for Parser<R>where
R: Unpin,
impl<R> UnsafeUnpin for Parser<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for Parser<R>where
R: UnwindSafe,
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