Skip to main content

Module ast

Module ast 

Source
Expand description

Abstract syntax tree for bash commands.

All AST nodes borrow from the input string (&'a str) — zero-copy. The parser produces a Vec<Cmd<'a>> representing the top-level command list.

Structs§

AndOrList
A chain of commands connected by && and ||.
CaseArm
A single arm in a case statement.
CompoundCmd
A compound command with optional trailing redirections.
GuardBody
A guard (condition) and body pair, used by while, until, and if.
SimpleCmd
A simple command with optional prefix assignments and suffix words/redirects.

Enums§

AndOr
A single && or || link in an and-or chain.
Arith
An arithmetic expression node (used in $(( )), (( )), and C-style for).
Atom
An atomic element within a word: literal text, expansion, or glob.
Cmd
A complete command — foreground or background.
CmdPrefix
A prefix element: variable assignment or redirection.
CmdSuffix
A suffix element: argument word or redirection.
CompoundKind
The body of a compound command.
Executable
An executable unit: simple command, compound command, or function definition.
HeredocBody
The body of a heredoc (here-document).
Param
A shell parameter reference.
Pipeline
A pipeline: one or more commands connected by |.
Redir
An I/O redirection.
Subst
A substitution or parameter expansion.
Word
A shell word: either a single part or a concatenation of parts.
WordPart
A fragment of a word: bare text, quoted text, or a substitution.