dtolnay / syn

Parser for Rust source code
Apache License 2.0
2.78k stars 306 forks source link

Optimize reverse iteration of TokenBuffer #1681

Closed dtolnay closed 1 month ago

dtolnay commented 1 month ago

Previously, jumping forward from a Entry::Group to the matching Entry::End was cheap, but jumping backward from Entry::End to the matching Entry::Group required a linear scan of all the tokens in between.