From 1481fb4fe91125c5c60523c7fa4c41b00f333198 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 26 Oct 2024 13:21:34 +0530 Subject: [PATCH] Dont generate mark mapping --- gen/wcwidth.py | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/gen/wcwidth.py b/gen/wcwidth.py index eaef41621..598c440f6 100755 --- a/gen/wcwidth.py +++ b/gen/wcwidth.py @@ -421,28 +421,6 @@ def gen_ucd() -> None: category_test('is_word_char', p, {c for c in class_maps if c[0] in 'LN'}, 'L and N categories') category_test('is_CZ_category', p, cz, 'C and Z categories') category_test('is_P_category', p, {c for c in class_maps if c[0] == 'P'}, 'P category (punctuation)') - mark_map = [0] + list(sorted(marks)) - p('char_type codepoint_for_mark(combining_type m) {') - p(f'\tstatic char_type map[{len(mark_map)}] =', '{', ', '.join(map(str, mark_map)), '}; // {{{ mapping }}}') - p('\tif (m < arraysz(map)) return map[m];') - p('\treturn 0;') - p('}\n') - p('combining_type mark_for_codepoint(char_type c) {') - rmap = codepoint_to_mark_map(p, mark_map) - p('}\n') - with open('kitty/unicode-data.h', 'r+') as f: - raw = f.read() - f.seek(0) - raw, num = re.subn( - r'^// START_KNOWN_MARKS.+?^// END_KNOWN_MARKS', - '// START_KNOWN_MARKS\nstatic const combining_type ' - f'VS15 = {rmap[0xfe0e]}, VS16 = {rmap[0xfe0f]};' - '\n// END_KNOWN_MARKS', raw, flags=re.MULTILINE | re.DOTALL) - if not num: - raise SystemExit('Faile dto patch mark definitions in unicode-data.h') - f.truncate() - f.write(raw) - def gen_names() -> None: aliases_map: dict[int, set[str]] = {}