-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathline.rs
51 lines (46 loc) · 1019 Bytes
/
line.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
use super::annotation::Annotation;
use crate::annotation::AnnotationType;
use std::ops::Range;
#[derive(Debug, Clone)]
pub enum DisplayLine<'d> {
Source {
lineno: Option<usize>,
inline_marks: Vec<DisplayMark>,
line: DisplaySourceLine<'d>,
},
Raw(DisplayRawLine<'d>),
}
#[derive(Debug, Clone)]
pub enum DisplaySourceLine<'d> {
Content {
text: &'d str,
},
Annotation {
annotation: Annotation<'d>,
range: Range<usize>,
},
Empty,
}
#[derive(Debug, Clone)]
pub enum DisplayRawLine<'d> {
Origin {
path: &'d str,
pos: (Option<usize>, Option<usize>),
},
Annotation {
annotation: Annotation<'d>,
source_aligned: bool,
continuation: bool,
},
}
#[derive(Debug, Clone)]
pub struct DisplayMark {
pub mark_type: DisplayMarkType,
pub annotation_type: AnnotationType,
}
#[derive(Debug, Clone)]
pub enum DisplayMarkType {
AnnotationThrough,
AnnotationStart,
AnnotationEnd,
}