Implemented arithmetic substitution

This commit is contained in:
2025-03-07 04:30:17 -05:00
parent 90243834ff
commit 2edb6cb8ce
11 changed files with 201 additions and 55 deletions

View File

@@ -8,11 +8,7 @@ pub fn alias(node: Node, shenv: &mut ShEnv) -> ShResult<()> {
while let Some(arg) = argv_iter.next() {
let arg_raw = shenv.input_slice(arg.span()).to_string();
if let Some((alias,body)) = arg_raw.split_once('=') {
log!(DEBUG, "{:?}",arg.span());
log!(DEBUG, arg_raw);
log!(DEBUG, body);
let clean_body = trim_quotes(&body);
log!(DEBUG, clean_body);
shenv.logic_mut().set_alias(alias, &clean_body);
} else {
return Err(ShErr::full(ShErrKind::SyntaxErr, "Expected an assignment in alias args", shenv.get_input(), arg.span().clone()))