pub(super) fn needs_backtick_quoting(name: &str) -> bool {
if name.is_empty() {
return false;
}
let mut chars = name.chars();
let first = chars.next().unwrap();
if !first.is_ascii_alphabetic() && first != '.' {
return true;
}
if first == '.'
&& let Some(second) = chars.next()
{
if second.is_ascii_digit() {
return true;
}
if !second.is_ascii_alphanumeric() && second != '.' && second != '_' {
return true;
}
}
for c in chars {
if !c.is_ascii_alphanumeric() && c != '.' && c != '_' {
return true;
}
}
false
}
pub(super) fn has_special_suffix(s: &str) -> bool {
s.ends_with("::")
|| s.ends_with("<-")
|| s.ends_with("<<-")
|| s.ends_with("()")
|| s.ends_with('(')
|| s.ends_with('/')
|| s.ends_with(" = ")
|| s.ends_with("=")
}