1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//! Source spans — byte ranges into a source file, for diagnostics and
//! (later) runtime error provenance.
//!
//! Value types only. A `Span` is **never** embedded in a `Term` variant, so
//! `Term`'s `PartialEq`/identity is unaffected — spans annotate the AST from
//! the outside (`Spanned<T>`), they don't change what a term *is*.
//!
//! Line/column is deliberately not stored here: it is a presentation concern
//! resolved from the source text at format time (see `plg_frontend`'s
//! `SourceMap`). Byte offsets are the stable representation.
/// Identifies a source file. Single-buffer today (always `0`); multi-file
/// mapping arrives with `plgc build`'s concatenated inputs.
pub type FileId = u32;
/// A byte range `[lo, hi)` into a source file.
/// A value annotated with its source span — carries spans alongside the AST
/// without putting one inside `Term` itself.
///
/// Consumers: the parser's spanned body conjuncts (`Spanned<Term>`, codegen
/// path) and the compiler's lowered goal IR (`type LGoal = Spanned<LGoalKind>`,
/// SPANS.md Layer 3), where every goal carries its source span so raising
/// call sites get `site_id` provenance with no per-variant plumbing. The
/// undefined-call lint still uses the parser's flat `CallSite` occurrences.