bynk-render
The shared diagnostic-rendering layer for the Bynk compiler.
Given a slice of bynk_syntax::CompileError plus the source and a filename, it
produces the human and machine forms of a Bynk diagnostic:
- human — rich, source-pointing
ariadneoutput (with a colourless variant for byte-stable transcripts), and short— one tersepath:line:col: severity[category]: messageline per error, the format the editor problem-matcher parses.
The per-line pieces (short_line, severity_word) are public too, so a
front-end composing its own line output stays byte-identical to short.
Both CLI front-ends render through this one crate, so bynkc and bynk
display the same error identically — and the short form is what the VS Code
problem-matcher parses. The crate is a
pure presentation layer: it depends on
bynk-syntax only (plus ariadne)
and never sees the checker or emitter — structured diagnostics flow down into
it, never the other way.
Where it sits
bynk-render sits directly on the bynk-syntax leaf:
bynk-syntax lexer, parser, AST, CompileError, diagnostic codes
├── bynk-project project model: discovery, unit graph, paths
├── bynk-ts the TypeScript tree and its printer
├── bynk-render diagnostic rendering
├── bynk-fmt the formatter
└── bynk-check name resolution and type checking + project
├── bynk-ir declaration-level IR
│ └── bynk-lower AST → IR helpers
├── bynk-emit build sequencing, TS emission + ts, ir, lower, project
│ ├── bynk-strip TS → JS type-stripping + ts
│ └── bynk-driver shared CLI command bodies + fmt, render, ts
└── bynk-ide non-bailing editor analysis + project, fmt
Each crate depends on its parent in the tree, plus any crates listed after
its +. The front-ends sit on top: the bynkc and bynk CLIs over
bynk-driver, the bynkc-lsp language server (bynk-lsp) over bynk-ide, and
the unpublished bynk-wasm playground module over bynk-emit, bynk-strip,
and bynk-ide.
Most users see this crate's output through the
bynkc / bynk
CLIs (via bynk-driver) rather than
depending on it directly.
Use
[]
= "0.303"
// `errors: &[bynk_syntax::CompileError]`, with the source and a label.
print_errors; // ariadne, to stderr
let short = render_errors_short;
See the API docs for the full surface.
License
Licensed under either of Apache-2.0 or MIT at your option.