Add support for Unicode identifiers in Expression class

This commit is contained in:
George Marques 2023-01-18 22:59:47 -03:00
parent 7548e043fc
commit 86ee5f39c4
No known key found for this signature in database
GPG Key ID: 046BD46A3201E43D
1 changed files with 4 additions and 5 deletions

View File

@ -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