@@ -77,14 +77,14 @@ const T_COUNT: u32 = 28;
77
77
const N_COUNT : u32 = ( V_COUNT * T_COUNT ) ;
78
78
const S_COUNT : u32 = ( L_COUNT * N_COUNT ) ;
79
79
80
- const S_END : u32 = S_BASE + S_COUNT - 1 ;
81
- const L_END : u32 = L_BASE + L_COUNT - 1 ;
82
- const V_END : u32 = V_BASE + V_COUNT - 1 ;
83
- const T_END : u32 = T_BASE + T_COUNT - 1 ;
80
+ const S_LAST : u32 = S_BASE + S_COUNT - 1 ;
81
+ const L_LAST : u32 = L_BASE + L_COUNT - 1 ;
82
+ const V_LAST : u32 = V_BASE + V_COUNT - 1 ;
83
+ const T_LAST : u32 = T_BASE + T_COUNT - 1 ;
84
84
85
85
// Composition only occurs for `TPart`s in `U+11A8 ... U+11C2`,
86
- // i.e. `T_BASE + 1 ... T_END `.
87
- const T_START : u32 = T_BASE + 1 ;
86
+ // i.e. `T_BASE + 1 ... T_LAST `.
87
+ const T_FIRST : u32 = T_BASE + 1 ;
88
88
89
89
pub ( crate ) fn is_hangul_syllable ( c : char ) -> bool {
90
90
( c as u32 ) >= S_BASE && ( c as u32 ) < ( S_BASE + S_COUNT )
@@ -123,15 +123,15 @@ fn compose_hangul(a: char, b: char) -> Option<char> {
123
123
let ( a, b) = ( a as u32 , b as u32 ) ;
124
124
match ( a, b) {
125
125
// Compose a leading consonant and a vowel together into an LV_Syllable
126
- ( L_BASE ... L_END , V_BASE ... V_END ) => {
126
+ ( L_BASE ... L_LAST , V_BASE ... V_LAST ) => {
127
127
let l_index = a - L_BASE ;
128
128
let v_index = b - V_BASE ;
129
129
let lv_index = l_index * N_COUNT + v_index * T_COUNT ;
130
130
let s = S_BASE + lv_index;
131
131
Some ( unsafe { char:: from_u32_unchecked ( s) } )
132
132
} ,
133
133
// Compose an LV_Syllable and a trailing consonant into an LVT_Syllable
134
- ( S_BASE ... S_END , T_START ... T_END ) if ( a - S_BASE ) % T_COUNT == 0 => {
134
+ ( S_BASE ... S_LAST , T_FIRST ... T_LAST ) if ( a - S_BASE ) % T_COUNT == 0 => {
135
135
Some ( unsafe { char:: from_u32_unchecked ( a + ( b - T_BASE ) ) } )
136
136
} ,
137
137
_ => None ,
@@ -144,7 +144,7 @@ mod tests {
144
144
145
145
// Regression test from a bugfix where we were composing an LV_Syllable with
146
146
// T_BASE directly. (We should only compose an LV_Syllable with a character
147
- // in the range `T_BASE + 1 ... T_END `.)
147
+ // in the range `T_BASE + 1 ... T_LAST `.)
148
148
#[ test]
149
149
fn test_hangul_composition ( ) {
150
150
assert_eq ! ( compose_hangul( '\u{c8e0}' , '\u{11a7}' ) , None ) ;
0 commit comments