Understand the AST output format
masterThe ast object returned by parse() follows a specific structure. For a simple command like echo ciao, the output is a Script type containing an array of commands. Each command is represented as a SimpleCommand with a name (the command itself) and a suffix (the arguments).
{
type: "Script",
commands: [
{
type: "SimpleCommand",
name: {
text: "echo",
type: "Word"
},
suffix: [
{
text: "ciao",
type: "Word"
}
]
}
]
}