Crafting a Lox Interpreter in Rust, Part 1
diegofreijo.com
diegofreijo.com
macro_rules! T {
(+) => { Token::Add },
(-) => { Token::Sub },
// ...
}
This is really nice because it lets you match against tokens with `T![+]` instead of `Token::Add`.