pythonrs 0.1.14

Python as a fusevm frontend: lexer, parser, and compiler to fusevm::Chunk on a PyHost heap — the first compiled standalone Python runtime
Documentation
//! Unicode full case-folding overrides (generated from CPython 3.14
//! `str.casefold`). Each entry is a codepoint whose fold differs from its simple
//! lowercase mapping — the multi-character "full" folds (e.g. `ß` -> `ss`) plus
//! the handful of single-char folds that lowercasing gets wrong. Every other
//! codepoint folds identically to `char::to_lowercase`, so `str.casefold` uses
//! this table only as an override and defers to lowercasing otherwise. Sorted by
//! codepoint for binary search; do not edit by hand.

/// `(codepoint, folded_string)` overrides, ascending by codepoint.
pub static CASEFOLD_OVERRIDES: &[(u32, &str)] = &[
    (0xb5, "\u{3bc}"),
    (0xdf, "ss"),
    (0x149, "\u{2bc}n"),
    (0x17f, "s"),
    (0x1f0, "j\u{30c}"),
    (0x345, "\u{3b9}"),
    (0x390, "\u{3b9}\u{308}\u{301}"),
    (0x3b0, "\u{3c5}\u{308}\u{301}"),
    (0x3c2, "\u{3c3}"),
    (0x3d0, "\u{3b2}"),
    (0x3d1, "\u{3b8}"),
    (0x3d5, "\u{3c6}"),
    (0x3d6, "\u{3c0}"),
    (0x3f0, "\u{3ba}"),
    (0x3f1, "\u{3c1}"),
    (0x3f5, "\u{3b5}"),
    (0x587, "\u{565}\u{582}"),
    (0x13a0, "\u{13a0}"),
    (0x13a1, "\u{13a1}"),
    (0x13a2, "\u{13a2}"),
    (0x13a3, "\u{13a3}"),
    (0x13a4, "\u{13a4}"),
    (0x13a5, "\u{13a5}"),
    (0x13a6, "\u{13a6}"),
    (0x13a7, "\u{13a7}"),
    (0x13a8, "\u{13a8}"),
    (0x13a9, "\u{13a9}"),
    (0x13aa, "\u{13aa}"),
    (0x13ab, "\u{13ab}"),
    (0x13ac, "\u{13ac}"),
    (0x13ad, "\u{13ad}"),
    (0x13ae, "\u{13ae}"),
    (0x13af, "\u{13af}"),
    (0x13b0, "\u{13b0}"),
    (0x13b1, "\u{13b1}"),
    (0x13b2, "\u{13b2}"),
    (0x13b3, "\u{13b3}"),
    (0x13b4, "\u{13b4}"),
    (0x13b5, "\u{13b5}"),
    (0x13b6, "\u{13b6}"),
    (0x13b7, "\u{13b7}"),
    (0x13b8, "\u{13b8}"),
    (0x13b9, "\u{13b9}"),
    (0x13ba, "\u{13ba}"),
    (0x13bb, "\u{13bb}"),
    (0x13bc, "\u{13bc}"),
    (0x13bd, "\u{13bd}"),
    (0x13be, "\u{13be}"),
    (0x13bf, "\u{13bf}"),
    (0x13c0, "\u{13c0}"),
    (0x13c1, "\u{13c1}"),
    (0x13c2, "\u{13c2}"),
    (0x13c3, "\u{13c3}"),
    (0x13c4, "\u{13c4}"),
    (0x13c5, "\u{13c5}"),
    (0x13c6, "\u{13c6}"),
    (0x13c7, "\u{13c7}"),
    (0x13c8, "\u{13c8}"),
    (0x13c9, "\u{13c9}"),
    (0x13ca, "\u{13ca}"),
    (0x13cb, "\u{13cb}"),
    (0x13cc, "\u{13cc}"),
    (0x13cd, "\u{13cd}"),
    (0x13ce, "\u{13ce}"),
    (0x13cf, "\u{13cf}"),
    (0x13d0, "\u{13d0}"),
    (0x13d1, "\u{13d1}"),
    (0x13d2, "\u{13d2}"),
    (0x13d3, "\u{13d3}"),
    (0x13d4, "\u{13d4}"),
    (0x13d5, "\u{13d5}"),
    (0x13d6, "\u{13d6}"),
    (0x13d7, "\u{13d7}"),
    (0x13d8, "\u{13d8}"),
    (0x13d9, "\u{13d9}"),
    (0x13da, "\u{13da}"),
    (0x13db, "\u{13db}"),
    (0x13dc, "\u{13dc}"),
    (0x13dd, "\u{13dd}"),
    (0x13de, "\u{13de}"),
    (0x13df, "\u{13df}"),
    (0x13e0, "\u{13e0}"),
    (0x13e1, "\u{13e1}"),
    (0x13e2, "\u{13e2}"),
    (0x13e3, "\u{13e3}"),
    (0x13e4, "\u{13e4}"),
    (0x13e5, "\u{13e5}"),
    (0x13e6, "\u{13e6}"),
    (0x13e7, "\u{13e7}"),
    (0x13e8, "\u{13e8}"),
    (0x13e9, "\u{13e9}"),
    (0x13ea, "\u{13ea}"),
    (0x13eb, "\u{13eb}"),
    (0x13ec, "\u{13ec}"),
    (0x13ed, "\u{13ed}"),
    (0x13ee, "\u{13ee}"),
    (0x13ef, "\u{13ef}"),
    (0x13f0, "\u{13f0}"),
    (0x13f1, "\u{13f1}"),
    (0x13f2, "\u{13f2}"),
    (0x13f3, "\u{13f3}"),
    (0x13f4, "\u{13f4}"),
    (0x13f5, "\u{13f5}"),
    (0x13f8, "\u{13f0}"),
    (0x13f9, "\u{13f1}"),
    (0x13fa, "\u{13f2}"),
    (0x13fb, "\u{13f3}"),
    (0x13fc, "\u{13f4}"),
    (0x13fd, "\u{13f5}"),
    (0x1c80, "\u{432}"),
    (0x1c81, "\u{434}"),
    (0x1c82, "\u{43e}"),
    (0x1c83, "\u{441}"),
    (0x1c84, "\u{442}"),
    (0x1c85, "\u{442}"),
    (0x1c86, "\u{44a}"),
    (0x1c87, "\u{463}"),
    (0x1c88, "\u{a64b}"),
    (0x1e96, "h\u{331}"),
    (0x1e97, "t\u{308}"),
    (0x1e98, "w\u{30a}"),
    (0x1e99, "y\u{30a}"),
    (0x1e9a, "a\u{2be}"),
    (0x1e9b, "\u{1e61}"),
    (0x1e9e, "ss"),
    (0x1f50, "\u{3c5}\u{313}"),
    (0x1f52, "\u{3c5}\u{313}\u{300}"),
    (0x1f54, "\u{3c5}\u{313}\u{301}"),
    (0x1f56, "\u{3c5}\u{313}\u{342}"),
    (0x1f80, "\u{1f00}\u{3b9}"),
    (0x1f81, "\u{1f01}\u{3b9}"),
    (0x1f82, "\u{1f02}\u{3b9}"),
    (0x1f83, "\u{1f03}\u{3b9}"),
    (0x1f84, "\u{1f04}\u{3b9}"),
    (0x1f85, "\u{1f05}\u{3b9}"),
    (0x1f86, "\u{1f06}\u{3b9}"),
    (0x1f87, "\u{1f07}\u{3b9}"),
    (0x1f88, "\u{1f00}\u{3b9}"),
    (0x1f89, "\u{1f01}\u{3b9}"),
    (0x1f8a, "\u{1f02}\u{3b9}"),
    (0x1f8b, "\u{1f03}\u{3b9}"),
    (0x1f8c, "\u{1f04}\u{3b9}"),
    (0x1f8d, "\u{1f05}\u{3b9}"),
    (0x1f8e, "\u{1f06}\u{3b9}"),
    (0x1f8f, "\u{1f07}\u{3b9}"),
    (0x1f90, "\u{1f20}\u{3b9}"),
    (0x1f91, "\u{1f21}\u{3b9}"),
    (0x1f92, "\u{1f22}\u{3b9}"),
    (0x1f93, "\u{1f23}\u{3b9}"),
    (0x1f94, "\u{1f24}\u{3b9}"),
    (0x1f95, "\u{1f25}\u{3b9}"),
    (0x1f96, "\u{1f26}\u{3b9}"),
    (0x1f97, "\u{1f27}\u{3b9}"),
    (0x1f98, "\u{1f20}\u{3b9}"),
    (0x1f99, "\u{1f21}\u{3b9}"),
    (0x1f9a, "\u{1f22}\u{3b9}"),
    (0x1f9b, "\u{1f23}\u{3b9}"),
    (0x1f9c, "\u{1f24}\u{3b9}"),
    (0x1f9d, "\u{1f25}\u{3b9}"),
    (0x1f9e, "\u{1f26}\u{3b9}"),
    (0x1f9f, "\u{1f27}\u{3b9}"),
    (0x1fa0, "\u{1f60}\u{3b9}"),
    (0x1fa1, "\u{1f61}\u{3b9}"),
    (0x1fa2, "\u{1f62}\u{3b9}"),
    (0x1fa3, "\u{1f63}\u{3b9}"),
    (0x1fa4, "\u{1f64}\u{3b9}"),
    (0x1fa5, "\u{1f65}\u{3b9}"),
    (0x1fa6, "\u{1f66}\u{3b9}"),
    (0x1fa7, "\u{1f67}\u{3b9}"),
    (0x1fa8, "\u{1f60}\u{3b9}"),
    (0x1fa9, "\u{1f61}\u{3b9}"),
    (0x1faa, "\u{1f62}\u{3b9}"),
    (0x1fab, "\u{1f63}\u{3b9}"),
    (0x1fac, "\u{1f64}\u{3b9}"),
    (0x1fad, "\u{1f65}\u{3b9}"),
    (0x1fae, "\u{1f66}\u{3b9}"),
    (0x1faf, "\u{1f67}\u{3b9}"),
    (0x1fb2, "\u{1f70}\u{3b9}"),
    (0x1fb3, "\u{3b1}\u{3b9}"),
    (0x1fb4, "\u{3ac}\u{3b9}"),
    (0x1fb6, "\u{3b1}\u{342}"),
    (0x1fb7, "\u{3b1}\u{342}\u{3b9}"),
    (0x1fbc, "\u{3b1}\u{3b9}"),
    (0x1fbe, "\u{3b9}"),
    (0x1fc2, "\u{1f74}\u{3b9}"),
    (0x1fc3, "\u{3b7}\u{3b9}"),
    (0x1fc4, "\u{3ae}\u{3b9}"),
    (0x1fc6, "\u{3b7}\u{342}"),
    (0x1fc7, "\u{3b7}\u{342}\u{3b9}"),
    (0x1fcc, "\u{3b7}\u{3b9}"),
    (0x1fd2, "\u{3b9}\u{308}\u{300}"),
    (0x1fd3, "\u{3b9}\u{308}\u{301}"),
    (0x1fd6, "\u{3b9}\u{342}"),
    (0x1fd7, "\u{3b9}\u{308}\u{342}"),
    (0x1fe2, "\u{3c5}\u{308}\u{300}"),
    (0x1fe3, "\u{3c5}\u{308}\u{301}"),
    (0x1fe4, "\u{3c1}\u{313}"),
    (0x1fe6, "\u{3c5}\u{342}"),
    (0x1fe7, "\u{3c5}\u{308}\u{342}"),
    (0x1ff2, "\u{1f7c}\u{3b9}"),
    (0x1ff3, "\u{3c9}\u{3b9}"),
    (0x1ff4, "\u{3ce}\u{3b9}"),
    (0x1ff6, "\u{3c9}\u{342}"),
    (0x1ff7, "\u{3c9}\u{342}\u{3b9}"),
    (0x1ffc, "\u{3c9}\u{3b9}"),
    (0xab70, "\u{13a0}"),
    (0xab71, "\u{13a1}"),
    (0xab72, "\u{13a2}"),
    (0xab73, "\u{13a3}"),
    (0xab74, "\u{13a4}"),
    (0xab75, "\u{13a5}"),
    (0xab76, "\u{13a6}"),
    (0xab77, "\u{13a7}"),
    (0xab78, "\u{13a8}"),
    (0xab79, "\u{13a9}"),
    (0xab7a, "\u{13aa}"),
    (0xab7b, "\u{13ab}"),
    (0xab7c, "\u{13ac}"),
    (0xab7d, "\u{13ad}"),
    (0xab7e, "\u{13ae}"),
    (0xab7f, "\u{13af}"),
    (0xab80, "\u{13b0}"),
    (0xab81, "\u{13b1}"),
    (0xab82, "\u{13b2}"),
    (0xab83, "\u{13b3}"),
    (0xab84, "\u{13b4}"),
    (0xab85, "\u{13b5}"),
    (0xab86, "\u{13b6}"),
    (0xab87, "\u{13b7}"),
    (0xab88, "\u{13b8}"),
    (0xab89, "\u{13b9}"),
    (0xab8a, "\u{13ba}"),
    (0xab8b, "\u{13bb}"),
    (0xab8c, "\u{13bc}"),
    (0xab8d, "\u{13bd}"),
    (0xab8e, "\u{13be}"),
    (0xab8f, "\u{13bf}"),
    (0xab90, "\u{13c0}"),
    (0xab91, "\u{13c1}"),
    (0xab92, "\u{13c2}"),
    (0xab93, "\u{13c3}"),
    (0xab94, "\u{13c4}"),
    (0xab95, "\u{13c5}"),
    (0xab96, "\u{13c6}"),
    (0xab97, "\u{13c7}"),
    (0xab98, "\u{13c8}"),
    (0xab99, "\u{13c9}"),
    (0xab9a, "\u{13ca}"),
    (0xab9b, "\u{13cb}"),
    (0xab9c, "\u{13cc}"),
    (0xab9d, "\u{13cd}"),
    (0xab9e, "\u{13ce}"),
    (0xab9f, "\u{13cf}"),
    (0xaba0, "\u{13d0}"),
    (0xaba1, "\u{13d1}"),
    (0xaba2, "\u{13d2}"),
    (0xaba3, "\u{13d3}"),
    (0xaba4, "\u{13d4}"),
    (0xaba5, "\u{13d5}"),
    (0xaba6, "\u{13d6}"),
    (0xaba7, "\u{13d7}"),
    (0xaba8, "\u{13d8}"),
    (0xaba9, "\u{13d9}"),
    (0xabaa, "\u{13da}"),
    (0xabab, "\u{13db}"),
    (0xabac, "\u{13dc}"),
    (0xabad, "\u{13dd}"),
    (0xabae, "\u{13de}"),
    (0xabaf, "\u{13df}"),
    (0xabb0, "\u{13e0}"),
    (0xabb1, "\u{13e1}"),
    (0xabb2, "\u{13e2}"),
    (0xabb3, "\u{13e3}"),
    (0xabb4, "\u{13e4}"),
    (0xabb5, "\u{13e5}"),
    (0xabb6, "\u{13e6}"),
    (0xabb7, "\u{13e7}"),
    (0xabb8, "\u{13e8}"),
    (0xabb9, "\u{13e9}"),
    (0xabba, "\u{13ea}"),
    (0xabbb, "\u{13eb}"),
    (0xabbc, "\u{13ec}"),
    (0xabbd, "\u{13ed}"),
    (0xabbe, "\u{13ee}"),
    (0xabbf, "\u{13ef}"),
    (0xfb00, "ff"),
    (0xfb01, "fi"),
    (0xfb02, "fl"),
    (0xfb03, "ffi"),
    (0xfb04, "ffl"),
    (0xfb05, "st"),
    (0xfb06, "st"),
    (0xfb13, "\u{574}\u{576}"),
    (0xfb14, "\u{574}\u{565}"),
    (0xfb15, "\u{574}\u{56b}"),
    (0xfb16, "\u{57e}\u{576}"),
    (0xfb17, "\u{574}\u{56d}"),
];

/// The full case fold of `c`, or `None` when `c` folds to its plain lowercase.
pub fn casefold_override(c: char) -> Option<&'static str> {
    let cp = c as u32;
    CASEFOLD_OVERRIDES
        .binary_search_by(|&(k, _)| k.cmp(&cp))
        .ok()
        .map(|i| CASEFOLD_OVERRIDES[i].1)
}