properly implemented read builtin

fixed bugs related to redirections and compound commands

improved io routing logic
This commit is contained in:
2026-02-17 17:30:21 -05:00
parent 12f36283ca
commit 87d465034a
16 changed files with 499 additions and 170 deletions

View File

@@ -1150,6 +1150,7 @@ impl ParseStream {
let cond_node: CondNode;
let mut node_tks = vec![];
let mut redirs = vec![];
if (!self.check_keyword("while") && !self.check_keyword("until")) || !self.next_tk_is_some() {
return Ok(None);
@@ -1204,6 +1205,9 @@ impl ParseStream {
));
}
node_tks.push(self.next_tk().unwrap());
self.parse_redir(&mut redirs, &mut node_tks)?;
self.assert_separator(&mut node_tks)?;
cond_node = CondNode {
@@ -1216,7 +1220,7 @@ impl ParseStream {
cond_node,
},
flags: NdFlags::empty(),
redirs: vec![],
redirs,
tokens: node_tks,
};
Ok(Some(loop_node))