fix: Strip unused token ids from eager macro input token maps

This commit is contained in:
Lukas Wirth 2023-07-31 17:12:17 +02:00
parent bf5624664d
commit c7b34e4873
5 changed files with 37 additions and 7 deletions

View file

@ -117,4 +117,8 @@ impl TokenMap {
TokenTextRange::Delimiter(_) => None,
})
}
pub fn filter(&mut self, id: impl Fn(tt::TokenId) -> bool) {
self.entries.retain(|&(tid, _)| id(tid));
}
}