pub struct Parser { /* private fields */ }
Implementations
sourceimpl Parser
impl Parser
pub fn new(tokens: Vec<Token>) -> Parser
sourcepub fn statement(&mut self) -> ParserResult<Stmt>
pub fn statement(&mut self) -> ParserResult<Stmt>
statement -> exprStmt
| printStmt
| block
| ifStmt
| whileStmt
| forStmt
| breakStmt
| continueStmt
| returntmt ;
sourcepub fn program(&mut self) -> ParserResult<Vec<Stmt>>
pub fn program(&mut self) -> ParserResult<Vec<Stmt>>
program -> declaration* EOF
pub fn parse_str(src: &str) -> LoxResult<Vec<Stmt>>
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Parser
impl Send for Parser
impl Sync for Parser
impl Unpin for Parser
impl UnwindSafe for Parser
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more