pub struct Parser<'ctx> { /* private fields */ }Implementations§
Source§impl<'ctx> Parser<'ctx>
impl<'ctx> Parser<'ctx>
pub fn new(ctx: &'ctx mut BuildCtx, tokens: Vec<Token>) -> Self
pub fn make_tree(&mut self) -> Vec<Node>
pub fn open(&mut self) -> OpenHandle
pub fn close(&mut self, handle: OpenHandle, new_kind: TreeKind) -> CloseHandle
pub fn open_before(&mut self, handle: CloseHandle) -> OpenHandle
pub fn wrap(&mut self, handle: CloseHandle, kind: TreeKind) -> CloseHandle
pub fn peek_kind<'inp: 'out, 'out>(&'inp mut self) -> Option<&'out TokenKind>
pub fn peek(&mut self) -> Tt
Sourcepub fn nth_raw(&mut self, ofs: usize) -> Option<Tt>
pub fn nth_raw(&mut self, ofs: usize) -> Option<Tt>
Get token kind ofs tokens from cursor
This does not skip non-significant tokens!
pub fn nth(&mut self, ofs: usize) -> Tt
pub fn nth_is(&mut self, ofs: usize, ty: impl Into<Tt>) -> bool
pub fn advance(&mut self)
pub fn eof(&self) -> bool
pub fn at(&mut self, ty: impl Into<Tt>) -> bool
pub fn at_set(&mut self, tys: &TtSet) -> bool
pub fn at_id(&mut self, str: &str) -> bool
pub fn eof_or(&mut self, ty: impl Into<Tt>) -> bool
pub fn eat(&mut self, ty: impl Into<Tt>) -> bool
pub fn advance_error(&mut self, message: impl Into<String>) -> CloseHandle
pub fn error_empty(&mut self, message: impl Into<String>) -> CloseHandle
pub fn error(&mut self, message: impl Into<String>)
pub fn expect(&mut self, ty: impl Into<Tt>)
pub fn assert(&mut self, ty: impl Into<Tt>)
pub fn kind_of(&self, handle: CloseHandle) -> TreeKind
Auto Trait Implementations§
impl<'ctx> !Freeze for Parser<'ctx>
impl<'ctx> !RefUnwindSafe for Parser<'ctx>
impl<'ctx> !Sync for Parser<'ctx>
impl<'ctx> !UnwindSafe for Parser<'ctx>
impl<'ctx> Send for Parser<'ctx>
impl<'ctx> Unpin for Parser<'ctx>
impl<'ctx> UnsafeUnpin for Parser<'ctx>
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