partway through fixes, macro system needs resdesign
Some checks failed
Rust / build (push) Has been cancelled
Some checks failed
Rust / build (push) Has been cancelled
This commit is contained in:
@@ -5,7 +5,6 @@ use orchid_extension::tree::{GenMember, fun, prefix};
|
||||
use orchid_extension::{Expr, TAtom, ToExpr, exec};
|
||||
|
||||
use crate::macros::match_macros::MatcherAtom;
|
||||
use crate::macros::resolve::resolve;
|
||||
use crate::macros::utils::{build_macro, mactree, mactreev};
|
||||
use crate::{OrcOpt, Tpl};
|
||||
|
||||
@@ -26,19 +25,16 @@ pub async fn gen_option_macro_lib() -> Vec<GenMember> {
|
||||
),
|
||||
build_macro(None, ["some", "none"])
|
||||
.rule(mactreev!(pattern::match_rule ( std::option::some "...$" sub_pattern 0)), [
|
||||
|[sub]: [_; _]| {
|
||||
exec(async move |mut h| {
|
||||
let sub = h
|
||||
.exec::<TAtom<MatcherAtom>>(resolve(mactree!(pattern::match_rule "push" sub;)).await)
|
||||
.await?;
|
||||
Ok(new_atom(MatcherAtom {
|
||||
keys: sub.keys().collect().await,
|
||||
matcher: call(sym!(std::option::is_some_body), sub).await.create().await,
|
||||
}))
|
||||
})
|
||||
async |mut cx, [sub]| {
|
||||
let sub: TAtom<MatcherAtom> =
|
||||
cx.exec(cx.recur(mactree!(pattern::match_rule "push" sub;))).await?;
|
||||
Ok(new_atom(MatcherAtom {
|
||||
keys: sub.keys().collect().await,
|
||||
matcher: call(sym!(std::option::is_some_body), sub).await.create().await,
|
||||
}))
|
||||
},
|
||||
])
|
||||
.rule(mactreev!(pattern::match_rule(std::option::none)), [async |[]: [_; _]| {
|
||||
.rule(mactreev!(pattern::match_rule(std::option::none)), [async |_cx, []| {
|
||||
new_atom(MatcherAtom {
|
||||
keys: vec![],
|
||||
matcher: sym!(std::option::is_none_body).to_expr().await,
|
||||
|
||||
Reference in New Issue
Block a user