summaryrefslogtreecommitdiffstats
path: root/core/math/expression.cpp
diff options
context:
space:
mode:
authorHaoyu Qiu <timothyqiu32@gmail.com>2024-07-02 17:12:21 +0800
committerHaoyu Qiu <timothyqiu32@gmail.com>2024-07-02 20:53:52 +0800
commitee9cea521d97088eb368cb1820db71100da9837b (patch)
tree9b414e7a852c583bd3a563d46a02dcd6278c4b90 /core/math/expression.cpp
parent9db1a963beae8056cbd30d692d4160d09c10b2dc (diff)
downloadredot-engine-ee9cea521d97088eb368cb1820db71100da9837b.tar.gz
Fix parsing of `4.` in Expression
Diffstat (limited to 'core/math/expression.cpp')
-rw-r--r--core/math/expression.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/core/math/expression.cpp b/core/math/expression.cpp
index 636c2c16bf..0692ece1e6 100644
--- a/core/math/expression.cpp
+++ b/core/math/expression.cpp
@@ -30,12 +30,7 @@
#include "expression.h"
-#include "core/io/marshalls.h"
-#include "core/math/math_funcs.h"
#include "core/object/class_db.h"
-#include "core/object/ref_counted.h"
-#include "core/os/os.h"
-#include "core/variant/variant_parser.h"
Error Expression::_get_token(Token &r_token) {
while (true) {
@@ -392,7 +387,6 @@ Error Expression::_get_token(Token &r_token) {
if (is_digit(c)) {
} else if (c == 'e') {
reading = READING_EXP;
-
} else {
reading = READING_DONE;
}
@@ -419,7 +413,9 @@ Error Expression::_get_token(Token &r_token) {
is_first_char = false;
}
- str_ofs--;
+ if (c != 0) {
+ str_ofs--;
+ }
r_token.type = TK_CONSTANT;