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

Commit97b430a

Browse files
authored
Merge pull request#14 from chrisduerr/unicode-12
Update to unicode 12.1
2 parentsca01b2c +eec14d2 commit97b430a

File tree

3 files changed

+213
-193
lines changed

3 files changed

+213
-193
lines changed

‎scripts/unicode.py‎

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/usr/bin/envpython
1+
#!/usr/bin/envpython3
22
#
33
# Copyright 2011-2015 The Rust Project Developers. See the COPYRIGHT
44
# file at the top-level directory of this distribution and at
@@ -68,28 +68,28 @@ def load_unicode_data(f):
6868
fetch(f)
6969
gencats= {}
7070

71-
udict= {};
72-
range_start=-1;
71+
udict= {}
72+
range_start=-1
7373
forlineinfileinput.input(f):
74-
data=line.split(';');
74+
data=line.split(';')
7575
iflen(data)!=15:
7676
continue
77-
cp=int(data[0],16);
77+
cp=int(data[0],16)
7878
ifis_surrogate(cp):
7979
continue
8080
ifrange_start>=0:
81-
foriinxrange(range_start,cp):
82-
udict[i]=data;
83-
range_start=-1;
81+
foriinrange(range_start,cp):
82+
udict[i]=data
83+
range_start=-1
8484
ifdata[1].endswith(", First>"):
85-
range_start=cp;
86-
continue;
87-
udict[cp]=data;
85+
range_start=cp
86+
continue
87+
udict[cp]=data
8888

8989
forcodeinudict:
9090
[code_org,name,gencat,combine,bidi,
9191
decomp,deci,digit,num,mirror,
92-
old,iso,upcase,lowcase,titlecase ]=udict[code];
92+
old,iso,upcase,lowcase,titlecase ]=udict[code]
9393

9494
# place letter in categories as appropriate
9595
forcatin [gencat,"Assigned"]+expanded_categories.get(gencat, []):
@@ -300,15 +300,15 @@ def optimize_width_table(wtable):
300300
### character width module
301301
width_table= []
302302
forzwcatin ["Me","Mn","Cf"]:
303-
width_table.extend(map(lambda (lo,hi): (lo,hi,0,0),gencats[zwcat]))
303+
width_table.extend([(lo_hi[0],lo_hi[1],0,0)forlo_hiingencats[zwcat]])
304304
width_table.append((4448,4607,0,0))
305305

306306
# get widths, except those that are explicitly marked zero-width above
307307
ea_widths=load_east_asian_width(["W","F","A"], ["Me","Mn","Cf"])
308308
# these are doublewidth
309309
fordwcatin ["W","F"]:
310-
width_table.extend(map(lambda (lo,hi): (lo,hi,2,2),ea_widths[dwcat]))
311-
width_table.extend(map(lambda (lo,hi): (lo,hi,1,2),ea_widths["A"]))
310+
width_table.extend([(lo_hi1[0],lo_hi1[1],2,2)forlo_hi1inea_widths[dwcat]])
311+
width_table.extend([(lo_hi2[0],lo_hi2[1],1,2)forlo_hi2inea_widths["A"]])
312312

313313
width_table.sort(key=lambdaw:w[0])
314314

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp