diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-10-06 16:14:38 -0700 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-10-09 09:44:51 -0700 |
| commit | 34d66de52a8338b0fd1f1d4842916bc37cc81f75 (patch) | |
| tree | a2abb67b629088964cccc71948567fb2a03dee7c /src/libunicode/normalize.rs | |
| parent | 1a433770e3141c476a7ac5b12cfdc15be022073e (diff) | |
| download | rust-34d66de52a8338b0fd1f1d4842916bc37cc81f75.tar.gz rust-34d66de52a8338b0fd1f1d4842916bc37cc81f75.zip | |
unicode: Make statics legal
The tables in libunicode are far too large to want to be inlined into any other program, so these tables are all going to remain `static`. For them to be legal, they cannot reference one another by value, but instead use references now. This commit also modifies the src/etc/unicode.py script to generate the right tables.
Diffstat (limited to 'src/libunicode/normalize.rs')
| -rw-r--r-- | src/libunicode/normalize.rs | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/libunicode/normalize.rs b/src/libunicode/normalize.rs index a60e95c3827..76a9476d1fc 100644 --- a/src/libunicode/normalize.rs +++ b/src/libunicode/normalize.rs @@ -100,15 +100,15 @@ pub fn compose(a: char, b: char) -> Option<char> { } // Constants from Unicode 6.3.0 Section 3.12 Conjoining Jamo Behavior -static S_BASE: u32 = 0xAC00; -static L_BASE: u32 = 0x1100; -static V_BASE: u32 = 0x1161; -static T_BASE: u32 = 0x11A7; -static L_COUNT: u32 = 19; -static V_COUNT: u32 = 21; -static T_COUNT: u32 = 28; -static N_COUNT: u32 = (V_COUNT * T_COUNT); -static S_COUNT: u32 = (L_COUNT * N_COUNT); +const S_BASE: u32 = 0xAC00; +const L_BASE: u32 = 0x1100; +const V_BASE: u32 = 0x1161; +const T_BASE: u32 = 0x11A7; +const L_COUNT: u32 = 19; +const V_COUNT: u32 = 21; +const T_COUNT: u32 = 28; +const N_COUNT: u32 = (V_COUNT * T_COUNT); +const S_COUNT: u32 = (L_COUNT * N_COUNT); // Decompose a precomposed Hangul syllable #[inline(always)] |
