Skip to main content

Crate bynk_syntax

Crate bynk_syntax 

Source
Expand description

Bynk’s syntax foundation — the lowest leaf of the compiler crate set.

This crate holds the modules every other layer depends on and none depend up from: the lexer, the parser and its AST, source spans, the keywords table, the structured CompileError type, and the diagnostics code registry (the single source of truth for bynk.* codes). Diagnostics, positions, and codes therefore cross every crate without an upward edge.

Extracted from bynkc as slice 1 of the crate-decomposition track (ADRs 0099 layering, 0102 foundation boundary). Behaviour is unchanged from when these modules lived in bynkc; bynkc now re-exports them so its public API is preserved.

Re-exports§

pub use error::CompileError;
pub use error::Severity;
pub use error::partition_by_severity;

Modules§

ast
Abstract syntax tree types for Bynk v0 (spec §9.2).
decimal
Compile-time Decimal arithmetic helpers (#2622): the comparison and sign tests the checker needs to evaluate a decimal literal against a refinement (Positive, NonNegative, InRange). A decimal here is an optionally --prefixed coefficient string and a scale; the runtime owns the real arithmetic (bynk-emit/runtime/src/decimal.ts).
diagnostics
Central registry of diagnostic codes.
error
Compiler diagnostics.
fix
Selecting and applying the machine-applicable suggestions of a file’s diagnostics — the rule behind the editor’s source.fixAll.bynk (#2100 slice 6) and bynk check --fix (#2642), which share it so the two cannot drift.
keywords
Registry of reserved keywords.
lexer
Lexer for Bynk v0.
parser
Hand-written recursive-descent parser for Bynk v0.
print
The expression/pattern/statement printer: renders a parsed AST fragment back to Bynk source text.
semantic_tokens
The semantic-token legend’s names: the single source for the language server’s legend and for the editor contract (cargo xtask editor-contract).
span
Source position spans.