#text #unicode #xid

no-std unicode-xid

Determine whether characters have the XID_Start or XID_Continue properties according to Unicode Standard Annex #31

5 releases

0.1.0 May 8, 2017
0.0.4 Dec 24, 2016
0.0.3 Aug 20, 2015
0.0.2 Jul 9, 2015
0.0.1 Apr 27, 2015

#1 in Text processing

Download history 78067/week @ 2018-09-14 82833/week @ 2018-09-21 80188/week @ 2018-09-28 84454/week @ 2018-10-05 82306/week @ 2018-10-12 90157/week @ 2018-10-19 86110/week @ 2018-10-26 92143/week @ 2018-11-02 93773/week @ 2018-11-09 96572/week @ 2018-11-16 92312/week @ 2018-11-23 92272/week @ 2018-11-30 85610/week @ 2018-12-07

256,617 downloads per month
Used in 5,647 crates (28 directly)

MIT/Apache

51KB
659 lines

unicode-xid

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

Build Status

Documentation

extern crate unicode_xid;

use unicode_xid::UnicodeXID;

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

features

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

crates.io

You can use this package in your project by adding the following to your Cargo.toml:

[dependencies]
unicode-xid = "0.0.4"

lib.rs:

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

extern crate unicode_xid;

use unicode_xid::UnicodeXID;

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

features

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

crates.io

You can use this package in your project by adding the following to your Cargo.toml:

[dependencies]
unicode-xid = "0.0.4"

No runtime deps