Skip to content

Commit 9cfe8db

Browse files
committed
Fix capitalication for lookup keys
1 parent 1619c43 commit 9cfe8db

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

build.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def build_ucd():
154154
is_block_sparse.append(True)
155155
for cp, entry in enumerate(content):
156156
if entry is not None:
157-
f.write(f' "{cp:x}": {entry},\n')
157+
f.write(f' "{cp:X}": {entry},\n')
158158
f.write(')\n')
159159
else:
160160
f.write('#let data = (\n')
@@ -169,7 +169,7 @@ def build_ucd():
169169
with open(GENERATED_DIR.joinpath('aliases.typ'), 'w') as f:
170170
f.write('#let aliases = (:\n')
171171
for cp, alias_types in aliases.items():
172-
f.write(f' "{cp:x}": (')
172+
f.write(f' "{cp:X}": (')
173173
for i, alias_type in enumerate(alias_types):
174174
if i != 0:
175175
f.write(', ')
@@ -190,13 +190,13 @@ def build_ucd():
190190
f.write(' ')
191191
for (block_id, first, last, block_name), is_sparse in zip(blocks, is_block_sparse):
192192
if is_sparse:
193-
block_relative_key = f'upper(str(code - 0x{first:x}, base: 16))'
193+
block_relative_key = f'upper(str(code - 0x{first:X}, base: 16))'
194194
else:
195-
block_relative_key = f'code - 0x{first:x}'
196-
f.write(f'if 0x{first:x} <= code and code <= 0x{last:x} {{\n')
195+
block_relative_key = f'code - 0x{first:X}'
196+
f.write(f'if 0x{first:X} <= code and code <= 0x{last:X} {{\n')
197197
f.write(f' import "block-{block_id}.typ"\n')
198198
components = ', '.join((
199-
f'("{block_name}", 0x{block_id}, 0x{last - first + 1:x})',
199+
f'("{block_name}", 0x{block_id}, 0x{last - first + 1:X})',
200200
f'block-{block_id}.data.at({block_relative_key}, default: ())',
201201
f'aliases.aliases.at(upper(str(code, base: 16)), default: {default_aliases})',
202202
))

0 commit comments

Comments
 (0)