Skip to main content

Crate bock_errors

Crate bock_errors 

Source
Expand description

Bock errors — diagnostic types, span, file-id, and error reporting infrastructure.

Span and FileId are defined here (not in bock-source) to avoid circular dependencies. Every crate in the pipeline uses these types transitively.

Modules§

catalog
Catalog of diagnostic codes emitted by the compiler.

Structs§

Diagnostic
A structured compiler diagnostic.
DiagnosticBag
Accumulates diagnostics emitted during a compilation pass.
DiagnosticCode
A structured diagnostic code like E0001 or W0042.
FileId
Identifies a source file within the compilation session.
Label
A secondary label pointing at a span with an explanatory message.
Span
A byte-offset span within a source file.

Enums§

Severity
Diagnostic severity level.

Functions§

color_enabled_for_diagnostics
should_colorize wired to the real environment: reads NO_COLOR and probes stderr (the stream the CLI prints rendered diagnostics to).
levenshtein
Levenshtein edit distance between two strings.
render
Render a slice of diagnostics to a string using ariadne for source context.
render_with_color
Render diagnostics with an explicit color decision.
should_colorize
Decide whether diagnostic rendering should include ANSI color escapes.
suggest_similar
Find the closest candidate within max_distance edits of name.