This commit is contained in:
JT
2021-10-26 10:14:21 +13:00
parent d29208dd9e
commit 85a69c0a45
14 changed files with 151 additions and 120 deletions

View File

@ -40,11 +40,11 @@ impl Stack {
let mut output = Stack::new();
for capture in captures {
output.vars.insert(
*capture,
self.get_var(*capture)
.expect("internal error: capture of missing variable"),
);
// Note: this assumes we have calculated captures correctly and that commands
// that take in a var decl will manually set this into scope when running the blocks
if let Ok(value) = self.get_var(*capture) {
output.vars.insert(*capture, value);
}
}
output