caffeine_lang/frontend/ast
Types
A block of blueprints for one or more artifacts.
pub type BlueprintsBlock {
BlueprintsBlock(
artifacts: List(ParsedArtifactRef),
items: List(BlueprintItem),
leading_comments: List(Comment),
)
}
Constructors
-
BlueprintsBlock( artifacts: List(ParsedArtifactRef), items: List(BlueprintItem), leading_comments: List(Comment), )
A blueprints file containing type aliases, extendables, and blueprint blocks.
Type aliases must come before extendables, which must come before blocks.
The phantom phase parameter tracks whether the file has been validated.
pub type BlueprintsFile(phase) {
BlueprintsFile(
type_aliases: List(TypeAlias),
extendables: List(Extendable),
blocks: List(BlueprintsBlock),
trailing_comments: List(Comment),
)
}
Constructors
-
BlueprintsFile( type_aliases: List(TypeAlias), extendables: List(Extendable), blocks: List(BlueprintsBlock), trailing_comments: List(Comment), )
A comment attached to an AST node.
pub type Comment {
LineComment(text: String)
SectionComment(text: String)
}
Constructors
-
LineComment(text: String) -
SectionComment(text: String)
A block of expectations for a blueprint.
pub type ExpectsBlock {
ExpectsBlock(
blueprint: String,
items: List(ExpectItem),
leading_comments: List(Comment),
)
}
Constructors
-
ExpectsBlock( blueprint: String, items: List(ExpectItem), leading_comments: List(Comment), )
An expects file containing extendables and expects blocks.
The phantom phase parameter tracks whether the file has been validated.
pub type ExpectsFile(phase) {
ExpectsFile(
extendables: List(Extendable),
blocks: List(ExpectsBlock),
trailing_comments: List(Comment),
)
}
Constructors
-
ExpectsFile( extendables: List(Extendable), blocks: List(ExpectsBlock), trailing_comments: List(Comment), )
An extendable block that can be inherited by blueprints or expectations.
pub type Extendable {
Extendable(
name: String,
kind: ExtendableKind,
body: Struct,
leading_comments: List(Comment),
)
}
Constructors
-
Extendable( name: String, kind: ExtendableKind, body: Struct, leading_comments: List(Comment), )
The kind of extendable (Requires for types, Provides for values).
pub type ExtendableKind {
ExtendableRequires
ExtendableProvides
}
Constructors
-
ExtendableRequires -
ExtendableProvides
Literal values.
pub type Literal {
LiteralString(value: String)
LiteralInteger(value: Int)
LiteralFloat(value: Float)
LiteralPercentage(value: Float)
LiteralTrue
LiteralFalse
LiteralList(elements: List(Literal))
LiteralStruct(
fields: List(Field),
trailing_comments: List(Comment),
)
}
Constructors
-
LiteralString(value: String) -
LiteralInteger(value: Int) -
LiteralFloat(value: Float) -
LiteralPercentage(value: Float) -
LiteralTrue -
LiteralFalse -
LiteralList(elements: List(Literal)) -
A parsed artifact reference — the closed set of valid artifact types.
pub type ParsedArtifactRef {
ParsedSLO
ParsedDependencyRelations
}
Constructors
-
ParsedSLO -
ParsedDependencyRelations
A type alias that defines a named, reusable refined type. Example: _env (Type): String { x | x in { prod, staging, dev } }
pub type TypeAlias {
TypeAlias(
name: String,
type_: types.ParsedType,
leading_comments: List(Comment),
)
}
Constructors
-
TypeAlias( name: String, type_: types.ParsedType, leading_comments: List(Comment), )
A value in a field - either a type (in Requires) or a literal (in Provides).
pub type Value {
TypeValue(type_: types.ParsedType)
LiteralValue(literal: Literal)
}
Constructors
-
TypeValue(type_: types.ParsedType) -
LiteralValue(literal: Literal)