Browse Source

Add Other_ID_Start support from PropList.txt.

master
Reece H. Dunn 8 years ago
parent
commit
90a3615c48
3 changed files with 9 additions and 2 deletions
  1. 2
    0
      src/include/ucd/ucd.h
  2. 6
    2
      src/proplist.c
  3. 1
    0
      tools/printdata.py

+ 2
- 0
src/include/ucd/ucd.h View File

@@ -356,6 +356,7 @@ enum
UCD_PROPERTY_DEPRECATED = 0x0000000000800000ull, /**< @brief Deprecated */
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 */
};

/** @brief Return the properties of the specified codepoint.
@@ -842,6 +843,7 @@ namespace ucd
Deprecated = UCD_PROPERTY_DEPRECATED, /**< @brief Deprecated */
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 */
};

/** @brief Return the properties of the specified codepoint.

+ 6
- 2
src/proplist.c View File

@@ -854,7 +854,7 @@ static int properties_Mn(codepoint_t c)
if (c == 0x17DD) return UCD_PROPERTY_DIACRITIC;
break;
case 0x1800:
if (c >= 0x1885 && c <= 0x1886) return UCD_PROPERTY_OTHER_ALPHABETIC;
if (c >= 0x1885 && c <= 0x1886) return UCD_PROPERTY_OTHER_ALPHABETIC | UCD_PROPERTY_OTHER_ID_START;
if (c == 0x18A9) return UCD_PROPERTY_OTHER_ALPHABETIC;
break;
case 0x1900:
@@ -1530,7 +1530,7 @@ static int properties_Sk(codepoint_t c)
if (c >= 0x1FFD && c <= 0x1FFE) return UCD_PROPERTY_DIACRITIC;
break;
case 0x3000:
if (c >= 0x309B && c <= 0x309C) return UCD_PROPERTY_DIACRITIC;
if (c >= 0x309B && c <= 0x309C) return UCD_PROPERTY_DIACRITIC | UCD_PROPERTY_OTHER_ID_START;
break;
case 0xA700:
if (c >= 0xA720 && c <= 0xA721) return UCD_PROPERTY_DIACRITIC;
@@ -1555,6 +1555,9 @@ static int properties_Sm(codepoint_t c)
if (c == 0x207B) return UCD_PROPERTY_DASH;
if (c == 0x208B) return UCD_PROPERTY_DASH;
break;
case 0x2100:
if (c == 0x2118) return UCD_PROPERTY_OTHER_ID_START;
break;
case 0x2200:
if (c == 0x2212) return UCD_PROPERTY_DASH;
break;
@@ -1568,6 +1571,7 @@ static int properties_So(codepoint_t c)
{
case 0x2100:
if (c == 0x2129) return UCD_PROPERTY_OTHER_MATH;
if (c == 0x212E) return UCD_PROPERTY_OTHER_ID_START;
if (c >= 0x2195 && c <= 0x2199) return UCD_PROPERTY_OTHER_MATH;
if (c >= 0x219C && c <= 0x219F) return UCD_PROPERTY_OTHER_MATH;
if (c >= 0x21A1 && c <= 0x21A2) return UCD_PROPERTY_OTHER_MATH;

+ 1
- 0
tools/printdata.py View File

@@ -147,6 +147,7 @@ def properties(data):
props += (2 ** 23) * data.get('Deprecated', 0)
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)
return props

if __name__ == '__main__':

Loading…
Cancel
Save