syntax/utils.rs
1//! A set of utils methods to reuse on other abstraction levels
2
3use crate::SyntaxKind;
4
5#[inline]
6pub fn is_raw_identifier(name: &str, edition: parser::Edition) -> bool {
7 let is_keyword = SyntaxKind::from_keyword(name, edition).is_some();
8 is_keyword && !matches!(name, "self" | "crate" | "super" | "Self")
9}