summaryrefslogtreecommitdiff
path: root/src/make_unicode_property_data.py
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2018-12-21 13:48:35 +0100
committerJörg Frings-Fürst <debian@jff.email>2018-12-21 13:48:35 +0100
commit70de057dbb5ea79536834e156f534279347f96f3 (patch)
treee7fc439a3c893ffe8358d3d0c26a112d4b4cf89d /src/make_unicode_property_data.py
parentc9b3c26db59d89e320a6eb86d9558051ecba0900 (diff)
New upstream version 6.9.1upstream/6.9.1
Diffstat (limited to 'src/make_unicode_property_data.py')
-rwxr-xr-xsrc/make_unicode_property_data.py20
1 files changed, 13 insertions, 7 deletions
diff --git a/src/make_unicode_property_data.py b/src/make_unicode_property_data.py
index 9a48ced..dc3071a 100755
--- a/src/make_unicode_property_data.py
+++ b/src/make_unicode_property_data.py
@@ -6,8 +6,6 @@
import sys
import re
-INCLUDE_GRAPHEME_CLUSTER_DATA = False
-
POSIX_LIST = [
'NEWLINE', 'Alpha', 'Blank', 'Cntrl', 'Digit', 'Graph', 'Lower',
'Print', 'Punct', 'Space', 'Upper', 'XDigit', 'Word', 'Alnum', 'ASCII'
@@ -427,9 +425,17 @@ argv = sys.argv
argc = len(argv)
POSIX_ONLY = False
-if argc >= 2:
- if argv[1] == '-posix':
+INCLUDE_GRAPHEME_CLUSTER_DATA = False
+
+for i in range(1, argc):
+ arg = argv[i]
+ if arg == '-posix':
POSIX_ONLY = True
+ elif arg == '-gc':
+ INCLUDE_GRAPHEME_CLUSTER_DATA = True
+ else:
+ print >> sys.stderr, "Invalid argument: %s" % arg
+
OUTPUT_LIST_MODE = not(POSIX_ONLY)
@@ -441,11 +447,11 @@ with open('UnicodeData.txt', 'r') as f:
PROPS = DIC.keys()
PROPS = list_sub(PROPS, POSIX_LIST)
-dic, props = parse_and_merge_properties('DerivedCoreProperties.txt', 'Derived Property')
+parse_and_merge_properties('DerivedCoreProperties.txt', 'Derived Property')
dic, props = parse_and_merge_properties('Scripts.txt', 'Script')
DIC['Unknown'] = inverse_ranges(add_ranges_in_dic(dic))
-dic, props = parse_and_merge_properties('PropList.txt', 'Binary Property')
-dic, props = parse_and_merge_properties('emoji-data.txt', 'Emoji Property')
+parse_and_merge_properties('PropList.txt', 'Binary Property')
+parse_and_merge_properties('emoji-data.txt', 'Emoji Property')
PROPS.append('Unknown')
KDIC['Unknown'] = 'Script'