Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit42fd2c1

Browse files
Use..= syntax for inclusive ranges
1 parent061dc3c commit42fd2c1

File tree

3 files changed

+647
-647
lines changed

3 files changed

+647
-647
lines changed

‎scripts/unicode.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ def gen_qc_match(prop_table, out):
419419
assertdatain ('N','M')
420420
result="No"ifdata=='N'else"Maybe"
421421
ifhigh:
422-
out.write(r" '\u{%s}'...'\u{%s}' => %s,"% (low,high,result))
422+
out.write(r" '\u{%s}'..='\u{%s}' => %s,"% (low,high,result))
423423
else:
424424
out.write(r" '\u{%s}' => %s,"% (low,result))
425425
out.write("\n")

‎src/normalize.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,8 @@ const L_LAST: u32 = L_BASE + L_COUNT - 1;
123123
constV_LAST:u32 =V_BASE +V_COUNT -1;
124124
constT_LAST:u32 =T_BASE +T_COUNT -1;
125125

126-
// Composition only occurs for `TPart`s in `U+11A8 ... U+11C2`,
127-
// i.e. `T_BASE + 1 ... T_LAST`.
126+
// Composition only occurs for `TPart`s in `U+11A8 ..= U+11C2`,
127+
// i.e. `T_BASE + 1 ..= T_LAST`.
128128
constT_FIRST:u32 =T_BASE +1;
129129

130130
pub(crate)fnis_hangul_syllable(c:char) ->bool{
@@ -172,15 +172,15 @@ fn compose_hangul(a: char, b: char) -> Option<char> {
172172
let(a, b) =(aasu32, basu32);
173173
match(a, b){
174174
// Compose a leading consonant and a vowel together into an LV_Syllable
175-
(L_BASE...L_LAST,V_BASE...V_LAST) =>{
175+
(L_BASE..=L_LAST,V_BASE..=V_LAST) =>{
176176
let l_index = a -L_BASE;
177177
let v_index = b -V_BASE;
178178
let lv_index = l_index*N_COUNT + v_index*T_COUNT;
179179
let s =S_BASE + lv_index;
180180
Some(unsafe{ char::from_u32_unchecked(s)})
181181
}
182182
// Compose an LV_Syllable and a trailing consonant into an LVT_Syllable
183-
(S_BASE...S_LAST,T_FIRST...T_LAST)if(a -S_BASE) %T_COUNT ==0 =>{
183+
(S_BASE..=S_LAST,T_FIRST..=T_LAST)if(a -S_BASE) %T_COUNT ==0 =>{
184184
Some(unsafe{ char::from_u32_unchecked(a +(b -T_BASE))})
185185
}
186186
_ =>None,
@@ -193,7 +193,7 @@ mod tests {
193193

194194
// Regression test from a bugfix where we were composing an LV_Syllable with
195195
// T_BASE directly. (We should only compose an LV_Syllable with a character
196-
// in the range `T_BASE + 1 ... T_LAST`.)
196+
// in the range `T_BASE + 1 ..= T_LAST`.)
197197
#[test]
198198
fntest_hangul_composition(){
199199
assert_eq!(compose_hangul('\u{c8e0}','\u{11a7}'),None);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp