exec working up to halt

clean shutdown doesn't for some reason
This commit is contained in:
2025-09-09 16:30:49 +02:00
parent e339350505
commit ce08021e79
36 changed files with 460 additions and 399 deletions

View File

@@ -6,7 +6,6 @@ use std::{fmt, mem};
use async_lock::RwLock;
use futures::FutureExt;
use hashbrown::HashSet;
use itertools::Itertools;
use orchid_base::error::OrcErrv;
use orchid_base::format::{FmtCtx, FmtUnit, Format, Variants};
@@ -116,19 +115,18 @@ impl Expr {
}
impl Format for Expr {
async fn print<'a>(&'a self, c: &'a (impl FmtCtx + ?Sized + 'a)) -> FmtUnit {
return print_expr(self, c, &mut HashSet::new()).await;
return print_expr(self, c, Substack::Bottom).await;
}
}
async fn print_expr<'a>(
expr: &'a Expr,
c: &'a (impl FmtCtx + ?Sized + 'a),
visited: &mut HashSet<api::ExprTicket>,
visited: Substack<'_, api::ExprTicket>,
) -> FmtUnit {
if visited.contains(&expr.id()) {
if visited.iter().any(|id| id == &expr.id()) {
return "CYCLIC_EXPR".to_string().into();
}
visited.insert(expr.id());
print_exprkind(&*expr.kind().read().await, c, visited).boxed_local().await
print_exprkind(&*expr.kind().read().await, c, visited.push(expr.id())).boxed_local().await
}
#[derive(Clone, Debug)]
@@ -152,13 +150,13 @@ impl ExprKind {
}
impl Format for ExprKind {
async fn print<'a>(&'a self, c: &'a (impl FmtCtx + ?Sized + 'a)) -> FmtUnit {
print_exprkind(self, c, &mut HashSet::new()).await
print_exprkind(self, c, Substack::Bottom).await
}
}
async fn print_exprkind<'a>(
ek: &ExprKind,
c: &'a (impl FmtCtx + ?Sized + 'a),
visited: &mut HashSet<api::ExprTicket>,
visited: Substack<'_, api::ExprTicket>,
) -> FmtUnit {
match &ek {
ExprKind::Arg => "Arg".to_string().into(),