mirror of
https://github.com/Noratrieb/dilaria.git
synced 2026-01-15 18:05:03 +01:00
stmt parse
This commit is contained in:
parent
67e6dfccc2
commit
c5b82c4b18
7 changed files with 884 additions and 733 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue