Skip to main content

Module parser

Module parser 

Source
Expand description

AXON Parser — recursive descent, fail-fast.

Direct port of axon/compiler/parser.py.

Tier 1 constructs (persona, context, anchor, memory, tool, type, flow, step, intent, run, epistemic, if, for, let, return) are fully parsed into typed AST nodes.

Tier 2+ constructs are parsed structurally (balanced braces) into GenericDeclaration / GenericFlowStep.

Structs§

ParseError
ParseResult
Outcome of Parser::parse_with_recovery — partial program plus the list of every error the parser recovered from. See module docs for the panic-mode + sync-point recovery semantics.
Parser
SourceSnippet
v1.20.0 — Rustc-style source-context block for a parse error.

Constants§

AXONENDPOINT_BACKEND_VALUES
v1.31.0 (D2) — Closed catalog for the axonendpoint backend: declaration. The set is CANONICAL_PROVIDERS ∪ {auto, stub}:
AXONENDPOINT_KEEPALIVE_VALUES
Adopter-facing acceptable values for keepalive: field.
AXONENDPOINT_METHOD_VALUES
v1.23.0 D3 — Closed method enum for method: field. Adopter- declarable methods only; HEAD/OPTIONS/CONNECT/TRACE are runtime-managed (CORS preflight, etc.) and never declared from source. Closed enum refuses interpretation drift; smart-suggest catches near-misses at parse time.
AXONENDPOINT_QUERY_PARAM_TYPES
v1.32.0 (D2) — Closed type catalog for query parameters.
AXONENDPOINT_TRANSPORT_DIALECTS
v1.28.0 — Closed-catalog SSE wire-format dialects. Selected via the parametrized grammar transport: sse(<dialect>); bare transport: sse resolves to the Q1 default per the flow’s algebraic-effect predicate (openai for tool-streaming flows; axon for type-annotation-only).
AXONENDPOINT_TRANSPORT_VALUES
Adopter-facing acceptable values for transport: field. Used by both the parser (validation + smart-suggest) and the type-checker (30.c) so adopter tooling sees one canonical list.
SOURCE_CONTEXT_LINES_AFTER
SOURCE_CONTEXT_LINES_BEFORE
v1.20.0 — Source-context constants. D4 ratified 2026-05-10: 2 lines before + 2 lines after the error line. Mirror of the Python-side _SOURCE_CONTEXT_LINES_BEFORE / _AFTER so the rustc-style block has identical shape across stacks.

Functions§

is_valid_capability_slug
v1.23.0 (D8) — Closed capability-slug grammar. Validates a requires: slug per ^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)*$.