fixed heredocs using the same expansion pathway as regular strings

implemented backtick command subs

deferred heredoc expansion until redir time instead of parse time

implemented "$*" expansions

function defs like 'func   ()  { }' now parse correctly

fixed conjunctions short circuiting instead of skipping
This commit is contained in:
2026-03-15 00:01:33 -04:00
parent 9bd9c66b92
commit 101d8434f8
8 changed files with 278 additions and 84 deletions

View File

@@ -875,6 +875,16 @@ impl LexStream {
));
}
}
'(' if can_be_subshell && chars.peek() == Some(&')') => {
// standalone "()" — function definition marker
pos += 2;
chars.next();
let mut tk = self.get_token(self.cursor..pos, TkRule::Str);
tk.mark(TkFlags::KEYWORD);
self.cursor = pos;
self.set_next_is_cmd(true);
return Ok(tk);
}
'(' if self.next_is_cmd() && can_be_subshell => {
pos += 1;
let mut paren_count = 1;