temp commit
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
use std::borrow::Cow;
|
||||
use std::fmt::Display;
|
||||
use std::rc::Rc;
|
||||
|
||||
use futures::future::join_all;
|
||||
use orchid_api::Paren;
|
||||
use orchid_base::error::OrcErrv;
|
||||
use orchid_base::format::{FmtCtx, FmtUnit, Format, Variants};
|
||||
use orchid_base::interner::Tok;
|
||||
use orchid_base::location::Pos;
|
||||
use orchid_base::name::Sym;
|
||||
use orchid_base::tl_cache;
|
||||
use orchid_base::tree::Ph;
|
||||
use orchid_extension::atom::{Atomic, MethodSetBuilder};
|
||||
use orchid_extension::atom::Atomic;
|
||||
use orchid_extension::atom_owned::{OwnedAtom, OwnedVariant};
|
||||
use orchid_extension::expr::Expr;
|
||||
|
||||
@@ -62,7 +62,7 @@ impl Format for MacTok {
|
||||
},
|
||||
[mtreev_fmt(body, c).await],
|
||||
),
|
||||
Self::Slot => format!("SLOT").into(),
|
||||
Self::Slot => "SLOT".into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -73,3 +73,26 @@ pub async fn mtreev_fmt<'b>(
|
||||
) -> FmtUnit {
|
||||
FmtUnit::sequence(" ", None, join_all(v.into_iter().map(|t| t.print(c))).await)
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Hash, PartialEq, Eq)]
|
||||
pub struct Ph {
|
||||
pub name: Tok<String>,
|
||||
pub kind: PhKind,
|
||||
}
|
||||
impl Display for Ph {
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||
match self.kind {
|
||||
PhKind::Scalar => write!(f, "${}", self.name),
|
||||
PhKind::Vector { at_least_one: false, priority: 0 } => write!(f, "..${}", self.name),
|
||||
PhKind::Vector { at_least_one: true, priority: 0 } => write!(f, "...${}", self.name),
|
||||
PhKind::Vector { at_least_one: false, priority } => write!(f, "..${}:{priority}", self.name),
|
||||
PhKind::Vector { at_least_one: true, priority } => write!(f, "...${}:{priority}", self.name),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
|
||||
pub enum PhKind {
|
||||
Scalar,
|
||||
Vector { at_least_one: bool, priority: u8 },
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user