1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/// Helper macro to implement listeners opt loop. #[macro_export] macro_rules! code { ($codes:expr, $context:path) => {{ let mut t = Tokens::new(); for c in $codes { if let $context { .. } = c.context { t.append({ let mut t = Tokens::new(); for line in &c.lines { t.push(line.as_str()); } t }); } } t }}; }