fix: Recognize Self as a proper keyword

This commit is contained in:
Lukas Wirth 2022-03-05 23:20:06 +01:00
parent 8f504dc873
commit c0d6471143
27 changed files with 98 additions and 49 deletions

View file

@ -327,7 +327,7 @@ fn traverse(
// as otherwise we won't ever visit them
match (token.kind(), parent.kind()) {
(T![ident], NAME | NAME_REF) => parent.into(),
(T![self] | T![super] | T![crate], NAME_REF) => parent.into(),
(T![self] | T![super] | T![crate] | T![Self], NAME_REF) => parent.into(),
(INT_NUMBER, NAME_REF) => parent.into(),
(LIFETIME_IDENT, LIFETIME) => parent.into(),
_ => token.into(),