Trait sixtyfps_compilerlib::lexer::LexingRule[][src]

pub trait LexingRule {
    fn lex(&self, text: &str, state: &mut LexState) -> usize;
}

This trait is used by the crate::parser::lex_next_token function and is implemented for rule passed to the macro which can be either a string literal, or a function

Required methods

fn lex(&self, text: &str, state: &mut LexState) -> usize[src]

Return the size of the match for this rule, or 0 if there is no match

Loading content...

Implementations on Foreign Types

impl<'a> LexingRule for &'a str[src]

Loading content...

Implementors

impl<F: Fn(&str, &mut LexState) -> usize> LexingRule for F[src]

Loading content...