Skip to content

Commit baa5a6a

Browse files
committed
update code generator
1 parent bead643 commit baa5a6a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

py2cs.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ def formatch(ch, cc):
5555
m = re.search('x(.{3})\.py$', file)
5656
if m:
5757
data = __import__(d + "." + file[0:-3], [], [], ['data']).data
58+
missing = 256 - len(data)
59+
if missing != 0:
60+
fill = "[?]" if data[-1] == "[?]" else ""
61+
data += (fill,)*missing
62+
assert len(data) == 256
5863
c = 0
5964
num = int(m.group(1), 16) * 256
6065
fp.write(' {%s /*%s %s*/, new[]{\n' % (int(m.group(1), 16), num, m.group(1)))

0 commit comments

Comments
 (0)