pub struct Parser { /* private fields */ }Expand description
Recursive descent parser for Harn.
Implementations§
Source§impl Parser
impl Parser
pub fn new(tokens: Vec<Token>) -> Self
Sourcepub fn parse(&mut self) -> Result<Vec<SNode>, ParserError>
pub fn parse(&mut self) -> Result<Vec<SNode>, ParserError>
Parse a complete .harn file. Reports multiple errors via recovery.
Sourcepub fn all_errors(&self) -> &[ParserError]
pub fn all_errors(&self) -> &[ParserError]
Return all accumulated parser errors (after parse() returns).
Sourcepub fn parse_single_expression(&mut self) -> Result<SNode, ParserError>
pub fn parse_single_expression(&mut self) -> Result<SNode, ParserError>
Parse a single expression (for string interpolation).
Auto Trait Implementations§
impl Freeze for Parser
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnsafeUnpin 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