stmt parse

This commit is contained in:
nora 2021-10-31 13:59:47 +01:00
parent 67e6dfccc2
commit c5b82c4b18
7 changed files with 884 additions and 733 deletions

View file

@ -47,6 +47,15 @@ mod span {
}
}
/// Extends the span by the second one, if it exists
/// The other one has to be after the current one, if it exists
pub fn option_extend(&self, other: Option<Span>) -> Span {
match other {
None => *self,
Some(span) => self.extend(span),
}
}
pub fn len(&self) -> usize {
self.end - self.start
}