nushell/crates/nu-protocol/src/engine
JT 3db0aed9f7
Add rest and ignore-rest patterns (#8681)
# Description

Adds two more patterns when working with lists:

```
[1, ..$remainder]
```
and
```
[1, ..]
```
The first one collects the remaining items and assigns them into the
variable. The second one ignores any remaining values.

# User-Facing Changes

Adds more capability to list pattern matching.

# Tests + Formatting

Don't forget to add tests that cover your changes.

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes)
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used -A
clippy::needless_collect` to check that you're using the standard code
style
- `cargo test --workspace` to check that all tests pass
- `cargo run -- crates/nu-utils/standard_library/tests.nu` to run the
tests for the standard library

> **Note**
> from `nushell` you can also use the `toolkit` as follows
> ```bash
> use toolkit.nu # or use an `env_change` hook to activate it
automatically
> toolkit check pr
> ```

# After Submitting

If your PR had any user-facing changes, update [the
documentation](https://github.com/nushell/nushell.github.io) after the
PR is merged, if necessary. This will help us keep the docs up to date.
2023-03-31 11:08:53 +13:00
..
call_info.rs Back to working state 2021-09-03 06:21:37 +12:00
capture_block.rs Split blocks and closures (#7075) 2022-11-10 21:21:49 +13:00
command.rs Re-implement aliases (#8123) 2023-02-27 20:44:05 +13:00
engine_state.rs Add or-patterns, fix var binding scope (#8633) 2023-03-27 11:31:57 +13:00
mod.rs Add pattern matching (#8590) 2023-03-24 14:52:01 +13:00
overlay.rs Reduce again the number of match calls (#7815) 2023-01-24 12:23:42 +01:00
pattern_match.rs Add rest and ignore-rest patterns (#8681) 2023-03-31 11:08:53 +13:00
stack.rs Move variables to var stack (#8604) 2023-03-25 12:56:45 +13:00