/// Span represents a range of a piece of source code.
/// It counts by byte offset, so it's 0-based.
////// Offsets are `u32` (matching oxc convention); sources larger than 4 GiB are
/// rejected by the parser up front.
#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq)]pubstructSpan{/// Start offset. (Inclusive)
pubstart:u32,
/// End offset. (Exclusive)
pubend:u32,
}implSpan{pubfnnew(start:u32, end:u32)->Self{Self{ start, end }}/// A zero-width span at the given offset. Covers no characters, but its
/// position may still be meaningful (e.g. a marker between two tokens).
pubfnempty(at:u32)->Self{Self{ start: at, end: at }}/// The source text this span covers.
pubfnslice(self, source:&str)->&str{&source[self.start asusize..self.end asusize]}/// Whether the span covers no characters. An empty span's position may
/// still be meaningful (e.g. a synthesized token).
pubfnis_empty(self)->bool{self.start ==self.end
}}