Skip to main content

ParserState

Struct ParserState 

Source
pub struct ParserState<L: Lexer> {
    pub current: L::Token,
    /* private fields */
}

Fields§

§current: L::Token

Implementations§

Source§

impl<L: Lexer> ParserState<L>

Source

pub fn new(lexer: L) -> Result<Self>

Source

pub fn advance(&mut self) -> Result<()>

Source

pub fn advance_keep_current(&mut self) -> Result<L::Token>

Source

pub fn matches( &mut self, expected_tag: <L::Token as Token>::Tag, ) -> Result<bool>

Source

pub fn expect(&mut self, expected_tag: <L::Token as Token>::Tag) -> Result<()>

Source

pub fn expect_lexeme(&mut self, tag: <L::Token as Token>::Tag) -> Result<String>

Auto Trait Implementations§

§

impl<L> Freeze for ParserState<L>
where L: Freeze, <L as Lexer>::Token: Freeze,

§

impl<L> RefUnwindSafe for ParserState<L>

§

impl<L> Send for ParserState<L>
where L: Send, <L as Lexer>::Token: Send,

§

impl<L> Sync for ParserState<L>
where L: Sync, <L as Lexer>::Token: Sync,

§

impl<L> Unpin for ParserState<L>
where L: Unpin, <L as Lexer>::Token: Unpin,

§

impl<L> UnsafeUnpin for ParserState<L>
where L: UnsafeUnpin, <L as Lexer>::Token: UnsafeUnpin,

§

impl<L> UnwindSafe for ParserState<L>
where L: UnwindSafe, <L as Lexer>::Token: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.