Added support for defining macros in Rust within the macro system
Also fixed a lot of bugs
This commit is contained in:
@@ -2,7 +2,7 @@ use orchid_api_derive::Coding;
|
||||
use orchid_base::error::OrcRes;
|
||||
use orchid_base::format::FmtUnit;
|
||||
use orchid_base::number::Numeric;
|
||||
use orchid_extension::atom::{AtomFactory, Atomic, AtomicFeatures, ToAtom, TypAtom};
|
||||
use orchid_extension::atom::{AtomFactory, Atomic, AtomicFeatures, ToAtom, TAtom};
|
||||
use orchid_extension::atom_thin::{ThinAtom, ThinVariant};
|
||||
use orchid_extension::conv::TryFromExpr;
|
||||
use orchid_extension::expr::Expr;
|
||||
@@ -21,7 +21,7 @@ impl ThinAtom for Int {
|
||||
}
|
||||
impl TryFromExpr for Int {
|
||||
async fn try_from_expr(expr: Expr) -> OrcRes<Self> {
|
||||
TypAtom::<Int>::try_from_expr(expr).await.map(|t| t.value)
|
||||
TAtom::<Int>::try_from_expr(expr).await.map(|t| t.value)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ impl TryFromExpr for Num {
|
||||
Ok(t) => return Ok(Num(Numeric::Int(t.0))),
|
||||
Err(e) => e,
|
||||
};
|
||||
match TypAtom::<Float>::try_from_expr(expr).await {
|
||||
match TAtom::<Float>::try_from_expr(expr).await {
|
||||
Ok(t) => Ok(Num(Numeric::Float(t.0))),
|
||||
Err(e2) => Err(e + e2),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user