pub struct Parser<'a> { /* private fields */ }Implementations§
Source§impl<'a> Parser<'a>
impl<'a> Parser<'a>
pub fn new(tokens: Vec<Token<'a>>) -> Self
pub fn parse(self) -> (SyntaxNode, Vec<Diagnostic>)
pub fn current(&self) -> SyntaxKind
pub fn nth(&self, n: usize) -> SyntaxKind
pub fn at(&self, kind: SyntaxKind) -> bool
pub fn at_set(&self, set: &TokenSet) -> bool
pub fn nth_at(&self, n: usize, kind: SyntaxKind) -> bool
pub fn eat(&mut self, kind: SyntaxKind) -> bool
pub fn assert(&mut self, kind: SyntaxKind)
pub fn bump(&mut self)
pub fn expect(&mut self, kind: SyntaxKind) -> bool
pub fn error(&mut self, expected: &[SyntaxKind])
pub fn error_and_recover( &mut self, expected: &[SyntaxKind], recovery: &TokenSet, )
pub fn eat_trivia(&mut self)
pub fn start(&mut self) -> Marker
Auto Trait Implementations§
impl<'a> Freeze for Parser<'a>
impl<'a> RefUnwindSafe for Parser<'a>
impl<'a> Send for Parser<'a>
impl<'a> Sync for Parser<'a>
impl<'a> Unpin for Parser<'a>
impl<'a> UnsafeUnpin for Parser<'a>
impl<'a> UnwindSafe for Parser<'a>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more