pub struct Parser<'a> { /* private fields */ }
Implementations§
Source§impl<'a> Parser<'a>
impl<'a> Parser<'a>
Sourcepub fn new(
bump: &'a Bump,
atoms: &'static dyn DynAtomSet,
source_text: &'a str,
) -> Self
pub fn new( bump: &'a Bump, atoms: &'static dyn DynAtomSet, source_text: &'a str, ) -> Self
Create a new parser
pub fn with_features(self, features: Feature) -> Self
pub fn new_with_features( bump: &'a Bump, atoms: &'static dyn DynAtomSet, source_text: &'a str, 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)
pub fn checkpoint(&self) -> ParserCheckpoint
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> 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> !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