ts_error/diagnostic/
span.rs1#[derive(Debug, Clone, Copy, PartialEq, Eq)]
4pub struct Span {
6 pub line: usize,
8 pub column: usize,
10 pub length: usize,
12}
13impl Default for Span {
14 fn default() -> Self {
15 Self {
16 line: 1,
17 column: 1,
18 length: 1,
19 }
20 }
21}
22impl Span {
23 pub fn line(mut self, line: usize) -> Self {
25 self.line = line;
26 self
27 }
28
29 pub fn column(mut self, column: usize) -> Self {
31 self.column = column;
32 self
33 }
34
35 pub fn length(mut self, length: usize) -> Self {
37 self.length = length;
38 self
39 }
40}