mirror of
https://github.com/nushell/nushell.git
synced 2024-11-29 03:44:19 +01:00
doc: correct some really tiny typos. (#7635)
This commit is contained in:
parent
be31182969
commit
f3d2be7a56
@ -47,7 +47,7 @@ brew install nushell
|
|||||||
winget install nushell
|
winget install nushell
|
||||||
```
|
```
|
||||||
|
|
||||||
To use `Nu` in Github Action, check [setup-nu](https://github.com/marketplace/actions/setup-nu) for more detail.
|
To use `Nu` in GitHub Action, check [setup-nu](https://github.com/marketplace/actions/setup-nu) for more detail.
|
||||||
|
|
||||||
Detailed installation instructions can be found in the [installation chapter of the book](https://www.nushell.sh/book/installation.html). Nu is available via many package managers:
|
Detailed installation instructions can be found in the [installation chapter of the book](https://www.nushell.sh/book/installation.html). Nu is available via many package managers:
|
||||||
|
|
||||||
|
@ -20,7 +20,7 @@ At this point, the parser has little to no understanding of the shape of the com
|
|||||||
|
|
||||||
## Lite parsing
|
## Lite parsing
|
||||||
|
|
||||||
As nushell is a language of pipelines, pipes form a key role in both separating commands from each other as well as denoting the flow of information between commands. The lite parse phase, as the name suggests, helps to group the lexed tokens into units.
|
As Nushell is a language of pipelines, pipes form a key role in both separating commands from each other as well as denoting the flow of information between commands. The lite parse phase, as the name suggests, helps to group the lexed tokens into units.
|
||||||
|
|
||||||
The above tokens are converted the following during the lite parse phase:
|
The above tokens are converted the following during the lite parse phase:
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ Pipeline:
|
|||||||
|
|
||||||
The real magic begins to happen when the parse moves on to the parsing stage. At this point, it traverses the lite parse tree and for each command makes a decision:
|
The real magic begins to happen when the parse moves on to the parsing stage. At this point, it traverses the lite parse tree and for each command makes a decision:
|
||||||
|
|
||||||
* If the command looks like an internal/external command literal: eg) `foo` or `/usr/bin/ls`, it parses it as an internal or external command
|
* If the command looks like an internal/external command literal: e.g. `foo` or `/usr/bin/ls`, it parses it as an internal or external command
|
||||||
* Otherwise, it parses the command as part of a mathematical expression
|
* Otherwise, it parses the command as part of a mathematical expression
|
||||||
|
|
||||||
### Types/shapes
|
### Types/shapes
|
||||||
@ -96,4 +96,3 @@ As some Shapes can consume multiple tokens, it's important that the parser allow
|
|||||||
The simplest way it does this is to ensure there is at least one token for each required parameter. If the Signature of the command says that it takes a MathExpression and a Number as two required arguments, then the parser will stop the math parser one token short. This allows the second Shape to consume the final token.
|
The simplest way it does this is to ensure there is at least one token for each required parameter. If the Signature of the command says that it takes a MathExpression and a Number as two required arguments, then the parser will stop the math parser one token short. This allows the second Shape to consume the final token.
|
||||||
|
|
||||||
Another way that the parser makes space is to look for Keyword shapes in the Signature. A Keyword is a word that's special to this command. For example in the `if` command, `else` is a keyword. When it is found in the arguments, the parser will use it as a signpost for where to make space for each Shape. The tokens leading up to the `else` will then feed into the parts of the Signature before the `else`, and the tokens following are consumed by the `else` and the Shapes that follow.
|
Another way that the parser makes space is to look for Keyword shapes in the Signature. A Keyword is a word that's special to this command. For example in the `if` command, `else` is a keyword. When it is found in the arguments, the parser will use it as a signpost for where to make space for each Shape. The tokens leading up to the `else` will then feed into the parts of the Signature before the `else`, and the tokens following are consumed by the `else` and the Shapes that follow.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user