VOID Diagnostics

Precise errors.
Shared compiler ranges.

Explicit start/end source spans flow through lexing and parsing, and lexer, parser, semantic analysis, and voidc check all report through the same ranged diagnostic model.

Source locations

An error points at the source region that actually failed.

Source spans retain byte offset, line, and column at both ends. Ranges are end-exclusive, matching the range model used by editor/LSP protocols while remaining useful to the normal command line today.

Semantic diagnostic
error: Program.void:5:21-5:33: unknown identifier 'MissingValue'

Exact token spans

Identifiers, literals, punctuation, operators, and EOF receive deterministic start/end ranges directly from the lexer.

One diagnostic shape

Lexer, parser, and semantic failures share source path, source span, and message instead of maintaining separate public error models.

Multi-line ranges

Failures such as unterminated block comments retain the complete offending source region.

Syntax/type spans

AST nodes and type references retain spans, including generic, nullable, pointer, and array suffixes.

voidc check

Front-end-only validation reports the same ranged parser and semantic diagnostics without generating C or invoking a native compiler.

Live editor diagnostics

The same diagnostic objects publish through LSP for unsaved text, carry document versions, convert UTF-8 source offsets to UTF-16 editor positions, and clear when source becomes valid or closes.

Stable diagnostic contracts

User-facing messages describe the invalid or unsupported language construct itself rather than exposing historical internal milestone labels, so diagnostics remain meaningful as the compiler evolves.

Compiler to editor

The same ranges now drive live editor feedback.

voidc lsp publishes lexer, parser, and semantic diagnostics directly from in-memory editor text. Changes replace stale errors, valid source clears them, closing a document clears its diagnostics, and dependent project documents are refreshed when another open file changes. Hover, completion, navigation, references, and symbols sit on the same source/semantic foundation.

Token ranges
1:1-1:7 public             "public"
1:8-1:13 class             "class"