Source Metadata¶
Accepted
Accepted for V1 source-location metadata needed by diagnostics, navigation, and documentation; direct source-text access is deferred.
Reflection metadata may refer back to source locations for diagnostics and tooling. Source locations are file plus byte span:
const SourceLocation = struct {
file: SourceFile
span: SourceSpan
}
const SourceSpan = struct {
start_byte: usize
end_byte: usize
}
const SourceFile = struct {
path: []const u8
module: ?Module
}
Line and column positions are computed by tooling from the source file contents instead of stored in reflection metadata. SourceFile exposes stable identity, path, and module information for diagnostics. Direct source text access is deferred or capability-gated because it affects comptime resource and cache behavior.
Source locations are for diagnostics and navigation, not semantic identity or ordering. Declared source items have source locations. Compiler-generated, synthetic, or builtin metadata may use null source locations unless useful compiler or prelude metadata is available.