Skip to main content

Module parser

Module parser 

Source
Expand description

Parsing entrypoints, lexer types, and shell-profile configuration. Parser entrypoints, lexical types, and shell-profile configuration.

The parser is recursive descent and produces shuck-ast syntax trees while also collecting recovery diagnostics and lightweight syntax facts needed by downstream tooling.

Structs§

HeredocRead
Result of reading a heredoc body from the source.
LexedToken
Token produced by the shell lexer.
LexedWord
Source-backed representation of a shell word produced by the lexer.
LexedWordSegment
One segment of a lexed shell word, optionally backed by source text.
Lexer
Lexer for bash scripts.
ParseDiagnostic
A parser diagnostic emitted while recovering from invalid input.
ParseResult
The result of parsing a script, including any recovery diagnostics and syntax facts collected along the way.
Parser
Parser for bash scripts.
ShellProfile
Dialect plus optional zsh option state used to configure the lexer and parser.
SyntaxFacts
Additional parser-owned facts that are useful to downstream consumers.
ZshCaseGroupPart
One branch separator recognized inside a zsh case pattern group.
ZshOptionState
Snapshot of zsh option state used by the parser and lexer.

Enums§

LexedWordSegmentKind
Classification of one segment inside a lexed shell word.
LexerErrorKind
Kinds of lexer error payloads attached to TokenKind::Error.
OptionValue
Tri-state option value used when modeling zsh option state.
ParseStatus
Overall outcome of a parse attempt.
ShellDialect
Supported shell dialects for parsing.
ZshEmulationMode
Target emulation mode for zsh’s emulate behavior.

Functions§

text_is_self_contained_arithmetic_expression
Returns whether text parses as an arithmetic expression without variable references or assignments.
text_looks_like_nontrivial_arithmetic_expression
Returns whether text parses as a nontrivial arithmetic expression.