nushell/crates/nu-parser/src
Darren Schroeder e03c354e89
add decimal to SyntaxShape (#7852)
# Description

This adds the `SyntaxShape::Decimal` so you can create custom commands
with `decimal` types such as:
```shell
def cmd [x:decimal] { echo $x }
```

/cc @kurokirasama

Internally this is a little messy since we have `Type::Float` and
`SyntaxShape::Decimal`. I originally named it `float` and
`SyntaxShape::Float` but since we have `into decimal` and `1.1 |
describe` reports `decimal`, I decided to change the SyntaxShape.

# User-Facing Changes

_(List of all changes that impact the user experience here. This helps
us keep track of breaking changes.)_

# 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

# 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-01-25 06:43:22 -06:00
..
deparse.rs fix arg parse (#5754) 2022-06-11 20:52:31 +12:00
errors.rs Incorrect parsing of unbalanced braces based on issue 6914 (#7621) 2023-01-24 10:05:46 +02:00
eval.rs Make get hole errors and cell path hole errors identical (improvement on #7002) (#7647) 2023-01-02 14:45:43 -08:00
flatten.rs Support redirect err and out to different streams (#7685) 2023-01-12 10:22:30 +01:00
known_external.rs Fix command name lookup for known externals (#7830) 2023-01-22 21:40:18 +02:00
lex.rs Incorrect parsing of unbalanced braces based on issue 6914 (#7621) 2023-01-24 10:05:46 +02:00
lib.rs Small parser refactors (#7568) 2022-12-22 13:41:44 +02:00
lite_parser.rs Fix multi-line redirection inside a block (#7808) 2023-01-23 06:32:56 +13:00
parse_keywords.rs Allow main command to define top-level module command (#7764) 2023-01-22 21:34:15 +02:00
parser.rs add decimal to SyntaxShape (#7852) 2023-01-25 06:43:22 -06:00
type_check.rs allow tables in ++ operator (#7051) 2022-12-01 00:21:59 +01:00