use rustc_hash::FxHashMap; use smol_str::SmolStr; use crate::{mbe, tt}; pub fn exapnd(rules: &mbe::MacroRules, input: &tt::Subtree) -> Option { rules.rules.iter().find_map(|it| expand_rule(it, input)) } fn expand_rule(rule: &mbe::Rule, input: &tt::Subtree) -> Option { let bindings = match_lhs(&rule.lhs, input)?; expand_rhs(&rule.rhs, &bindings) } #[derive(Debug, Default)] struct Bindings { inner: FxHashMap, } fn match_lhs(pattern: &mbe::Subtree, input: &tt::Subtree) -> Option { Some(Bindings::default()) } fn expand_rhs(template: &mbe::Subtree, bindings: &Bindings) -> Option { None }