Trait Matcher

Source
pub trait Matcher<K> {
    // Required method
    fn try_match(
        &self,
        first_char: char,
        input: &mut BufferedInput<'_>,
    ) -> MatchResult<K>;
}
Expand description

A matcher fn matches a character (and and any following characters) and returns a T to indicate the kind of token (see Token)

input is always fresh (i.e. its buffer is empty)

Required Methods§

Source

fn try_match( &self, first_char: char, input: &mut BufferedInput<'_>, ) -> MatchResult<K>

Implementors§

Source§

impl<F, K> Matcher<K> for F
where F: Fn(char, &mut BufferedInput<'_>) -> MatchResult<K>,