impl_lexer_token_from

Macro impl_lexer_token_from 

Source
macro_rules! impl_lexer_token_from {
    ($name:ident; $( $token_type:ty ),+ $(,)? ) => { ... };
}
Expand description

Macro to implement a token recognizer for a given set of token types.

This macro generates a token recognizer struct that can be used to tokenize source code.

ยงExample

impl_lexer_token_from!(MathLexer;  // recognizer for math tokens
   MathOp,
   Real,
   // any other token types (dyn Token)...
);