From 12deff5d1b44afc96d272e738cb6573dfde24f4c Mon Sep 17 00:00:00 2001 From: Kangaxx-0 <85712372+Kangaxx-0@users.noreply.github.com> Date: Sun, 4 Dec 2022 11:20:47 -0800 Subject: [PATCH] Add comments for nu syntax shape (#7349) # Description FIx the typo of `List` and also add more comments to other variants # 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. --- crates/nu-protocol/src/syntax_shape.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/nu-protocol/src/syntax_shape.rs b/crates/nu-protocol/src/syntax_shape.rs index bca1c0f065..495ff9e5f3 100644 --- a/crates/nu-protocol/src/syntax_shape.rs +++ b/crates/nu-protocol/src/syntax_shape.rs @@ -55,7 +55,7 @@ pub enum SyntaxShape { /// A table is allowed, eg `[[first, second]; [1, 2]]` Table, - /// A table is allowed, eg `[first second]` + /// A list is allowed, eg `[first second]` List(Box), /// A filesize value is allowed, eg `10kb` @@ -67,7 +67,7 @@ pub enum SyntaxShape { /// A datetime value, eg `2022-02-02` or `2019-10-12T07:20:50.52+00:00` DateTime, - /// An operator + /// An operator, eg `+` Operator, /// A math expression which expands shorthand forms on the lefthand side, eg `foo > 1` @@ -77,7 +77,7 @@ pub enum SyntaxShape { /// A general math expression, eg `1 + 2` MathExpression, - /// A variable name + /// A variable name, eg `$foo` Variable, /// A variable with optional type, `x` or `x: int` @@ -89,10 +89,10 @@ pub enum SyntaxShape { /// A general expression, eg `1 + 2` or `foo --bar` Expression, - /// A boolean value + /// A boolean value, eg `true` or `false` Boolean, - /// A record value + /// A record value, eg `{x: 1, y: 2}` Record, /// An error value