Implemented syntax highlighting

This commit is contained in:
2026-02-18 02:00:45 -05:00
parent 87d465034a
commit 43b171fab1
21 changed files with 772 additions and 262 deletions

View File

@@ -85,7 +85,7 @@ pub fn unalias(node: Node, io_stack: &mut IoStack, job: &mut JobBldr) -> ShResul
write(stdout, alias_output.as_bytes())?; // Write it
} else {
for (arg, span) in argv {
flog!(DEBUG, arg);
log::debug!("{arg:?}");
if read_logic(|l| l.get_alias(&arg)).is_none() {
return Err(ShErr::full(
ShErrKind::SyntaxErr,

View File

@@ -32,7 +32,7 @@ pub fn flowctl(node: Node, kind: ShErrKind) -> ShResult<()> {
code = status;
}
flog!(DEBUG, code);
log::debug!("{code:?}");
let kind = match kind {
LoopContinue(_) => LoopContinue(code),

View File

@@ -16,10 +16,10 @@ pub const READ_OPTS: [OptSpec;7] = [
bitflags! {
pub struct ReadFlags: u32 {
const NO_ESCAPES = 0b000001;
const NO_ECHO = 0b000010;
const ARRAY = 0b000100;
const N_CHARS = 0b001000;
const TIMEOUT = 0b010000;
const NO_ECHO = 0b000010; // TODO: unused
const ARRAY = 0b000100; // TODO: unused
const N_CHARS = 0b001000; // TODO: unused
const TIMEOUT = 0b010000; // TODO: unused
}
}

View File

@@ -247,9 +247,9 @@ pub fn double_bracket_test(node: Node) -> ShResult<bool> {
let rhs = rhs.expand()?.get_words().join(" ");
conjunct_op = conjunct;
let test_op = operator.as_str().parse::<TestOp>()?;
flog!(DEBUG, lhs);
flog!(DEBUG, rhs);
flog!(DEBUG, test_op);
log::debug!("{lhs:?}");
log::debug!("{rhs:?}");
log::debug!("{test_op:?}");
match test_op {
TestOp::Unary(_) => {
return Err(ShErr::Full {
@@ -298,7 +298,7 @@ pub fn double_bracket_test(node: Node) -> ShResult<bool> {
}
}
};
flog!(DEBUG, last_result);
log::debug!("{last_result:?}");
if let Some(op) = conjunct_op {
match op {
@@ -316,6 +316,6 @@ pub fn double_bracket_test(node: Node) -> ShResult<bool> {
last_result = result;
}
}
flog!(DEBUG, last_result);
log::debug!("{last_result:?}");
Ok(last_result)
}