#text #unicode #xid

no-std unicode-xid

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

8 releases

Uses old Rust 2015

0.2.2 Apr 29, 2021
0.2.1 Jun 24, 2020
0.2.0 Jul 25, 2019
0.1.0 May 8, 2017
0.0.1 Apr 27, 2015

#58 in Text processing

Download history 731054/week @ 2021-04-08 707049/week @ 2021-04-15 691867/week @ 2021-04-22 773968/week @ 2021-04-29 818047/week @ 2021-05-06 754905/week @ 2021-05-13 760537/week @ 2021-05-20 750515/week @ 2021-05-27 770356/week @ 2021-06-03 783174/week @ 2021-06-10 776431/week @ 2021-06-17 746948/week @ 2021-06-24 729442/week @ 2021-07-01 760402/week @ 2021-07-08 768484/week @ 2021-07-15 748470/week @ 2021-07-22

3,071,017 downloads per month
Used in 31,971 crates (76 directly)

MIT/Apache

57KB
1.5K SLoC

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.

changelog

0.2.2

  • Add an ASCII fast-path

0.2.1

  • Update to Unicode 13.0.0
  • Speed up lookup

0.2.0

  • Update to Unicode 12.1.0.

0.1.0

  • Initial release.

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.

No runtime deps