15 lines
427 B
Rust
15 lines
427 B
Rust
use orchid_extension::tree::{GenMember, prefix};
|
|
|
|
use crate::macros::utils::{build_macro, mactree, mactreev};
|
|
|
|
pub async fn gen_functional_macro_lib() -> Vec<GenMember> {
|
|
prefix("std::fn", [build_macro(Some(4), ["|>"])
|
|
.rule(
|
|
mactreev!("...$" lhs 0 "std::fn::|>" "$" fun "...$" rhs 0),
|
|
async |mut cx, [lhs, fun, rhs]| {
|
|
Ok(cx.recur(mactree!("push" fun ; "push" lhs ; "pushv" rhs)).await)
|
|
},
|
|
)
|
|
.finish()])
|
|
}
|