From 4cf6bd6fb03b9abf4817d2270e9b05f55b98e5ad Mon Sep 17 00:00:00 2001 From: Devyn Cairns Date: Fri, 5 Jul 2024 05:41:08 -0700 Subject: [PATCH] fix overlay by handling keyword expression as just the inner expression --- crates/nu-engine/src/compile/expression.rs | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/crates/nu-engine/src/compile/expression.rs b/crates/nu-engine/src/compile/expression.rs index 91bbf3fbf6..7a39bd4053 100644 --- a/crates/nu-engine/src/compile/expression.rs +++ b/crates/nu-engine/src/compile/expression.rs @@ -366,7 +366,18 @@ pub(crate) fn compile_expression( } Ok(()) } - Expr::Keyword(_) => Err(unexpected("Keyword")), + Expr::Keyword(kw) => { + // keyword: just pass through expr, since commands that use it and are not being + // specially handled already are often just positional anyway + compile_expression( + working_set, + builder, + &kw.expr, + redirect_modes, + in_reg, + out_reg, + ) + } Expr::ValueWithUnit(value_with_unit) => { lit(builder, literal_from_value_with_unit(value_with_unit)?) }