replace codespan-reporting with miette 3.0

This commit is contained in:
Kat Marchán
2021-09-20 14:37:26 -07:00
parent cbe85cbeaf
commit a1d6cefdf8
14 changed files with 514 additions and 578 deletions

View File

@ -1,9 +1,17 @@
use miette::SourceSpan;
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub struct Span {
pub start: usize,
pub end: usize,
}
impl From<Span> for SourceSpan {
fn from(s: Span) -> Self {
Self::new(s.start.into(), (s.end - s.start).into())
}
}
impl Span {
pub fn new(start: usize, end: usize) -> Span {
Span { start, end }