pub struct Parser<R> { /* 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, source_info: &SourceInfo) -> Self
pub fn new(reader: R, options: &ParserOptions, source_info: &SourceInfo) -> Self
Returns a new parser instance.
§Arguments
reader
- The reader to use for input.options
- The options to use when parsing.source_info
- Information about the source of the tokens.
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.
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> 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