Skip to main content

Module ast

Module ast 

Source

Structs§

AndOrBinary
Binary and-or metadata used by AndOrList::BinOp.
ArithmAssignmentExpr
ArithmBinaryExpr
ArithmConditionalExpr
ArithmLiteral
An arithmetic expression node.
ArithmRaw
ArithmUnaryExpr
ArithmVariable
ArithmeticExpansion
Arithmetic expansion metadata for Word::Arithmetic.
Assignment
A variable assignment: NAME=VALUE.
CaseClause
A case clause.
CaseItem
A single case item: pattern [| pattern]...) body ;;.
CommandList
A command list entry: an and-or list optionally followed by &.
CommandSubstitution
Command substitution metadata for Word::Command.
CompoundCommand
Compound-command payload used by brace groups and subshells.
ElseClause
Else-body payload used by ElsePart::Else.
ForClause
A for loop clause.
FunctionDefinition
A function definition.
IfClause
An if-elif-else clause.
IoRedirect
A single I/O redirection.
LoopClause
A while or until loop.
ParameterExpansion
Parameter expansion metadata for Word::Parameter.
Pipeline
A pipeline: [!] cmd1 | cmd2 | ....
Position
Source position within the input stream.
Program
A complete shell program.
Range
A range of source positions.
SimpleCommand
A simple command with optional assignments, arguments, and redirections.
StringWord
Literal string segment metadata for Word::String.
WordList
Word-list metadata for Word::List.

Enums§

AndOrList
An and-or list node.
ArithmAssignOp
Arithmetic assignment operator.
ArithmBinOp
Binary arithmetic operator.
ArithmExpr
An arithmetic expression node.
ArithmUnOp
Unary arithmetic operator.
BinOpType
Type of binary and-or operator.
Command
A command node.
ElsePart
The else/elif portion of an if clause.
IoRedirectOp
I/O redirection operator.
LoopType
Loop type: while or until.
ParameterOp
Parameter expansion operator, e.g. ${var:-default}.
Word
A word node in the AST.

Traits§

Spanned
A syntax node that can report a source span.
Visitor
AST visitor for traversing shell syntax trees.

Functions§

walk_and_or_list
Recursively walk an and-or list.
walk_arithm_expr
Recursively walk one arithmetic expression tree.
walk_assignment
Recursively walk one assignment.
walk_brace_group
Recursively walk a brace group body and its redirections.
walk_case_clause
Recursively walk a case-clause.
walk_case_item
Recursively walk one case-item.
walk_command
Recursively walk a command.
walk_command_list
Recursively walk one command-list entry.
walk_else_part
Recursively walk an else-part.
walk_for_clause
Recursively walk a for-clause.
walk_function_definition
Recursively walk a function definition.
walk_if_clause
Recursively walk an if-clause.
walk_io_redirect
Recursively walk one redirection.
walk_loop_clause
Recursively walk a loop-clause.
walk_pipeline
Recursively walk a pipeline.
walk_program
Recursively walk a full program.
walk_simple_command
Recursively walk a simple command.
walk_subshell
Recursively walk a subshell body and its redirections.
walk_word
Recursively walk one word tree.