Added support for defining macros in Rust within the macro system

Also fixed a lot of bugs
This commit is contained in:
2025-09-30 21:23:16 +02:00
parent 7971a2b4eb
commit b77653f841
52 changed files with 849 additions and 502 deletions

View File

@@ -4,8 +4,8 @@ use std::num::NonZeroU64;
use std::rc::{Rc, Weak};
use std::{fmt, mem};
use async_lock::RwLock;
use futures::FutureExt;
use futures_locks::RwLock;
use itertools::Itertools;
use orchid_base::error::OrcErrv;
use orchid_base::format::{FmtCtx, FmtUnit, Format, Variants};
@@ -41,9 +41,9 @@ impl Expr {
pub async fn try_into_owned_atom(self) -> Result<AtomHand, Self> {
match Rc::try_unwrap(self.0) {
Err(e) => Err(Self(e)),
Ok(data) => match data.kind.into_inner() {
Ok(data) => match data.kind.try_unwrap().expect("This fields shouldn't be copied") {
ExprKind::Atom(a) => Ok(a),
inner => Err(Self(Rc::new(ExprData { kind: inner.into(), pos: data.pos }))),
inner => Err(Self(Rc::new(ExprData { kind: RwLock::new(inner), pos: data.pos }))),
},
}
}