Create new objects with existing span
I've decided that attempting to create smaller spans is more difficult and will also lead to worse error messages later on. It makes more sense to just tag every newly created syntax tree element with the span of the element it comes from.
This commit is contained in:
parent
5c8dd1969f
commit
b84d5ae0c8
3 changed files with 19 additions and 32 deletions
|
|
@ -24,14 +24,6 @@ impl Span {
|
|||
let end = self.end.max(other.end);
|
||||
Self::new(start, end)
|
||||
}
|
||||
|
||||
pub fn at_start(self) -> Self {
|
||||
Self::new(self.start, self.start)
|
||||
}
|
||||
|
||||
pub fn at_end(self) -> Self {
|
||||
Self::new(self.end, self.end)
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for Span {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue