From 183c8407dedb58cd5e503bcb3aa16d702597745e Mon Sep 17 00:00:00 2001 From: Jonathan Turner Date: Mon, 6 Apr 2020 10:30:54 -0700 Subject: [PATCH] fix nu variable. tweak shells (#1558) --- crates/nu-cli/src/commands/shells.rs | 4 ++-- crates/nu-cli/src/evaluate/evaluator.rs | 2 +- crates/nu-parser/src/parse.rs | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/nu-cli/src/commands/shells.rs b/crates/nu-cli/src/commands/shells.rs index 93d05b519..3521dbfb1 100644 --- a/crates/nu-cli/src/commands/shells.rs +++ b/crates/nu-cli/src/commands/shells.rs @@ -36,9 +36,9 @@ fn shells(args: CommandArgs, _registry: &CommandRegistry) -> Result Ok(scope.it.value.clone().into_value(tag)), hir::Variable::Other(_, span) => match span.slice(source) { - x if x == "nu" => crate::evaluate::variables::nu(tag), + x if x == "$nu" => crate::evaluate::variables::nu(tag), x => Ok(scope .vars .get(x) diff --git a/crates/nu-parser/src/parse.rs b/crates/nu-parser/src/parse.rs index 15fd03164..e5344829a 100644 --- a/crates/nu-parser/src/parse.rs +++ b/crates/nu-parser/src/parse.rs @@ -192,6 +192,7 @@ fn parse_full_column_path(lite_arg: &Spanned) -> (SpannedExpression, Opt if head.is_none() { if current_part.starts_with('$') { + // We have the variable head head = Some(Expression::variable(current_part, lite_arg.span)); } else if let Ok(row_number) = current_part.parse::() { output.push(