Sibling articles under this feature previously restated requirements in inconsistent forms.
Parser and AST contracts
Platform spec feature
Parser and AST contracts
Spec standingStandard
-
This feature hub owns normative MUST/SHOULD contract text for Parser and AST contracts.
Context
Decision
This feature hub owns normative MUST/SHOULD contract text. Sibling articles must not redefine hub requirements and should link here for authority.
Consequences
Contract changes start on the hub or in linked ADRs, then propagate to articles and implementation anchors.
Verification anchors
site/website/src/content/docs/platform-spec/compiler/front-end/parser-and-ast-contracts/index.mdxarticle bundle under the same feature directory.
-
Platform-spec text supersedes informal crate comments for Parser and AST contracts.
Context
Implementation crates accumulated informal notes that diverged from published contracts.
Decision
Normative platform-spec prose and ADRs under this feature supersede informal comments in implementation crates until explicitly migrated into spec text.
Consequences
Engineers file spec/ADR updates when behavior changes; crate comments are non-authoritative for conformance arguments.
Verification anchors
compiler/crates/beskid_analysis/src/beskid.pestcompiler/crates/beskid_analysis/src/parsingcompiler/crates/beskid_analysis/src/syntax/items
-
Multiple parser entrypoints caused span drift.
Context
Multiple parser entrypoints caused span drift.
Decision
beskid.pestandbeskid_analysis::parsingare the authoritative parse surface; AST contracts derive spans from this pipeline only.Consequences
Alternate parsers must not ship without an ADR and conformance fixtures.
Verification anchors
compiler/crates/beskid_analysis/src/beskid.pestcompiler/crates/beskid_analysis/src/parsing.
- Contracts and edge cases Non-negotiable parser contracts and common edge-case handling rules.
- Design model Mental model for how the front-end parser and syntax model are organized.
- Examples Concrete examples that show parser contracts in daily compiler work.
- FAQ and troubleshooting Common parser and syntax questions with practical debugging guidance.
- Flow and algorithm Step-by-step parse flow from source text to syntax structures.
- Verification and traceability How to verify parser behavior and trace docs back to source.
0 revisions (git unavailable at build; counts may be empty)
No commits recorded for this path.
Full tree: run pnpm verify:platform-spec-layout (writes src/generated/platform-spec-layout-report.json).
What this feature governs
Section titled “What this feature governs”This feature defines how raw source text becomes the typed syntax model used by name resolution, semantic analysis, and formatting. The grammar lives in beskid_analysis/src/beskid.pest, while syntax item and type nodes under beskid_analysis/src/syntax form the canonical AST contract.
Core guarantees
Section titled “Core guarantees”- Parser entry points convert
pestfailures into diagnostics that preserve source ranges and actionable messages. - Syntax node builders in
syntax/itemsandsyntax/typesare the single source of truth for declaration and type shapes. - Formatter paths consume these syntax nodes and do not maintain an independent parse model.
- Parser updates must keep resolver and diagnostics consumers source-compatible or include coordinated downstream updates.
Implementation anchors
Section titled “Implementation anchors”compiler/crates/beskid_analysis/src/beskid.pestcompiler/crates/beskid_analysis/src/parsingcompiler/crates/beskid_analysis/src/syntax/itemscompiler/crates/beskid_analysis/src/syntax/typescompiler/crates/beskid_analysis/src/resolvecompiler/crates/beskid_analysis/src/analysis
Decisions
Section titled “Decisions”No open decisions. Closed choices are normative ADRs under adr/ (D-COMP-FRONT-0010 … D-COMP-FRONT-0012); use the reader ADRs tab for expandable detail.