Parse let and number expression.

This commit is contained in:
2026-11-14 14:47:23 +01:00
parent a33cce2592
commit 8bf11b4f2a
6 changed files with 322 additions and 4 deletions
+11 -1
View File
@@ -1,4 +1,4 @@
#[derive(Debug, PartialEq, Eq)]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct Span {
start: usize,
end: usize,
@@ -22,6 +22,12 @@ impl Span {
}
}
impl Default for Span {
fn default() -> Self {
Span { start: 0, end: 0 }
}
}
#[derive(Debug, PartialEq, Eq)]
pub struct Spanned<T> {
node: T,
@@ -40,4 +46,8 @@ impl<T> Spanned<T> {
pub fn span(&self) -> &Span {
&self.span
}
pub fn span_to(&self, other: &Spanned<T>) -> Span {
Span::new(self.span.start(), other.span.end())
}
}