MCPcopy Index your code
hub / github.com/python/cpython / update_decode_map

Method update_decode_map

Tools/unicode/genmap_support.py:53–73  ·  view source on GitHub ↗
(self, c1range, c2range, onlymask=(), wide=0)

Source from the content-addressed store, hash-verified

51 self.filler = self.filler_class()
52
53 def update_decode_map(self, c1range, c2range, onlymask=(), wide=0):
54 c2values = range(c2range[0], c2range[1] + 1)
55
56 for c1 in range(c1range[0], c1range[1] + 1):
57 if c1 not in self.decode_map or (onlymask and c1 not in onlymask):
58 continue
59 c2map = self.decode_map[c1]
60 rc2values = [n for n in c2values if n in c2map]
61 if not rc2values:
62 continue
63
64 c2map[self.prefix] = True
65 c2map['min'] = rc2values[0]
66 c2map['max'] = rc2values[-1]
67 c2map['midx'] = len(self.filler)
68
69 for v in range(rc2values[0], rc2values[-1] + 1):
70 if v in c2map:
71 self.filler.write('%d,' % c2map[v])
72 else:
73 self.filler.write('U,')
74
75 def generate(self, wide=False):
76 if not wide:

Callers 5

mainFunction · 0.95
mainFunction · 0.80
write_big5_mapsFunction · 0.80
main_hkscsFunction · 0.80
mainFunction · 0.80

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected