ICU-8972 document stable pnames_data.h output

X-SVN-Rev: 31171
This commit is contained in:
Markus Scherer 2011-12-23 04:29:33 +00:00
parent d109686c14
commit 162f137de9

View File

@ -1495,11 +1495,11 @@ _bc_comment_re = re.compile(" */\*\* *([A-Z]{1,3}) ")
_bc_re = re.compile(" *(U_[A-Z_]+) *= *[0-9]+,")
# Sample line to match:
# UBLOCK_CYRILLIC =9, /*[0400]*/
# UBLOCK_CYRILLIC =9,
_ublock_re = re.compile(" *(UBLOCK_[0-9A-Z_]+) *= *[0-9]+,")
# Sample line to match:
# U_EA_AMBIGUOUS, /*[A]*/
# U_EA_AMBIGUOUS,
_prop_and_value_re = re.compile(
" *(U_(DT|EA|GCB|HST|LB|JG|JT|NT|SB|WB)_([0-9A-Z_]+))")
@ -1680,6 +1680,18 @@ def WritePNamesDataHeader(out_path):
""")
# Note: The uchar.h & uscript.h parsers store the ICU Unicode properties
# and values in the order of their definition,
# and this function writes them in that order.
# Since the ICU API constants are stable and new values are only
# appended at the end
# (new properties are added at the end of each binary/enum/... range),
# the output is stable as well.
# When a property or value constant is renamed,
# it only changes the name itself in the output;
# it does not move in the output since there is no sorting.
# This minimizes diffs and assists with reviewing and evaluating updates.
version = _ucd_version.split('.')
while len(version) < 4: version.append("0")
out_file.write("#define UNICODE_VERSION { %s }\n\n" % ", ".join(version))