32 #define PG_U_CATEGORY_MASK(X) ((uint32)(1 << (X)))
34 #define PG_U_LU_MASK PG_U_CATEGORY_MASK(PG_U_UPPERCASE_LETTER)
35 #define PG_U_LL_MASK PG_U_CATEGORY_MASK(PG_U_LOWERCASE_LETTER)
36 #define PG_U_LT_MASK PG_U_CATEGORY_MASK(PG_U_TITLECASE_LETTER)
37 #define PG_U_LC_MASK (PG_U_LU_MASK|PG_U_LL_MASK|PG_U_LT_MASK)
38 #define PG_U_LM_MASK PG_U_CATEGORY_MASK(PG_U_MODIFIER_LETTER)
39 #define PG_U_LO_MASK PG_U_CATEGORY_MASK(PG_U_OTHER_LETTER)
40 #define PG_U_L_MASK (PG_U_LU_MASK|PG_U_LL_MASK|PG_U_LT_MASK|PG_U_LM_MASK|\
42 #define PG_U_MN_MASK PG_U_CATEGORY_MASK(PG_U_NONSPACING_MARK)
43 #define PG_U_ME_MASK PG_U_CATEGORY_MASK(PG_U_ENCLOSING_MARK)
44 #define PG_U_MC_MASK PG_U_CATEGORY_MASK(PG_U_SPACING_MARK)
45 #define PG_U_M_MASK (PG_U_MN_MASK|PG_U_MC_MASK|PG_U_ME_MASK)
46 #define PG_U_ND_MASK PG_U_CATEGORY_MASK(PG_U_DECIMAL_NUMBER)
47 #define PG_U_NL_MASK PG_U_CATEGORY_MASK(PG_U_LETTER_NUMBER)
48 #define PG_U_NO_MASK PG_U_CATEGORY_MASK(PG_U_OTHER_NUMBER)
49 #define PG_U_N_MASK (PG_U_ND_MASK|PG_U_NL_MASK|PG_U_NO_MASK)
50 #define PG_U_PC_MASK PG_U_CATEGORY_MASK(PG_U_CONNECTOR_PUNCTUATION)
51 #define PG_U_PD_MASK PG_U_CATEGORY_MASK(PG_U_DASH_PUNCTUATION)
52 #define PG_U_PS_MASK PG_U_CATEGORY_MASK(PG_U_OPEN_PUNCTUATION)
53 #define PG_U_PE_MASK PG_U_CATEGORY_MASK(PG_U_CLOSE_PUNCTUATION)
54 #define PG_U_PI_MASK PG_U_CATEGORY_MASK(PG_U_INITIAL_PUNCTUATION)
55 #define PG_U_PF_MASK PG_U_CATEGORY_MASK(PG_U_FINAL_PUNCTUATION)
56 #define PG_U_PO_MASK PG_U_CATEGORY_MASK(PG_U_OTHER_PUNCTUATION)
57 #define PG_U_P_MASK (PG_U_PC_MASK|PG_U_PD_MASK|PG_U_PS_MASK|PG_U_PE_MASK|\
58 PG_U_PI_MASK|PG_U_PF_MASK|PG_U_PO_MASK)
59 #define PG_U_SM_MASK PG_U_CATEGORY_MASK(PG_U_MATH_SYMBOL)
60 #define PG_U_SC_MASK PG_U_CATEGORY_MASK(PG_U_CURRENCY_SYMBOL)
61 #define PG_U_SK_MASK PG_U_CATEGORY_MASK(PG_U_MODIFIER_SYMBOL)
62 #define PG_U_SO_MASK PG_U_CATEGORY_MASK(PG_U_OTHER_SYMBOL)
63 #define PG_U_S_MASK (PG_U_SM_MASK|PG_U_SC_MASK|PG_U_SK_MASK|PG_U_SO_MASK)
64 #define PG_U_ZS_MASK PG_U_CATEGORY_MASK(PG_U_SPACE_SEPARATOR)
65 #define PG_U_ZL_MASK PG_U_CATEGORY_MASK(PG_U_LINE_SEPARATOR)
66 #define PG_U_ZP_MASK PG_U_CATEGORY_MASK(PG_U_PARAGRAPH_SEPARATOR)
67 #define PG_U_Z_MASK (PG_U_ZS_MASK|PG_U_ZL_MASK|PG_U_ZP_MASK)
68 #define PG_U_CC_MASK PG_U_CATEGORY_MASK(PG_U_CONTROL)
69 #define PG_U_CF_MASK PG_U_CATEGORY_MASK(PG_U_FORMAT)
70 #define PG_U_CS_MASK PG_U_CATEGORY_MASK(PG_U_SURROGATE)
71 #define PG_U_CO_MASK PG_U_CATEGORY_MASK(PG_U_PRIVATE_USE)
72 #define PG_U_CN_MASK PG_U_CATEGORY_MASK(PG_U_UNASSIGNED)
73 #define PG_U_C_MASK (PG_U_CC_MASK|PG_U_CF_MASK|PG_U_CS_MASK|PG_U_CO_MASK|\
76 #define PG_U_CHARACTER_TAB 0x09
98 mid = (min + max) / 2;
214 return (
'0' <= code && code <=
'9');
320 return ((
'0' <= code && code <=
'9') ||
321 (
'A' <= code && code <=
'F') ||
322 (
'a' <= code && code <=
'f'));
339 return "Uppercase_Letter";
341 return "Lowercase_Letter";
343 return "Titlecase_Letter";
345 return "Modifier_Letter";
347 return "Other_Letter";
349 return "Nonspacing_Mark";
351 return "Enclosing_Mark";
353 return "Spacing_Mark";
355 return "Decimal_Number";
357 return "Letter_Number";
359 return "Other_Number";
361 return "Space_Separator";
363 return "Line_Separator";
365 return "Paragraph_Separator";
371 return "Private_Use";
375 return "Dash_Punctuation";
377 return "Open_Punctuation";
379 return "Close_Punctuation";
381 return "Connector_Punctuation";
383 return "Other_Punctuation";
385 return "Math_Symbol";
387 return "Currency_Symbol";
389 return "Modifier_Symbol";
391 return "Other_Symbol";
393 return "Initial_Punctuation";
395 return "Final_Punctuation";
399 return "Unrecognized";
491 mid = (min + max) / 2;
492 if (code > tbl[mid].last)
494 else if (code < tbl[mid].first)
#define Assert(condition)
static pg_noinline void Size size
bool pg_u_prop_uppercase(pg_wchar code)
bool pg_u_isspace(pg_wchar code)
bool pg_u_isxdigit(pg_wchar code, bool posix)
bool pg_u_ispunct(pg_wchar code, bool posix)
bool pg_u_isprint(pg_wchar code)
const char * unicode_category_string(pg_unicode_category category)
bool pg_u_islower(pg_wchar code)
#define PG_U_CATEGORY_MASK(X)
#define PG_U_CHARACTER_TAB
bool pg_u_prop_white_space(pg_wchar code)
bool pg_u_isblank(pg_wchar code)
bool pg_u_prop_cased(pg_wchar code)
bool pg_u_isalpha(pg_wchar code)
bool pg_u_prop_lowercase(pg_wchar code)
static bool range_search(const pg_unicode_range *tbl, size_t size, pg_wchar code)
const char * unicode_category_abbrev(pg_unicode_category category)
bool pg_u_isalnum(pg_wchar code, bool posix)
bool pg_u_isupper(pg_wchar code)
bool pg_u_prop_alphabetic(pg_wchar code)
bool pg_u_isdigit(pg_wchar code, bool posix)
bool pg_u_iscntrl(pg_wchar code)
bool pg_u_prop_join_control(pg_wchar code)
bool pg_u_isgraph(pg_wchar code)
bool pg_u_isword(pg_wchar code)
bool pg_u_prop_case_ignorable(pg_wchar code)
bool pg_u_prop_hex_digit(pg_wchar code)
pg_unicode_category unicode_category(pg_wchar code)
@ PG_U_CONNECTOR_PUNCTUATION
@ PG_U_INITIAL_PUNCTUATION
@ PG_U_PARAGRAPH_SEPARATOR
#define PG_U_PROP_ALPHABETIC
static const pg_unicode_range unicode_white_space[11]
#define PG_U_PROP_LOWERCASE
#define PG_U_PROP_JOIN_CONTROL
#define PG_U_PROP_UPPERCASE
#define PG_U_PROP_HEX_DIGIT
static const pg_unicode_range unicode_join_control[1]
static const pg_category_range unicode_categories[3302]
static const pg_unicode_range unicode_alphabetic[1141]
static const pg_unicode_properties unicode_opt_ascii[128]
static const pg_unicode_range unicode_case_ignorable[491]
static const pg_unicode_range unicode_uppercase[651]
#define PG_U_PROP_WHITE_SPACE
static const pg_unicode_range unicode_hex_digit[6]
static const pg_unicode_range unicode_lowercase[686]
#define PG_U_PROP_CASE_IGNORABLE