aura_lang/span.rs
1pub type SourceId = u32;
2
3/// Byte offsets into the source (SPEC §2.1).
4#[derive(Debug, Clone, Copy, PartialEq, Eq)]
5pub struct Span {
6 pub source: SourceId,
7 pub start: u32,
8 pub end: u32,
9}
10
11impl Span {
12 pub fn new(source: SourceId, start: usize, end: usize) -> Self {
13 Span {
14 source,
15 start: start as u32,
16 end: end as u32,
17 }
18 }
19}