update blocklike

This commit is contained in:
jnyfah 2025-01-16 12:11:55 +01:00
parent 11717ca5d4
commit e3deeec2f2
5 changed files with 10 additions and 13 deletions

View file

@ -391,9 +391,7 @@ impl CompletedMarker {
pub(crate) fn last_token(&self, p: &Parser<'_>) -> Option<SyntaxKind> {
let end_pos = self.end_pos as usize;
if end_pos > p.events.len() {
return None;
}
debug_assert_eq!(p.events[end_pos - 1], Event::Finish);
p.events[..end_pos].iter().rev().find_map(|event| match event {
Event::Token { kind, .. } => Some(*kind),
_ => None,