caffeine_lang/frontend/ast

Types

A single blueprint item with name, extends, requires, and provides.

pub type BlueprintItem {
  BlueprintItem(
    name: String,
    extends: List(String),
    requires: Struct,
    provides: Struct,
  )
}

Constructors

  • BlueprintItem(
      name: String,
      extends: List(String),
      requires: Struct,
      provides: Struct,
    )

A block of blueprints for one or more artifacts.

pub type BlueprintsBlock {
  BlueprintsBlock(
    artifacts: List(String),
    items: List(BlueprintItem),
  )
}

Constructors

  • BlueprintsBlock(
      artifacts: List(String),
      items: List(BlueprintItem),
    )

A blueprints file containing type aliases, extendables, and blueprint blocks. Type aliases must come before extendables, which must come before blocks.

pub type BlueprintsFile {
  BlueprintsFile(
    type_aliases: List(TypeAlias),
    extendables: List(Extendable),
    blocks: List(BlueprintsBlock),
  )
}

Constructors

A single expectation item with name, extends, and provides.

pub type ExpectItem {
  ExpectItem(
    name: String,
    extends: List(String),
    provides: Struct,
  )
}

Constructors

  • ExpectItem(name: String, extends: List(String), provides: Struct)

A block of expectations for a blueprint.

pub type ExpectsBlock {
  ExpectsBlock(blueprint: String, items: List(ExpectItem))
}

Constructors

  • ExpectsBlock(blueprint: String, items: List(ExpectItem))

An expects file containing extendables and expects blocks.

pub type ExpectsFile {
  ExpectsFile(
    extendables: List(Extendable),
    blocks: List(ExpectsBlock),
  )
}

Constructors

An extendable block that can be inherited by blueprints or expectations.

pub type Extendable {
  Extendable(name: String, kind: ExtendableKind, body: Struct)
}

Constructors

The kind of extendable (Requires for types, Provides for values).

pub type ExtendableKind {
  ExtendableRequires
  ExtendableProvides
}

Constructors

  • ExtendableRequires
  • ExtendableProvides

A field with a name and value (either a type or a literal).

pub type Field {
  Field(name: String, value: Value)
}

Constructors

  • Field(name: String, value: Value)

Literal values.

pub type Literal {
  LiteralString(value: String)
  LiteralInteger(value: Int)
  LiteralFloat(value: Float)
  LiteralTrue
  LiteralFalse
  LiteralList(elements: List(Literal))
  LiteralStruct(fields: List(Field))
}

Constructors

  • LiteralString(value: String)
  • LiteralInteger(value: Int)
  • LiteralFloat(value: Float)
  • LiteralTrue
  • LiteralFalse
  • LiteralList(elements: List(Literal))
  • LiteralStruct(fields: List(Field))

A struct containing a list of fields.

pub type Struct {
  Struct(fields: List(Field))
}

Constructors

  • Struct(fields: List(Field))

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_: accepted_types.AcceptedTypes)
}

Constructors

A value in a field - either a type (in Requires) or a literal (in Provides).

pub type Value {
  TypeValue(type_: accepted_types.AcceptedTypes)
  LiteralValue(literal: Literal)
}

Constructors

Search Document