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