lutra_compiler/codespan/mod.rs
1mod edit;
2mod line_numbers;
3mod span;
4
5pub use edit::{TextEdit, apply_text_edits, minimize_text_edits, offset_text_edits};
6pub use line_numbers::LineNumbers;
7pub use span::Span;
8
9/// A position within a source file.
10#[derive(Debug, Clone, Copy, PartialEq, Eq)]
11pub struct LineColumn {
12 /// 0-index of the line
13 pub line: u32,
14 /// 0-index of the column in UTF16 code units.
15 /// (number of UTF16 code units before this position on the current line)
16 pub column: u32,
17}
18
19/// A range of a source file.
20#[derive(Debug, Clone)]
21pub struct Range {
22 pub start: LineColumn,
23 pub end: LineColumn,
24}