diff options
| author | Rémi Verschelde <rverschelde@gmail.com> | 2020-09-03 21:35:27 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-03 21:35:27 +0200 |
| commit | 27763b67bb63139319bf611590c40e48663e72d6 (patch) | |
| tree | ad9a1589128f569fc6be2a99893b916491f87af1 /modules/gdscript/editor/gdscript_highlighter.cpp | |
| parent | 4dd915028a9c8819075d7ac5683f6da7ddf58087 (diff) | |
| parent | 80b8eff6aa41ba79175a5152ba5b2b9b16f6de3f (diff) | |
| download | redot-engine-27763b67bb63139319bf611590c40e48663e72d6.tar.gz | |
Merge pull request #40999 from bruvzg/ctl_string_to_utf32
[Complex Test Layouts] Refactor `String` to use UTF-32 encoding.
Diffstat (limited to 'modules/gdscript/editor/gdscript_highlighter.cpp')
| -rw-r--r-- | modules/gdscript/editor/gdscript_highlighter.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/modules/gdscript/editor/gdscript_highlighter.cpp b/modules/gdscript/editor/gdscript_highlighter.cpp index e2038954e3..9a3273d201 100644 --- a/modules/gdscript/editor/gdscript_highlighter.cpp +++ b/modules/gdscript/editor/gdscript_highlighter.cpp @@ -33,15 +33,15 @@ #include "../gdscript_tokenizer.h" #include "editor/editor_settings.h" -static bool _is_char(CharType c) { +static bool _is_char(char32_t c) { return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_'; } -static bool _is_hex_symbol(CharType c) { +static bool _is_hex_symbol(char32_t c) { return ((c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')); } -static bool _is_bin_symbol(CharType c) { +static bool _is_bin_symbol(char32_t c) { return (c == '0' || c == '1'); } @@ -119,7 +119,7 @@ Dictionary GDScriptSyntaxHighlighter::_get_line_syntax_highlighting(int p_line) /* search the line */ bool match = true; - const CharType *start_key = color_regions[c].start_key.c_str(); + const char32_t *start_key = color_regions[c].start_key.get_data(); for (int k = 0; k < start_key_length; k++) { if (start_key[k] != str[from + k]) { match = false; @@ -156,7 +156,7 @@ Dictionary GDScriptSyntaxHighlighter::_get_line_syntax_highlighting(int p_line) /* search the line */ int region_end_index = -1; int end_key_length = color_regions[in_region].end_key.length(); - const CharType *end_key = color_regions[in_region].end_key.c_str(); + const char32_t *end_key = color_regions[in_region].end_key.get_data(); for (; from < line_length; from++) { if (line_length - from < end_key_length) { break; |
