partway towards commands

I got very confused and started mucking about with "spawn" when in fact all I needed was the "inline" extension type in orcx that allows the interpreter to expose custom constants.
This commit is contained in:
2026-03-13 16:48:42 +01:00
parent cdcca694c5
commit 09cfcb1839
146 changed files with 3582 additions and 2822 deletions

View File

@@ -1,8 +1,6 @@
use never::Never;
use orchid_base::name::Sym;
use orchid_base::reqnot::{Receipt, ReqHandle};
use orchid_base::sym;
use orchid_extension::atom::{AtomDynfo, AtomicFeatures};
use orchid_base::{Receipt, ReqHandle, Sym, sym};
use orchid_extension::{AtomOps, AtomicFeatures};
use orchid_extension::lexer::LexerObj;
use orchid_extension::other_system::SystemHandle;
use orchid_extension::parser::ParserObj;
@@ -34,20 +32,22 @@ impl SystemCtor for MacroSystem {
impl SystemCard for MacroSystem {
type Ctor = Self;
type Req = Never;
fn atoms() -> impl IntoIterator<Item = Option<Box<dyn AtomDynfo>>> {
fn atoms() -> impl IntoIterator<Item = Option<Box<dyn AtomOps>>> {
[
Some(InstantiateTplCall::dynfo()),
Some(MacTree::dynfo()),
Some(Macro::dynfo()),
Some(PhAtom::dynfo()),
Some(MacroBodyArgCollector::dynfo()),
Some(MatcherAtom::dynfo()),
Some(InstantiateTplCall::ops()),
Some(MacTree::ops()),
Some(Macro::ops()),
Some(PhAtom::ops()),
Some(MacroBodyArgCollector::ops()),
Some(MatcherAtom::ops()),
]
}
}
impl System for MacroSystem {
async fn request<'a>(_: Box<dyn ReqHandle<'a> + 'a>, req: Never) -> Receipt<'a> { match req {} }
async fn prelude() -> Vec<Sym> {
async fn request<'a>(&self, _: Box<dyn ReqHandle<'a> + 'a>, req: Never) -> Receipt<'a> {
match req {}
}
async fn prelude(&self) -> Vec<Sym> {
vec![
sym!(macros::common::+),
sym!(macros::common::*),
@@ -65,9 +65,9 @@ impl System for MacroSystem {
sym!(std::fn::[|>]),
]
}
fn lexers() -> Vec<LexerObj> { vec![&MacTreeLexer, &PhLexer] }
fn parsers() -> Vec<ParserObj> { vec![&LetLine, &MacroLine] }
async fn env() -> Vec<GenMember> {
fn lexers(&self) -> Vec<LexerObj> { vec![&MacTreeLexer, &PhLexer] }
fn parsers(&self) -> Vec<ParserObj> { vec![&LetLine, &MacroLine] }
async fn env(&self) -> Vec<GenMember> {
merge_trivial([gen_macro_lib().await, gen_std_macro_lib().await, gen_match_macro_lib().await])
}
}