Crate unicode_id

source ·
Expand description

Determine if a char is a valid identifier for a parser and/or lexer according to Unicode Standard Annex #31 rules.

use unicode_id::UnicodeID;

fn main() {
    let ch = 'a';
    println!("Is {} a valid start of an identifier? {}", ch, UnicodeID::is_id_start(ch));
}

§features

unicode-id supports a no_std feature. This eliminates dependence on std, and instead uses equivalent functions from core.

Constants§

Traits§

  • Methods for determining if a character is a valid identifier character.