pub fn is_valid_c_identifier(name: &MuName) -> bool {
    let mut i = 0;
    let mut underscore = false; // whether the first character is an underscore
    for c in name.chars() {
        match c {
            '_' => {
                if i == 0 {
                    underscore = true;
                } else if i == 1 && underscore {
                    return false;
                }
            }
            '0'...'9' => {
                if i == 0 {
                    return false;
                }
            }
            'a'...'z' | 'A'...'Z' => {}
            _ => {
                return false;
            }
        }
        i += 1;
    }
    return true;
}
/// returns true if name is a valid_c identifier
/// (i.e. it contains only ASCII letters, digits and underscores
/// and does not start with "__" or an digit.
returns true if name is a valid_c identifier
(i.e. it contains only ASCII letters, digits and underscores
and does not start with "__" or an digit.
returns true if name is a valid_c identifier ( i . e . it contains only ASCII letters digits and underscores and does not start with " __ " or an digit .
pub fn is_valid_c_identifier(name: &MuName) -> bool {
    let mut i = 0;
    let mut underscore = false; // whether the first character is an underscore
    for c in name.chars() {
        match c {
            '_' => {
                if i == 0 {
                    underscore = true;
                } else if i == 1 && underscore {
                    return false;
                }
            }
            '0'...'9' => {
                if i == 0 {
                    return false;
                }
            }
            'a'...'z' | 'A'...'Z' => {}
            _ => {
                return false;
            }
        }
        i += 1;
    }
    return true;
}
pub fn is_valid_c_identifier ( name : & MuName ) -> bool { let mut i = 0 ; let mut underscore = false ; // whether the first character is an underscore for c in name . chars ( ) { match c { '_' => { if i == 0 { underscore = true ; } else if i == 1 && underscore { return false ; } } '0' ... '9' => { if i == 0 { return false ; } } 'a' ... 'z' | 'A' ... 'Z' => { } _ => { return false ; } } i += 1 ; } return true ; }
returns true if name is a valid_c identifier
(i.e.
returns true if name is a valid_c identifier ( i . e .
name
&MuName
name
&MuName