Expand description
Expression parsing for computed values in ceremony DSL.
This module provides types and functions for parsing pipeline expressions
that compute values at runtime, such as ${artifact.ksr | sha256 | hex}.
§Syntax
Expressions use Unix-style pipes:
${artifact.ksr | sha256 | hex}
${artifact.keypair.public | fingerprint | hex | upper}
${concat(artifact.a | sha256, artifact.b | sha256) | hex}§Design Principles
- Bytes-first: Hash functions return raw bytes; encoding is explicit
- Left-to-right: Data flows through transformations naturally
- Safe: All functions are total and terminate (no user-defined functions)
§Grammar
The formal grammar is documented in docs/dsl/grammar.md (not yet published).
Structs§
- Invalid
Expression - A
${...}occurrence that does not parse as an expression. - Located
Expression - An expression with its location in the source string.
- Pipe
Stage - A stage in a pipeline.
- Reference
- A reference to a ceremony value:
${type.name}or${type.name.property}.
Enums§
- Expr
Error - Why a
${...}occurrence is not a usable expression. - Expr
Value - A value that may contain deferred expressions (parsed, not yet evaluated).
- Expression
- A parsed expression from ceremony YAML.
- Literal
- A literal value in an expression.
- RefType
- The type/namespace of a reference.
- String
Part - A part of an interpolated string.
- Value
- A runtime value in the expression system.
Functions§
- find_
expressions - Find all expressions in a string.
- find_
invalid_ expressions - Find every
${...}insthat does not parse as an expression. - parse_
expr_ value - Parse a JSON value into an
ExprValue, extracting all${...}expressions. - parse_
expression - Parse an expression string.
- parse_
expression_ detailed - Parse an expression string, reporting why it is not one.