Expand description
The source registry: maps a FileId to its source text and display path.
Every Span carries a FileId indexing into a Sources.
Single-file scripts build a registry with one entry; multi-file packages add
one per module. Diagnostics resolve a span back to (path, text, line index)
through this registry so they can render --> util.subm:5:12 for the right file.
Structs§
- Module
Path - A module’s package-relative display path (e.g.
util,internal/math). For single-file scripts this is just the script filename. A thin newtype today; later multi-file steps extend it with resolution helpers. - Source
File - One source file: its display path, full text, and a pre-built line index for span → line/col resolution.
- Sources
- Registry of every source file in a compilation, indexed by
FileId.
Enums§
- Relative
Import Error - Error from resolving a relative import specifier against an importer’s path.
- Source
Error
Functions§
- is_
relative_ specifier - True for ES-style relative-path specifiers (
./…,../…). Package specifiers (submilli:http,@org/pkg,@mcp/x) never match — none start with./or../. Bare./..(no trailing/) are intentionally not treated as relative imports.