22title : ast
33categories : |
44 debug
5- version : 0.110 .0
5+ version : 0.111 .0
66debug : |
77 Print the abstract syntax tree (ast) for a pipeline.
88usage : |
@@ -22,9 +22,9 @@ contributors: false
2222
2323## Flags
2424
25- - ` --json, -j ` : Serialize to json
26- - ` --minify, -m ` : Minify the nuon or json output
27- - ` --flatten, -f ` : An easier to read version of the ast
25+ - ` --json, -j ` : Serialize to json.
26+ - ` --minify, -m ` : Minify the nuon or json output.
27+ - ` --flatten, -f ` : An easier to read version of the ast.
2828
2929## Parameters
3030
@@ -40,37 +40,37 @@ contributors: false
4040| nothing | string |
4141## Examples
4242
43- Print the ast of a string
43+ Print the ast of a string.
4444``` nu
4545> ast 'hello'
4646
4747```
4848
49- Print the ast of a pipeline
49+ Print the ast of a pipeline.
5050``` nu
5151> ast 'ls | where name =~ README'
5252
5353```
5454
55- Print the ast of a pipeline with an error
55+ Print the ast of a pipeline with an error.
5656``` nu
5757> ast 'for x in 1..10 { echo $x '
5858
5959```
6060
61- Print the ast of a pipeline with an error, as json, in a nushell table
61+ Print the ast of a pipeline with an error, as json, in a nushell table.
6262``` nu
6363> ast 'for x in 1..10 { echo $x ' --json | get block | from json
6464
6565```
6666
67- Print the ast of a pipeline with an error, as json, minified
67+ Print the ast of a pipeline with an error, as json, minified.
6868``` nu
6969> ast 'for x in 1..10 { echo $x ' --json --minify
7070
7171```
7272
73- Print the ast of a string flattened
73+ Print the ast of a string flattened.
7474``` nu
7575> ast "'hello'" --flatten
7676╭───┬─────────┬──────────────┬───────────────╮
@@ -84,13 +84,13 @@ Print the ast of a string flattened
8484
8585```
8686
87- Print the ast of a string flattened, as json, minified
87+ Print the ast of a string flattened, as json, minified.
8888``` nu
8989> ast "'hello'" --flatten --json --minify
9090[{"content":"'hello'","shape":"shape_string","span":{"start":0,"end":7}}]
9191```
9292
93- Print the ast of a pipeline flattened
93+ Print the ast of a pipeline flattened.
9494``` nu
9595> ast 'ls | sort-by type name -i' --flatten
9696╭───┬─────────┬────────────────────┬────────────────╮
0 commit comments