2021-06-30 01:42:56 +00:00
|
|
|
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
|
|
|
pub struct Span {
|
|
|
|
pub start: usize,
|
|
|
|
pub end: usize,
|
2021-07-03 03:11:24 +00:00
|
|
|
pub file_id: usize,
|
2021-06-30 01:42:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
impl Span {
|
2021-07-03 03:11:24 +00:00
|
|
|
pub fn new(start: usize, end: usize, file_id: usize) -> Span {
|
|
|
|
Span {
|
|
|
|
start,
|
|
|
|
end,
|
|
|
|
file_id,
|
|
|
|
}
|
2021-06-30 01:42:56 +00:00
|
|
|
}
|
2021-07-01 00:01:04 +00:00
|
|
|
|
|
|
|
pub fn unknown() -> Span {
|
2021-07-03 03:11:24 +00:00
|
|
|
Span {
|
|
|
|
start: usize::MAX,
|
|
|
|
end: usize::MAX,
|
|
|
|
file_id: usize::MAX,
|
|
|
|
}
|
2021-07-01 00:01:04 +00:00
|
|
|
}
|
2021-06-30 01:42:56 +00:00
|
|
|
}
|