Expand description
Zsh parser - Direct port from zsh/Src/parse.c
This parser takes tokens from the ZshLexer and builds an AST. It follows the zsh grammar closely, producing structures that can be executed by the shell executor.
Structs§
- CaseArm
- Here
DocInfo - List
Flags - Parse
Error - Parse errors
- Redirect
- Redirect
- Shell
Lexer - Shell
Parser - Simple
Command - Simple command with assignments, words, and redirects
- Sublist
Flags - ZshAssign
- An assignment
- ZshCase
- Case statement
- ZshFor
- For loop
- ZshFunc
Def - Function definition
- ZshIf
- If statement
- ZshList
- A list is a sequence of sublists separated by ; or & or newline
- ZshParser
- The Zsh Parser
- ZshPipe
- A pipeline is commands connected by |
- ZshProgram
- AST node for a complete program (list of commands)
- ZshRedir
- A redirection
- ZshRepeat
- Repeat loop
- ZshSimple
- A simple command (assignments, words, redirections)
- ZshSublist
- A sublist is pipelines connected by && or ||
- ZshTry
- Try/always block
- ZshWhile
- While/Until loop
Enums§
- Case
Term - Case
Terminator - Case terminator
- Compound
Command - Compound command
- Cond
Expr - Conditional expression for [[ ]]
- ForList
- ListOp
- List operator (for shell command lists)
- Redir
Type - Redirection type
- Redirect
Op - Redirect operator
- Shell
Command - Shell command - the old shell_ast compatible type
- Shell
Token - Shell
Word - Shell word - can be simple literal or complex expansion
- Sublist
Op - VarModifier
- Variable modifier for parameter expansion
- ZshAssign
Value - ZshCommand
- A command
- ZshCond
- Conditional expression [[ … ]]
- ZshParam
Flag - Zsh parameter expansion flags