feat: add better diagnostic rendering
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
use std::fmt::Display;
|
||||
use std::{fmt::Display, ops::Range};
|
||||
|
||||
/// A half-open interval `[start, end)` representing a location in the source text.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
@@ -23,6 +23,12 @@ impl Span {
|
||||
}
|
||||
}
|
||||
|
||||
impl From<Span> for Range<usize> {
|
||||
fn from(value: Span) -> Self {
|
||||
value.start..value.end
|
||||
}
|
||||
}
|
||||
|
||||
/// A fundamental, categorized unit of source code produced during lexical analysis.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
|
||||
pub struct Token<'src> {
|
||||
|
||||
Reference in New Issue
Block a user