diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-12-02 10:04:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-02 10:04:17 +0100 |
commit | 49d8925713ef630ba451b5099edf7a1f475d07e5 (patch) | |
tree | daaf359c77ce881dd7c2984a1e91a3ea62727cb3 /core/math | |
parent | 02d6cbfd8cb316b1091506552837f9e0164c779d (diff) | |
parent | be90aadbcd2bb7ca4e5d29b1616f326dffce9524 (diff) |
Merge pull request #47294 from sebastian-heinz/patch-1
Diffstat (limited to 'core/math')
-rw-r--r-- | core/math/expression.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/core/math/expression.cpp b/core/math/expression.cpp index f366fd0499..fe277cff96 100644 --- a/core/math/expression.cpp +++ b/core/math/expression.cpp @@ -410,6 +410,14 @@ Error Expression::_get_token(Token &r_token) { } else if (id == "self") { r_token.type = TK_SELF; } else { + for (int i = 0; i < Variant::VARIANT_MAX; i++) { + if (id == Variant::get_type_name(Variant::Type(i))) { + r_token.type = TK_BASIC_TYPE; + r_token.value = i; + return OK; + } + } + if (Variant::has_utility_function(id)) { r_token.type = TK_BUILTIN_FUNC; r_token.value = id; |