diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-23 10:24:33 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-23 10:24:33 +0100 |
commit | 5726bf578d9b06bd7a22f1f32e0694550ea64945 (patch) | |
tree | 16a72dee07ba513e5ff93f1a0dde2b380b81ee0c /core | |
parent | 7d604535e1d28c1999622978b1bec8af02f01138 (diff) | |
parent | 86ee5f39c4de51ca062ce9fde3b1b3182fee5e47 (diff) |
Merge pull request #71676 from vnen/gdscript-unicode-identifiers
Add support for Unicode identifiers in GDScript and Expression
Diffstat (limited to 'core')
-rw-r--r-- | core/math/expression.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/core/math/expression.cpp b/core/math/expression.cpp index da52bb9465..d1ec987d56 100644 --- a/core/math/expression.cpp +++ b/core/math/expression.cpp @@ -434,14 +434,13 @@ Error Expression::_get_token(Token &r_token) { } return OK; - } else if (is_ascii_char(cchar) || is_underscore(cchar)) { - String id; - bool first = true; + } else if (is_unicode_identifier_start(cchar)) { + String id = String::chr(cchar); + cchar = GET_CHAR(); - while (is_ascii_char(cchar) || is_underscore(cchar) || (!first && is_digit(cchar))) { + while (is_unicode_identifier_continue(cchar)) { id += String::chr(cchar); cchar = GET_CHAR(); - first = false; } str_ofs--; //go back one |