#xid #unicode #unicode-text #text

no-std unicode-xid

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

12 releases

Uses old Rust 2015

0.2.6 Sep 19, 2024
0.2.4 Sep 15, 2022
0.2.3 May 2, 2022
0.2.2 Apr 29, 2021
0.0.2 Jul 9, 2015

#241 in Text processing

Download history 1752511/week @ 2025-01-28 2175615/week @ 2025-02-04 1943437/week @ 2025-02-11 1951076/week @ 2025-02-18 1942907/week @ 2025-02-25 2425602/week @ 2025-03-04 2320514/week @ 2025-03-11 2480974/week @ 2025-03-18 2603491/week @ 2025-03-25 2470594/week @ 2025-04-01 2702138/week @ 2025-04-08 2274266/week @ 2025-04-15 2303206/week @ 2025-04-22 2171976/week @ 2025-04-29 2317692/week @ 2025-05-06 1981830/week @ 2025-05-13

9,107,046 downloads per month
Used in 17,574 crates (122 directly)

MIT/Apache

62KB
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.6

  • Update to Unicode 16.0.0.

0.2.5

  • Update to Unicode 15.1.0.

0.2.4

  • Update to Unicode 15.0.0.
  • Replace const tables with static tables.

0.2.3

  • Update to Unicode 14.0.0.

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.

No runtime deps