aboutsummaryrefslogtreecommitdiffstats
path: root/src/run
diff options
context:
space:
mode:
authorJonas Maier <>2026-03-12 12:17:15 +0100
committerJonas Maier <>2026-03-12 12:17:15 +0100
commitad9572cc6e89634a4d029cc8d311bb51626c17c3 (patch)
tree944c79c7e627b54ab1bc4cbb793e64c9ebd708bd /src/run
parent8dea55071464739bd1b8ef33ed5c294183d4780a (diff)
downloadpish-ad9572cc6e89634a4d029cc8d311bb51626c17c3.tar.gz
start of better parsing for proper blocks
Diffstat (limited to 'src/run')
-rw-r--r--src/run/mod.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/run/mod.rs b/src/run/mod.rs
index 09051c5..751f557 100644
--- a/src/run/mod.rs
+++ b/src/run/mod.rs
@@ -210,13 +210,13 @@ impl Executor {
});
SpawnedCmd::Builtin(handle)
}
- CommandKind::Fun(ast) => {
+ CommandKind::Fun(body) => {
let mut this = self.clone();
this.args = Some(args);
let handle = wait::spawn(move || {
- let ast = ast.expand(&mut this)?;
- let cmd = this.execute(ast, stdin, stdout);
+ let body = body.expand(&mut this)?;
+ let cmd = this.execute(body, stdin, stdout);
this.exec_loop(cmd, &mut [])
});
@@ -290,7 +290,7 @@ impl Executor {
.lock()
.unwrap()
.funs
- .insert(fd.name.clone(), *fd.body.body);
+ .insert(fd.name.clone(), fd.body);
crate::export_fun::create_function_hook(self.se.clone(), &fd.name);
// TODO: very ugly to ad-hoc keep export stuff & session data in sync here
SpawnedCmd::Joined(Ok(()))
@@ -495,7 +495,7 @@ pub fn builtin_map() -> HashMap<BString, &'static dyn Builtin> {
#[derive(Clone)]
pub enum CommandKind {
Builtin(&'static dyn Builtin),
- Fun(Ast<PreExpansion>),
+ Fun(Block),
Path(PathBuf),
}