internal: Properly check the edition for edition dependent syntax kinds

This commit is contained in:
Lukas Wirth 2024-08-15 14:50:57 +02:00
parent 2b86639018
commit f90bdfc13d
23 changed files with 348 additions and 130 deletions

View file

@ -2,7 +2,7 @@
use crate::SyntaxKind;
pub fn is_raw_identifier(name: &str) -> bool {
let is_keyword = SyntaxKind::from_keyword(name).is_some();
pub fn is_raw_identifier(name: &str, edition: parser::Edition) -> bool {
let is_keyword = SyntaxKind::from_keyword(name, edition).is_some();
is_keyword && !matches!(name, "self" | "crate" | "super" | "Self")
}