From be8de188671c04ddd8ec4d7af38b313322189136 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Mon, 20 May 2019 17:17:38 -0400 Subject: [PATCH] [gen-ucd] Start adding script-order --- src/gen-ucd.py | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/gen-ucd.py b/src/gen-ucd.py index 341d54be9..09128d2cd 100755 --- a/src/gen-ucd.py +++ b/src/gen-ucd.py @@ -2,7 +2,7 @@ from __future__ import print_function, division, absolute_import -import io, os.path, sys +import io, os.path, sys, re if len (sys.argv) != 2: print ("usage: ./gen-ucd ucdxml-file", file=sys.stderr) @@ -51,6 +51,18 @@ for _ in ('Cc', 'Cf', 'Cn', 'Co', 'Cs', 'Ll', 'Lm', 'Lo', 'Lt', 'Lu', 'Pi', 'Po', 'Ps', 'Sc', 'Sk', 'Sm', 'So', 'Zl', 'Zp', 'Zs',): gc_order[_] +sc_order = packTab.AutoMapping() +sc_array = [] +sc_re = re.compile(" (HB_SCRIPT_[_A-Z]*).*HB_TAG [(]'(.)','(.)','(.)','(.)'[)]") +for line in open('hb-common.h'): + m = sc_re.search (line) + if not m: continue + name = m.group(1) + tag = ''.join(m.group(i) for i in range(2, 6)) + i = sc_order[tag] + assert i == len(sc_array) + sc_array.append(name) + DEFAULT = 1 COMPACT = 3 print()