Przeglądaj źródła

Add support for Unicode identifiers in Expression class

George Marques 2 lat temu
rodzic
commit
86ee5f39c4
1 zmienionych plików z 4 dodań i 5 usunięć
  1. 4 5
      core/math/expression.cpp

+ 4 - 5
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