Skip to main content

Crate wasmsh_ast

Crate wasmsh_ast 

Source
Expand description

AST types for the wasmsh shell.

This crate defines the abstract syntax tree produced by the parser. Words remain structured (no premature stringification) so that expansion phases can operate on typed segments.

Structs§

AndOrList
A chain of pipelines joined by && or ||.
ArithCommandNode
A (( expr )) arithmetic command.
ArithForCommand
A C-style for (( init; cond; step )) do body done command.
Assignment
A variable assignment (name=value).
CaseCommand
A case word in pattern) body ;; ... esac command.
CaseItem
A single pattern) body ;; arm in a case statement.
CompleteCommand
A complete command terminated by a newline or ;.
DoubleBracketCommand
A [[ expression ]] extended test command.
ElifClause
A single elif condition; then body clause.
ForCommand
A for name in words; do body; done command.
FunctionDef
A function definition: name() body or function name body.
GroupCommand
A brace group { compound_list ; }.
HereDocBody
The body of a here-document.
IfCommand
An if / elif / else / fi command.
Pipeline
A pipeline of one or more commands connected by |.
Program
A complete shell program (list of commands).
Redirection
A redirection (>, <, >>, <<, etc.).
SelectCommand
A select name [in word ...]; do body; done command.
SimpleCommand
A simple command: optional assignments, words (argv), and redirections.
Span
A span marking the byte range of a syntax element in source.
SubshellCommand
A subshell command ( compound_list ).
UntilCommand
An until condition; do body; done command.
WhileCommand
A while condition; do body; done command.
Word
A structured word composed of parts that preserve quoting and expansion boundaries.

Enums§

AndOrOp
&& or || operator.
CaseTerminator
Terminator for a case item arm.
Command
A single command in the AST.
RedirectionOp
Redirection operator.
WordPart
A segment of a word — literals, quoted strings, expansions, etc.