Expand description
bynk-fmt — the Bynk formatter.
A real leaf crate: the formatter is an AST-walk over the bynk-syntax
types, so it depends on bynk-syntax only and never links the compiler
(resolver/checker/emitter). Slice 2 of the crate-decomposition track moved
the implementation down here from bynkc::fmt and re-pointed it onto the
bynk-syntax leaf, turning the former cosmetic façade into the home of the
formatter itself. bynkc now depends on this crate and re-exports it as
bynkc::fmt for its own bynkc fmt command.
Structs§
- Format
Error - Error returned when formatting fails. The formatter cannot format code that does not parse, so all failure modes here surface as parse errors.
- Format
Options - Formatter options. All fields have spec-defined defaults.
Enums§
- Indent
Style - Indentation style: tabs or spaces. Mirrors the LSP spec’s
[fmt].indentsetting.
Functions§
- format_
source - Format a Bynk source string. On parse failure, returns the original source unchanged is not this function’s responsibility — callers (LSP, CLI) decide how to handle parse failure. Here we surface the errors so the caller can do so.