From 423aa813aacfc4c1630e488898f714a6c9416c5d Mon Sep 17 00:00:00 2001 From: "Reece H. Dunn" Date: Sat, 15 Apr 2017 12:25:00 +0100 Subject: [PATCH] Add Deprecated support from PropList.txt. --- src/include/ucd/ucd.h | 2 ++ src/proplist.c | 15 +++++++++++++++ tools/printdata.py | 1 + 3 files changed, 18 insertions(+) diff --git a/src/include/ucd/ucd.h b/src/include/ucd/ucd.h index 390e9509..bf9e84df 100644 --- a/src/include/ucd/ucd.h +++ b/src/include/ucd/ucd.h @@ -353,6 +353,7 @@ enum UCD_PROPERTY_RADICAL = 0x0000000000100000ull, /**< @brief Radical */ UCD_PROPERTY_UNIFIED_IDEOGRAPH = 0x0000000000200000ull, /**< @brief Unified_Ideograph */ UCD_PROPERTY_OTHER_DEFAULT_IGNORABLE_CODE_POINT = 0x0000000000400000ull, /**< @brief Other_Default_Ignorable_Code_Point */ + UCD_PROPERTY_DEPRECATED = 0x0000000000800000ull, /**< @brief Deprecated */ }; /** @brief Return the properties of the specified codepoint. @@ -836,6 +837,7 @@ namespace ucd Radical = UCD_PROPERTY_RADICAL, /**< @brief Radical */ Unified_Ideograph = UCD_PROPERTY_UNIFIED_IDEOGRAPH, /**< @brief Unified_Ideograph */ Other_Default_Ignorable_Code_Point = UCD_PROPERTY_OTHER_DEFAULT_IGNORABLE_CODE_POINT, /**< @brief Other_Default_Ignorable_Code_Point */ + Deprecated = UCD_PROPERTY_DEPRECATED, /**< @brief Deprecated */ }; /** @brief Return the properties of the specified codepoint. diff --git a/src/proplist.c b/src/proplist.c index b42ffb01..a3adba60 100644 --- a/src/proplist.c +++ b/src/proplist.c @@ -44,8 +44,10 @@ static int properties_Cf(codepoint_t c) if (c >= 0x202A && c <= 0x202E) return UCD_PROPERTY_BIDI_CONTROL; if (c >= 0x2061 && c <= 0x2064) return UCD_PROPERTY_OTHER_MATH; if (c >= 0x2066 && c <= 0x2069) return UCD_PROPERTY_BIDI_CONTROL; + if (c >= 0x206A && c <= 0x206F) return UCD_PROPERTY_DEPRECATED; break; case 0x0E0000: + if (c == 0x0E0001) return UCD_PROPERTY_DEPRECATED; if (c >= 0x0E0020 && c <= 0x0E007F) return UCD_PROPERTY_OTHER_GRAPHEME_EXTEND; break; } @@ -79,6 +81,9 @@ static int properties_Ll(codepoint_t c) case 0x0000: if (c >= 0x0061 && c <= 0x0066) return UCD_PROPERTY_HEX_DIGIT | UCD_PROPERTY_ASCII_HEX_DIGIT; break; + case 0x0100: + if (c == 0x0149) return UCD_PROPERTY_DEPRECATED; + break; case 0x0300: if (c >= 0x03D0 && c <= 0x03D2) return UCD_PROPERTY_OTHER_MATH; // Ll|Lu if (c == 0x03D5) return UCD_PROPERTY_OTHER_MATH; @@ -246,9 +251,15 @@ static int properties_Lo(codepoint_t c) if (c == 0x00AA) return UCD_PROPERTY_OTHER_LOWERCASE; if (c == 0x00BA) return UCD_PROPERTY_OTHER_LOWERCASE; break; + case 0x0600: + if (c == 0x0673) return UCD_PROPERTY_DEPRECATED; + break; case 0x1100: if (c >= 0x115F && c <= 0x1160) return UCD_PROPERTY_OTHER_DEFAULT_IGNORABLE_CODE_POINT; break; + case 0x1700: + if (c >= 0x17A3 && c <= 0x17A4) return UCD_PROPERTY_DEPRECATED; + break; case 0x2100: if (c >= 0x2135 && c <= 0x2138) return UCD_PROPERTY_OTHER_MATH; break; @@ -755,6 +766,8 @@ static int properties_Mn(codepoint_t c) if (c == 0x0F35) return UCD_PROPERTY_DIACRITIC; if (c == 0x0F37) return UCD_PROPERTY_DIACRITIC; if (c == 0x0F39) return UCD_PROPERTY_DIACRITIC; + if (c == 0x0F77) return UCD_PROPERTY_DEPRECATED | UCD_PROPERTY_OTHER_ALPHABETIC; + if (c == 0x0F79) return UCD_PROPERTY_DEPRECATED | UCD_PROPERTY_OTHER_ALPHABETIC; if (c >= 0x0F71 && c <= 0x0F7E) return UCD_PROPERTY_OTHER_ALPHABETIC; if (c >= 0x0F80 && c <= 0x0F81) return UCD_PROPERTY_OTHER_ALPHABETIC; if (c >= 0x0F82 && c <= 0x0F84) return UCD_PROPERTY_DIACRITIC; @@ -1120,6 +1133,7 @@ static int properties_Pe(codepoint_t c) case 0x2300: if (c == 0x2309) return UCD_PROPERTY_OTHER_MATH; if (c == 0x230B) return UCD_PROPERTY_OTHER_MATH; + if (c == 0x232A) return UCD_PROPERTY_DEPRECATED; break; case 0x2700: if (c == 0x27C6) return UCD_PROPERTY_OTHER_MATH; @@ -1405,6 +1419,7 @@ static int properties_Ps(codepoint_t c) case 0x2300: if (c == 0x2308) return UCD_PROPERTY_OTHER_MATH; if (c == 0x230A) return UCD_PROPERTY_OTHER_MATH; + if (c == 0x2329) return UCD_PROPERTY_DEPRECATED; break; case 0x2700: if (c == 0x27C5) return UCD_PROPERTY_OTHER_MATH; diff --git a/tools/printdata.py b/tools/printdata.py index fcd1d34d..6dd68a95 100755 --- a/tools/printdata.py +++ b/tools/printdata.py @@ -144,6 +144,7 @@ def properties(data): props += (2 ** 20) * data.get('Radical', 0) props += (2 ** 21) * data.get('Unified_Ideograph', 0) props += (2 ** 22) * data.get('Other_Default_Ignorable_Code_Point', 0) + props += (2 ** 23) * data.get('Deprecated', 0) return props if __name__ == '__main__':