Skip to main content

Crate alba_syntax

Crate alba_syntax 

Source
Expand description

Lexer, parser, AST, and diagnostics for the Beamfile DSL.

Structs§

BeamDecl
beam name(params) { ... }.
BeamRef
A reference to a beam in a needs [...] list, optionally namespaced by the import aliases it is reached through (api:build, api:db:migrate, or plain codegen).
Diagnostic
A renderable diagnostic: a message, an optional label on the offending span, and optional help text. Built from a ParseError via ParseError::into_diagnostic.
ExecutorDecl
executor <name> { option value, ... }.
File
A fully parsed Beamfile.
HookDecl
hook <name> { beam <ref> }: a git hook bound to the beam it runs.
Import
import "path" as alias.
LetBinding
let name = value.
LexError
An error produced while scanning source text into tokens.
Lexer
Scans Beamfile source text into a stream of Tokens.
ParseError
An error produced while parsing a token stream (including lexing errors, surfaced through the same type since callers only ever see parse’s single Result).
Span
A byte-offset span into the original source text.
Spanned
A value together with the span of source text it was parsed from.
StringTemplate
A string literal parsed into alternating literal text and interpolated expressions, e.g. "target/{profile}/app" becomes [Literal("target/"), Expr(Var(profile)), Literal("/app")].
Token
A single lexical token together with its span in the source text.

Enums§

BinOp
A binary operator usable in an Expr::Binary.
ExecutorOptionValue
The value half of an executor { ... } block’s option value entry: a string (image "x"), a boolean (remote true), or a list of strings (volumes ["a:/b", "c:/d"]). Unlike env’s values, an executor option is never a bare identifier — see parser.rs’s parse_executor_decl.
Expr
An expression, as used in let bindings and interpolated {expr} segments of a StringTemplate.
TemplatePart
One piece of a StringTemplate: either literal text or a {expr} interpolation.
TokenKind
The kind of a lexical token in the Beamfile DSL.

Functions§

parse
Parses a whole Beamfile from source text into a typed File.
parse_template
Parses a single quoted string literal (e.g. "target/{profile}/app", quotes included) into a StringTemplate, treating source as though it were the whole world: spans in the result are 0-based byte offsets into source itself. Use [parse_template_at] when the literal is embedded in a larger file and spans must land in that original source.
render_diagnostic
Renders err against source (identified as path in the output) using miette’s graphical report handler, producing the source line, a caret under the exact span, and the help text if present.

Type Aliases§

NamedString
A NAME = value entry in an env { ... } block: a name paired with its templated string value. Named to keep clippy’s type_complexity lint quiet.