Fix the eager token maps by re-mapping the textranges between the input and input expansion

This commit is contained in:
Lukas Wirth 2023-07-13 09:17:07 +02:00
parent 2366c16bf9
commit 6a7b905c86
18 changed files with 434 additions and 157 deletions

View file

@ -110,4 +110,11 @@ impl TokenMap {
// FIXME: This could be accidentally quadratic
self.entries.remove(idx);
}
pub fn entries(&self) -> impl Iterator<Item = (tt::TokenId, TextRange)> + '_ {
self.entries.iter().filter_map(|&(tid, tr)| match tr {
TokenTextRange::Token(range) => Some((tid, range)),
TokenTextRange::Delimiter(_) => None,
})
}
}