Skip to main content

Module ast

Module ast 

Source
Expand description

The loose syntax tree, one step away from the grammar.

This mirrors what was written, not what it means: no types are resolved, no names are mapped, no relation has two sides yet. Lowering turns it into the strict IR.

The separation is not ceremony. Relation resolution needs the complete set of models, which does not exist part-way through a parse, so an IR built directly in the parse walk would be wrong for any schema that references a model before declaring it — which is most of them.

Structs§

Ast
A parsed schema file.
Attr
An @attr or @@attr, with its arguments.
Block
A datasource or generator block.
ConfigEntry
One key = value line inside a block.
EnumDecl
An enum declaration.
FieldDecl
A field within a ModelDecl.
ModelDecl
A model declaration.
VariantDecl
One variant of an EnumDecl.

Enums§

Arg
One argument of an Attr.
Arity
How many values a field holds.
Decl
One top-level declaration.
Value
A value written in an attribute argument or a config entry.