forked from Orchid/orchid
Pattern matching works now
This commit is contained in:
@@ -144,7 +144,7 @@ impl Parser for MacroLine {
|
||||
let mac_cell = Rc::new(OnceCell::new());
|
||||
let rules = Rc::new(RefCell::new(Some(rules)));
|
||||
for (kw, sr) in &*keywords {
|
||||
clone!(mac_cell, rules, module, prio);
|
||||
clone!(mac_cell, rules, module, macro_name, prio);
|
||||
lines.push(ParsedLine::cnst(&sr.clone(), &comments, true, kw.clone(), async move |cctx| {
|
||||
let mac = mac_cell
|
||||
.get_or_init(async {
|
||||
@@ -170,7 +170,12 @@ impl Parser for MacroLine {
|
||||
.flat_map(stream::iter)
|
||||
.collect::<Vec<_>>()
|
||||
.await;
|
||||
Macro(Rc::new(MacroData { module, prio: prio.map(|i| i.0 as u64), rules }))
|
||||
Macro(Rc::new(MacroData {
|
||||
canonical_name: module.suffix([macro_name], &i()).await,
|
||||
module,
|
||||
prio: prio.map(|i| i.0 as u64),
|
||||
rules,
|
||||
}))
|
||||
})
|
||||
.await;
|
||||
atom(mac.clone())
|
||||
|
||||
Reference in New Issue
Block a user