nushell/crates/nu-protocol/src/engine
Antoine Stevan 6c026242d4
remove the $nothing variable (#10478)
related to 
- https://github.com/nushell/nushell/pull/9973
- https://github.com/nushell/nushell/pull/9918

thanks to @jntrnr and their super useful tips on this PR, i learned
about the parser + evaluation, so 🙏

# Description
because we already have `null` as the value of the type `nothing` and as
a followup to the two other attempts of mine, i propose to remove the
redundant `$nothing` built-in variable 😋

this PR is the first step, deprecating `$nothing`.
a followup PR will remove it altogether and wait for 0.87 👍 

⚙️ **details**: a new `NOTHING_VARIABLE_ID = 3` has been added,
parsing `$nothing` will create it, finally a `Value::Nothing` will be
produced and a warning will be reported.

this PR already fixes the `toolkit.nu` module so that it does not throw
a bunch of warnings each time 👌

# User-Facing Changes
`$nothing` is now deprecated and will be removed in 0.87
```nushell
> $nothing
Error:   × Deprecated variable
   ╭─[entry #1:1:1]
 1 │ $nothing
   · ────┬───
   ·     ╰── `$nothing` is deprecated and will be removed in 0.87.
   ╰────
  help: Use `null` instead
```

# Tests + Formatting
tests have been updated, especially
- `nothing_fails_string`
- `nothing_fails_int`
which use a variable called `nil` now to make sure `nothing` does not
support cell paths 👍

# After Submitting
classic deprecation mention 👍
2023-09-26 18:49:28 +02:00
..
call_info.rs Back to working state 2021-09-03 06:21:37 +12:00
capture_block.rs revert: move to ahash (#9464) 2023-06-18 15:27:57 +12:00
command.rs Invert &Options to Option<&T> (#10315) 2023-09-13 07:00:58 +08:00
engine_state.rs remove the $nothing variable (#10478) 2023-09-26 18:49:28 +02:00
mod.rs Split up nu-protocol/src/engine/engine_state.rs (#10368) 2023-09-21 22:53:36 +02:00
overlay.rs Use slices directly instead of &Vec (#10328) 2023-09-12 11:38:20 +08:00
pattern_match.rs Move Value to helpers, separate span call (#10121) 2023-09-03 07:27:29 -07:00
stack.rs Deref &String arguments to &str where appropriate (#10321) 2023-09-12 14:06:56 +08:00
state_delta.rs Split up nu-protocol/src/engine/engine_state.rs (#10368) 2023-09-21 22:53:36 +02:00
state_working_set.rs Split up nu-protocol/src/engine/engine_state.rs (#10368) 2023-09-21 22:53:36 +02:00
usage.rs Split up nu-protocol/src/engine/engine_state.rs (#10368) 2023-09-21 22:53:36 +02:00