pub const IDENT_REGEX: &str = "[a-zA-Z$_][a-zA-Z0-9$_]*";
#[inline]
pub const fn is_id_start(c: char) -> bool {
matches!(c, 'a'..='z' | 'A'..='Z' | '_' | '$')
}
#[inline]
pub const fn is_id_continue(c: char) -> bool {
matches!(c, 'a'..='z' | 'A'..='Z' | '0'..='9' | '_' | '$')
}
pub fn is_valid_identifier<S: AsRef<str>>(s: S) -> bool {
fn is_valid_identifier(s: &str) -> bool {
let mut chars = s.chars();
if let Some(first) = chars.next() {
is_id_start(first) && chars.all(is_id_continue)
} else {
false
}
}
is_valid_identifier(s.as_ref())
}