logos.lang.unicode

Module lang · package logos-lang

Types

enumGeneralCategory

enum GeneralCategory

Subset of Unicode general-category codes. Variants mirror UCD GC abbreviations (as in Rust’s core::unicode::category::Category); only the categories our scaffolded tables populate are exposed — the rest map to Other (Cn = unassigned).

Variants

Cc
Ll
Lo
Lu
Nd
Other
Po
Sc
Sm
So
Zs

Functions

fnunicode_general_category

fn unicode_general_category(cp: u32) -> GeneralCategory

Returns the Unicode general category of codepoint cp. Accurate only for ASCII + Latin-1 Supplement (U+0000–U+00FF), with Pd/Ps/Pe lumped into Po; every codepoint above U+00FF maps to GeneralCategory::Other.

fnunicode_is_alphabetic

fn unicode_is_alphabetic(cp: u32) -> bool

Returns true if cp is a letter (Lu, Ll, or Lo). Category coverage stops at U+00FF; letters above that return false.

fnunicode_is_control

fn unicode_is_control(cp: u32) -> bool

Returns true if cp is a control code (Cc): U+0000–U+001F or U+007F–U+009F. Exact for all of Unicode — Cc exists only in those ranges.

fnunicode_is_lowercase

fn unicode_is_lowercase(cp: u32) -> bool

Returns true if cp is a lowercase letter (Ll). Category coverage stops at U+00FF; lowercase letters above that return false.

fnunicode_is_numeric

fn unicode_is_numeric(cp: u32) -> bool

Returns true if cp is a decimal digit (Nd). With the current table only ASCII 09 qualify.

fnunicode_is_uppercase

fn unicode_is_uppercase(cp: u32) -> bool

Returns true if cp is an uppercase letter (Lu). Category coverage stops at U+00FF; uppercase letters above that return false.

fnunicode_is_whitespace

fn unicode_is_whitespace(cp: u32) -> bool

Returns true if cp has the Unicode White_Space property. Uses an explicit full list (not limited to U+00FF), but omits U+0085 (NEL), unlike UCD and Rust’s char::is_whitespace.