Phased out async-stream in pursuit of compile performance

This commit is contained in:
2025-09-04 15:01:53 +02:00
parent 088cb6a247
commit e339350505
26 changed files with 359 additions and 342 deletions

View File

@@ -18,7 +18,7 @@ use orchid_base::location::SrcRange;
use orchid_base::name::{NameLike, Sym, VName, VPath};
use orchid_base::parse::Comment;
use orchid_base::reqnot::{ReqNot, Requester};
use orchid_base::tree::ttv_from_api;
use orchid_base::tree::{recur, ttv_from_api};
use ordered_float::NotNan;
use substack::{Stackframe, Substack};
@@ -28,7 +28,9 @@ use crate::dealias::walk;
use crate::expr::{ExprParseCtx, ExprWillPanic};
use crate::expr_store::ExprStore;
use crate::extension::{Extension, WeakExtension};
use crate::parsed::{Item, ItemKind, ParsTokTree, ParsedMember, ParsedMemberKind, ParsedModule};
use crate::parsed::{
Item, ItemKind, ParsTok, ParsTokTree, ParsedMember, ParsedMemberKind, ParsedModule,
};
use crate::tree::Root;
#[derive(destructure)]
@@ -112,7 +114,13 @@ impl System {
let src_path = line.first().expect("cannot be empty").sr.path();
let line = join_all(line.into_iter().map(|t| async {
let mut expr_store = self.0.ext.exprs().clone();
t.into_api(&mut expr_store, &mut ExprWillPanic).await
let without_new_expr = recur(t, &|t, r| {
if let ParsTok::NewExpr(expr) = t.tok {
return ParsTok::Handle(expr).at(t.sr);
}
r(t)
});
without_new_expr.into_api(&mut expr_store, &mut ExprWillPanic).await
}))
.await;
let comments = comments.iter().map(Comment::to_api).collect_vec();