diff options
Diffstat (limited to 'core/string/char_utils.h')
-rw-r--r-- | core/string/char_utils.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/core/string/char_utils.h b/core/string/char_utils.h index 0afd058f01..67147a4327 100644 --- a/core/string/char_utils.h +++ b/core/string/char_utils.h @@ -33,6 +33,26 @@ #include "core/typedefs.h" +#include "char_range.inc" + +static _FORCE_INLINE_ bool is_unicode_identifier_start(char32_t c) { + for (int i = 0; xid_start[i].start != 0; i++) { + if (c >= xid_start[i].start && c <= xid_start[i].end) { + return true; + } + } + return false; +} + +static _FORCE_INLINE_ bool is_unicode_identifier_continue(char32_t c) { + for (int i = 0; xid_continue[i].start != 0; i++) { + if (c >= xid_continue[i].start && c <= xid_continue[i].end) { + return true; + } + } + return false; +} + static _FORCE_INLINE_ bool is_ascii_upper_case(char32_t c) { return (c >= 'A' && c <= 'Z'); } |