summaryrefslogtreecommitdiff
path: root/core/math
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2023-01-18 22:59:47 -0300
committerGeorge Marques <george@gmarqu.es>2023-01-21 13:39:42 -0300
commit86ee5f39c4de51ca062ce9fde3b1b3182fee5e47 (patch)
treedbc248761bc88f48422171a091e61f44ec16273e /core/math
parent7548e043fce1211e21030bb41c6fe6d6900a7a5a (diff)
Add support for Unicode identifiers in Expression class
Diffstat (limited to 'core/math')
-rw-r--r--core/math/expression.cpp9
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