RA leaks memory in code-server, switching back to desktop
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use futures::future::LocalBoxFuture;
|
||||
use hashbrown::HashMap;
|
||||
use itertools::Itertools;
|
||||
use orchid_base::error::{OrcRes, mk_errv};
|
||||
use orchid_base::interner::Tok;
|
||||
@@ -10,6 +11,8 @@ use orchid_extension::parser::{
|
||||
};
|
||||
use substack::Substack;
|
||||
|
||||
use crate::macros::mactree::{MacTok, MacTree, map_mactree, map_mactree_v};
|
||||
|
||||
type ExprGenerator =
|
||||
Box<dyn for<'a> FnOnce(ConstCtx, Substack<'a, Sym>) -> LocalBoxFuture<'a, GExpr>>;
|
||||
|
||||
@@ -31,29 +34,36 @@ impl Parser for LetLine {
|
||||
return Err(err.await);
|
||||
};
|
||||
let Parsed { tail, .. } = expect_tok(&ctx, tail, ctx.i().i("=").await).await?;
|
||||
fn do_tokv(line: GenSnippet<'_>) -> ExprGenerator {
|
||||
let first: ExprGenerator = if let Some((idx, arg)) =
|
||||
fn parse_tokv(line: GenSnippet<'_>) -> Vec<MacTree> {
|
||||
let first: MacTree = if let Some((idx, arg)) =
|
||||
line.iter().enumerate().find_map(|(i, x)| Some((i, x.as_lambda()?)))
|
||||
{
|
||||
Box::new(move |ctx, stack| Box::pin(async move {
|
||||
let name = ctx.names([])
|
||||
}))
|
||||
} else {
|
||||
|
||||
};
|
||||
todo!()
|
||||
}
|
||||
let expr_generator = do_tokv(tail);
|
||||
let mut names = HashMap::new();
|
||||
let aliased = parse_tokv(tail);
|
||||
map_mactree_v(&aliased, &mut false, &mut |tpl| {
|
||||
if let MacTok::Name(n) = &*tpl.tok {
|
||||
names.insert(n.clone(), n);
|
||||
}
|
||||
None
|
||||
});
|
||||
Ok(vec![ParsedLine {
|
||||
comments,
|
||||
sr: line.sr(),
|
||||
kind: ParsedLineKind::Mem(ParsedMem {
|
||||
exported,
|
||||
name,
|
||||
kind: ParsedMemKind::cnst(async |ctx| expr_generator(ctx, Substack::Bottom).await),
|
||||
kind: ParsedMemKind::cnst(async |ctx| {
|
||||
let mut names_str = ctx.names(names.keys());
|
||||
while let Some(()) = names_str.next().await {
|
||||
names[]
|
||||
}
|
||||
todo!()
|
||||
}),
|
||||
}),
|
||||
}])
|
||||
}
|
||||
}
|
||||
|
||||
fn update_names(tree: MacTree)
|
||||
Reference in New Issue
Block a user