summaryrefslogtreecommitdiffstats
path: root/src/parse/ast.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse/ast.rs')
-rw-r--r--src/parse/ast.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/parse/ast.rs b/src/parse/ast.rs
index bd177a4..e2d5840 100644
--- a/src/parse/ast.rs
+++ b/src/parse/ast.rs
@@ -155,8 +155,10 @@ impl Exe {
fn build_ast(pair: pest::iterators::Pair<Rule>) -> Self {
assert!(matches!(pair.as_rule(), Rule::subshell | Rule::exe));
if matches!(pair.as_rule(), Rule::subshell) {
- let commands = pair.into_inner().next().unwrap();
+ let mut iter = pair.into_inner();
+ let commands = iter.next().unwrap();
assert!(matches!(commands.as_rule(), Rule::commands));
+ let redirects = iter.map(Redirect::build_ast).collect();
return Self {
exe: Word {
parts: vec![WordPart::SingleQuoted(
@@ -177,7 +179,7 @@ impl Exe {
)],
},
],
- redirects: vec![],
+ redirects,
};
}
let mut iter = pair.into_inner();