pub struct Parser { /* private fields */ }Implementations§
Source§impl Parser
impl Parser
pub fn new(tokens: Vec<Token>) -> Self
pub fn errors(&self) -> &[ParseError]
pub fn parse_program( &mut self, directives: Vec<Directive>, ) -> Result<Program, ParseError>
Sourcepub fn parse_program_with_recovery(
&mut self,
directives: Vec<Directive>,
) -> (Program, Vec<ParseError>)
pub fn parse_program_with_recovery( &mut self, directives: Vec<Directive>, ) -> (Program, Vec<ParseError>)
Parse a program with error recovery enabled. Returns the program AST (possibly partial) and a vector of all parse errors encountered. If no errors occurred, the vector will be empty.
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnwindSafe for Parser
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