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

@@ -1330,6 +1330,15 @@ impl VarTab {
.get(&ShellParam::Status)
.map(|s| s.to_string())
.unwrap_or("0".into()),
ShellParam::AllArgsStr => {
let ifs = get_separator();
self
.params
.get(&ShellParam::AllArgs)
.map(|s| s.replace(markers::ARG_SEP, &ifs).to_string())
.unwrap_or_default()
}
_ => self
.params
.get(&param)
@@ -1842,6 +1851,15 @@ pub fn change_dir<P: AsRef<Path>>(dir: P) -> ShResult<()> {
Ok(())
}
pub fn get_separator() -> String {
env::var("IFS")
.unwrap_or(String::from(" "))
.chars()
.next()
.unwrap()
.to_string()
}
pub fn get_status() -> i32 {
read_vars(|v| v.get_param(ShellParam::Status))
.parse::<i32>()