[][src]Struct ssexp::ParsingContext

pub struct ParsingContext<T: Iterator<Item = char>> { /* fields omitted */ }

Used in parsing process for getting chars and calling the parsers.

Implementations

impl<T: Iterator<Item = char>> ParsingContext<T>[src]

pub fn parse(&mut self, tokens: &mut Vec<Token>) -> Option<MacroHandle<'_, T>>[src]

Parses the next symbol and inserts it into a specified token list. Then a handle for the next macro call is returned.

pub fn set(
    &mut self,
    char: char,
    value: Option<impl Parser<T> + 'static>
) -> Option<Rc<dyn Parser<T>>>
[src]

Binds a new parser to a character and returns some previous, if there was one defined, else returns None

pub fn insert(
    &mut self,
    char: char,
    value: Option<Rc<dyn Parser<T>>>
) -> Option<Rc<dyn Parser<T>>>
[src]

Binds a new parser to a character and returns some previous, if there was one defined, else returns None

pub fn push(&mut self, map: MacroMap<T>)[src]

Replaces the current macro map with a new one.

pub fn pop(&mut self) -> Option<MacroMap<T>>[src]

Removes the current macro map and uses the most recent one.

Auto Trait Implementations

impl<T> !RefUnwindSafe for ParsingContext<T>

impl<T> !Send for ParsingContext<T>

impl<T> !Sync for ParsingContext<T>

impl<T> Unpin for ParsingContext<T> where
    T: Unpin

impl<T> !UnwindSafe for ParsingContext<T>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.