forked from extern/nushell
remove the $nothing
variable (#10567)
related to - https://github.com/nushell/nushell/pull/10478 # Description this PR is the followup removal to https://github.com/nushell/nushell/pull/10478. # User-Facing Changes `$nothing` is now an undefined variable, unless define by the user. ```nushell > $nothing Error: nu::parser::variable_not_found × Variable not found. ╭─[entry #1:1:1] 1 │ $nothing · ────┬─── · ╰── variable not found. ╰──── ``` # Tests + Formatting # After Submitting mention that in release notes
This commit is contained in:
@ -3043,7 +3043,7 @@ pub fn parse_let(working_set: &mut StateWorkingSet, spans: &[Span]) -> Pipeline
|
||||
.trim_start_matches('$')
|
||||
.to_string();
|
||||
|
||||
if ["in", "nu", "env", "nothing"].contains(&var_name.as_str()) {
|
||||
if ["in", "nu", "env"].contains(&var_name.as_str()) {
|
||||
working_set.error(ParseError::NameIsBuiltinVar(var_name, lvalue.span))
|
||||
}
|
||||
|
||||
@ -3151,7 +3151,7 @@ pub fn parse_const(working_set: &mut StateWorkingSet, spans: &[Span]) -> Pipelin
|
||||
.to_string();
|
||||
|
||||
// TODO: Remove the hard-coded variables, too error-prone
|
||||
if ["in", "nu", "env", "nothing"].contains(&var_name.as_str()) {
|
||||
if ["in", "nu", "env"].contains(&var_name.as_str()) {
|
||||
working_set.error(ParseError::NameIsBuiltinVar(var_name, lvalue.span))
|
||||
}
|
||||
|
||||
@ -3292,7 +3292,7 @@ pub fn parse_mut(working_set: &mut StateWorkingSet, spans: &[Span]) -> Pipeline
|
||||
.trim_start_matches('$')
|
||||
.to_string();
|
||||
|
||||
if ["in", "nu", "env", "nothing"].contains(&var_name.as_str()) {
|
||||
if ["in", "nu", "env"].contains(&var_name.as_str()) {
|
||||
working_set.error(ParseError::NameIsBuiltinVar(var_name, lvalue.span))
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user