You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
[TextServer] Implement ICU/UAX 31 based is_valid_identifier function.
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user