diff options
| author | Martin Haug <mhaug@live.de> | 2021-11-27 16:10:22 +0100 |
|---|---|---|
| committer | Martin Haug <mhaug@live.de> | 2021-11-27 16:10:22 +0100 |
| commit | edc686d7384470068858e16f2926cf50f31b2c90 (patch) | |
| tree | 00648e8e6e1873ebb7241352cb88881ce323d067 /src/syntax/span.rs | |
| parent | fdb9d0743d73c278136b9254286fdc4be71c42a5 (diff) | |
Make incremental parsing simpler and move it somewhere else
Diffstat (limited to 'src/syntax/span.rs')
| -rw-r--r-- | src/syntax/span.rs | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/src/syntax/span.rs b/src/syntax/span.rs index 2691acc7..4d5b8819 100644 --- a/src/syntax/span.rs +++ b/src/syntax/span.rs @@ -125,18 +125,6 @@ impl Span { *self = self.join(other) } - /// Create a new span by specifying a span in which a modification happened - /// and how many characters are now in that span. - pub fn inserted(mut self, other: Self, n: usize) -> Self { - if !self.surrounds(other) { - panic!(); - } - - let len_change = n as isize - other.len() as isize; - self.end += len_change as usize; - self - } - /// Test whether a position is within the span. pub fn contains(&self, pos: usize) -> bool { self.start <= pos && self.end >= pos |
