Add Other_ID_Continue support from PropList.txt.

This commit is contained in:
Reece H. Dunn
2017-04-16 09:43:03 +01:00
parent 90a3615c48
commit 628dfb8887
3 changed files with 21 additions and 3 deletions
+2
View File
@@ -357,6 +357,7 @@ enum
UCD_PROPERTY_SOFT_DOTTED = 0x0000000001000000ull, /**< @brief Soft_Dotted */
UCD_PROPERTY_LOGICAL_ORDER_EXCEPTION = 0x0000000002000000ull, /**< @brief Logical_Order_Exception */
UCD_PROPERTY_OTHER_ID_START = 0x0000000004000000ull, /**< @brief Other_ID_Start */
UCD_PROPERTY_OTHER_ID_CONTINUE = 0x0000000008000000ull, /**< @brief Other_ID_Continue */
};
/** @brief Return the properties of the specified codepoint.
@@ -844,6 +845,7 @@ namespace ucd
Soft_Dotted = UCD_PROPERTY_SOFT_DOTTED, /**< @brief Soft_Dotted */
Logical_Order_Exception = UCD_PROPERTY_LOGICAL_ORDER_EXCEPTION, /**< @brief Logical_Order_Exception */
Other_ID_Start = UCD_PROPERTY_OTHER_ID_START, /**< @brief Other_ID_Start */
Other_ID_Continue = UCD_PROPERTY_OTHER_ID_CONTINUE, /**< @brief Other_ID_Continue */
};
/** @brief Return the properties of the specified codepoint.
+18 -3
View File
@@ -1131,6 +1131,20 @@ static int properties_Nl(codepoint_t c)
return 0;
}
static int properties_No(codepoint_t c)
{
switch (c & 0xFFFFFF00)
{
case 0x1300:
if (c >= 0x1369 && c <= 0x1371) return UCD_PROPERTY_OTHER_ID_CONTINUE;
break;
case 0x1900:
if (c == 0x19DA) return UCD_PROPERTY_OTHER_ID_CONTINUE;
break;
}
return 0;
}
static int properties_Pc(codepoint_t c)
{
switch (c & 0xFFFFFF00)
@@ -1254,11 +1268,11 @@ static int properties_Po(codepoint_t c)
if (c == 0x002E) return UCD_PROPERTY_TERMINAL_PUNCTUATION;
if (c >= 0x003A && c <= 0x003B) return UCD_PROPERTY_TERMINAL_PUNCTUATION;
if (c == 0x003F) return UCD_PROPERTY_TERMINAL_PUNCTUATION;
if (c == 0x00B7) return UCD_PROPERTY_DIACRITIC | UCD_PROPERTY_EXTENDER;
if (c == 0x00B7) return UCD_PROPERTY_DIACRITIC | UCD_PROPERTY_EXTENDER | UCD_PROPERTY_OTHER_ID_CONTINUE;
break;
case 0x0300:
if (c == 0x037E) return UCD_PROPERTY_TERMINAL_PUNCTUATION;
if (c == 0x0387) return UCD_PROPERTY_TERMINAL_PUNCTUATION;
if (c == 0x0387) return UCD_PROPERTY_TERMINAL_PUNCTUATION | UCD_PROPERTY_OTHER_ID_CONTINUE;
break;
case 0x0500:
if (c == 0x0589) return UCD_PROPERTY_TERMINAL_PUNCTUATION;
@@ -1649,6 +1663,7 @@ ucd_property ucd_properties(codepoint_t c, ucd_category category)
case UCD_CATEGORY_Mn: return properties_Mn(c);
case UCD_CATEGORY_Nd: return properties_Nd(c);
case UCD_CATEGORY_Nl: return properties_Nl(c);
case UCD_CATEGORY_No: return properties_No(c);
case UCD_CATEGORY_Pc: return properties_Pc(c);
case UCD_CATEGORY_Pd: return properties_Pd(c);
case UCD_CATEGORY_Pe: return properties_Pe(c);
@@ -1662,6 +1677,6 @@ ucd_property ucd_properties(codepoint_t c, ucd_category category)
case UCD_CATEGORY_Zl: return UCD_PROPERTY_WHITE_SPACE;
case UCD_CATEGORY_Zp: return UCD_PROPERTY_WHITE_SPACE;
case UCD_CATEGORY_Zs: return UCD_PROPERTY_WHITE_SPACE;
default: return 0; // Co Cs Ii Lt Me No Sc
default: return 0; // Co Cs Ii Lt Me Sc
};
}
+1
View File
@@ -148,6 +148,7 @@ def properties(data):
props += (2 ** 24) * data.get('Soft_Dotted', 0)
props += (2 ** 25) * data.get('Logical_Order_Exception', 0)
props += (2 ** 26) * data.get('Other_ID_Start', 0)
props += (2 ** 27) * data.get('Other_ID_Continue', 0)
return props
if __name__ == '__main__':