use std::borrow::Cow; use std::rc::Rc; use never::Never; use orchid_base::interner::Tok; use orchid_base::name::Sym; use orchid_extension::atom::Atomic; use orchid_extension::atom_owned::{OwnedAtom, OwnedVariant}; use crate::macros::mactree::MacTreeSeq; use crate::macros::rule::matcher::Matcher; #[derive(Debug)] pub struct MacroData { pub canonical_name: Sym, pub module: Sym, pub prio: Option, pub rules: Vec, } #[derive(Clone, Debug)] pub struct Macro(pub Rc); #[derive(Debug)] pub struct Rule { pub pattern: MacTreeSeq, pub matcher: Matcher, pub ph_names: Vec>, pub body: Tok, } impl Atomic for Macro { type Data = (); type Variant = OwnedVariant; } impl OwnedAtom for Macro { type Refs = Never; async fn val(&self) -> Cow<'_, Self::Data> { Cow::Owned(()) } }