Skip to content

Latest commit

 

History

History
68 lines (46 loc) · 1.22 KB

ast.md

File metadata and controls

68 lines (46 loc) · 1.22 KB
title categories version debug usage feature
ast
debug
0.94.0
Print the abstract syntax tree (ast) for a pipeline.
Print the abstract syntax tree (ast) for a pipeline.
default

ast for debug

Print the abstract syntax tree (ast) for a pipeline.

Signature

> ast {flags} (pipeline)

Flags

  • --json, -j: serialize to json
  • --minify, -m: minify the nuon or json output

Parameters

  • pipeline: The pipeline to print the ast for.

Input/output types:

input output
string record

Examples

Print the ast of a string

> ast 'hello'

Print the ast of a pipeline

> ast 'ls | where name =~ README'

Print the ast of a pipeline with an error

> ast 'for x in 1..10 { echo $x '

Print the ast of a pipeline with an error, as json, in a nushell table

> ast 'for x in 1..10 { echo $x ' --json | get block | from json

Print the ast of a pipeline with an error, as json, minified

> ast 'for x in 1..10 { echo $x ' --json --minify