aboutsummaryrefslogtreecommitdiffstats
path: root/src/util/edit_map.rs
diff options
context:
space:
mode:
authorLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-29 10:26:39 +0200
committerLibravatar Titus Wormer <tituswormer@gmail.com>2022-06-29 10:26:39 +0200
commit7721f210c16e19b1c2af90f69130386b89bb5104 (patch)
treec47ff3d9c974ccd0c81a2c5b8ccbce9f7635975d /src/util/edit_map.rs
parent7bb1008f508f61b51dd80086a91ada347be36c68 (diff)
downloadmarkdown-rs-7721f210c16e19b1c2af90f69130386b89bb5104.tar.gz
markdown-rs-7721f210c16e19b1c2af90f69130386b89bb5104.tar.bz2
markdown-rs-7721f210c16e19b1c2af90f69130386b89bb5104.zip
Add support for sharing identifiers, references before definitions
Diffstat (limited to '')
-rw-r--r--src/util/edit_map.rs19
1 files changed, 1 insertions, 18 deletions
diff --git a/src/util/edit_map.rs b/src/util/edit_map.rs
index 8136306..db9c887 100644
--- a/src/util/edit_map.rs
+++ b/src/util/edit_map.rs
@@ -71,31 +71,14 @@ impl EditMap {
assert!(!self.consumed, "cannot consume after consuming");
self.consumed = true;
- let mut index = 0;
-
- while index < events.len() {
- let event = &events[index];
- println!(
- "ev: {:?} {:?} {:?} {:?} {:?} {:?}",
- index,
- event.event_type,
- event.token_type,
- event.content_type,
- event.previous,
- event.next
- );
- index += 1;
- }
-
indices.sort_unstable();
let mut jumps: Vec<(usize, isize)> = vec![];
let mut index_into_indices = 0;
- let mut shift: isize = 0;
+ let mut shift = 0;
while index_into_indices < indices.len() {
let index = *indices[index_into_indices];
let edit = self.map.get(&index).unwrap();
- println!("?? {:?} {:?} {:?}", shift, edit.1.len(), edit.0);
#[allow(clippy::pedantic)]
let next = shift + (edit.1.len() as isize) - (edit.0 as isize);