Skip to main content

Module cst

Module cst 

Source
Expand description

The frontend’s concrete syntax tree (CST).

Source-preserving syntax structure with spans on every node, produced by crate::parser and consumed by [crate::lower] (and, in later milestones, language services). Nodes are deliberately close to the Opy HIR contract so lowering stays a small, reviewable mapping; unresolved names and member accesses remain explicit until semantic resolution.

Structs§

Annotation
A source annotation retained for tooling and provenance.
AnnotationArg
One raw annotation argument. Values such as heroes, teams, and slots stay opaque here because their canonical domains belong to workshop-rs.
CallArg
One call argument: either positional (expr) or keyword (name = expr, issue #110). Keyword arguments keep the name token’s exact span so binding diagnostics are source-located on the name (unknown/duplicate keyword) or the value (enum-domain, arity of the value expression) as appropriate.
DictEntry
One key/value pair in an OPY dictionary literal.
Event
A rule event or an @Event directive.
IfBranch
One condition/body pair of an if.
Program
A parsed program: declarations and rule/subroutine entries.
Rule
A rule with its event, conditions, and actions.
Settings
A parsed settings { ... } block (JSONC, #86).
SettingsListElement
One element of a settings list.

Enums§

Decl
A program-scope declaration.
Expr
An expression.
RuleEntry
A rule or a subroutine definition.
SettingsNode
One member of a settings group.
Stmt
A statement.
SwitchArm
One source-ordered arm in a switch statement.
TopLevel
A top-level declaration or rule entry in source order.