Skip to content

Commit

Permalink
Add comments for nu syntax shape (#7349)
Browse files Browse the repository at this point in the history
# 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.
  • Loading branch information
Kangaxx-0 committed Dec 4, 2022
1 parent 21a645b commit 12deff5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions crates/nu-protocol/src/syntax_shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<SyntaxShape>),

/// A filesize value is allowed, eg `10kb`
Expand All @@ -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`
Expand All @@ -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`
Expand All @@ -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
Expand Down

0 comments on commit 12deff5

Please sign in to comment.