pub struct Parser<'a, I: Iterator<Item = Cursor> + Clone> { /* private fields */ }Implementations§
Source§impl<'a, I> Parser<'a, I>
impl<'a, I> Parser<'a, I>
Sourcepub fn new(bump: &'a Bump, source_text: &'a str, cursor_iter: I) -> Self
pub fn new(bump: &'a Bump, source_text: &'a str, cursor_iter: I) -> Self
Create a new parser with an iterator over cursors
pub fn with_features(self, features: Feature) -> Self
pub fn bump(&self) -> &'a Bump
pub fn enabled(&self, other: Feature) -> bool
pub fn is(&self, state: State) -> bool
pub fn set_state(&mut self, state: State) -> State
pub fn set_skip(&mut self, skip: KindSet) -> KindSet
pub fn set_stop(&mut self, stop: KindSet) -> KindSet
pub fn parse_entirely<T: Parse<'a> + ToCursors>( &mut self, ) -> ParserReturn<'a, T>
pub fn parse<T: Parse<'a>>(&mut self) -> Result<T>
pub fn peek<T: Peek<'a>>(&self) -> bool
pub fn parse_if_peek<T: Peek<'a> + Parse<'a>>(&mut self) -> Result<Option<T>>
pub fn try_parse<T: Parse<'a>>(&mut self) -> Result<T>
pub fn try_parse_if_peek<T: Peek<'a> + Parse<'a>>( &mut self, ) -> Result<Option<T>>
pub fn equals_atom(&self, c: Cursor, atom: &'static dyn DynAtomSet) -> bool
pub fn to_atom<A: AtomSet + PartialEq>(&self, c: Cursor) -> A
pub fn offset(&self) -> SourceOffset
pub fn at_end(&self) -> bool
pub fn rewind(&mut self, checkpoint: ParserCheckpoint<I>)
pub fn checkpoint(&self) -> ParserCheckpoint<I>
pub fn next_is_stop(&self) -> bool
pub fn peek_n(&self, n: u8) -> Cursor
pub fn to_source_cursor(&self, cursor: Cursor) -> SourceCursor<'a>
pub fn consume_trivia(&mut self) -> Vec<'a, Cursor>
pub fn next(&mut self) -> Cursor
Trait Implementations§
Auto Trait Implementations§
impl<'a, I> Freeze for Parser<'a, I>where
I: Freeze,
impl<'a, I> !RefUnwindSafe for Parser<'a, I>
impl<'a, I> !Send for Parser<'a, I>
impl<'a, I> !Sync for Parser<'a, I>
impl<'a, I> Unpin for Parser<'a, I>where
I: Unpin,
impl<'a, I> !UnwindSafe for Parser<'a, I>
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