From 9386b764978eb0be91e7a4a95340e2c1e9560405 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Mon, 1 Feb 2016 19:17:05 -0300 Subject: -Propertly detect mantissa floats in variantparser, fixes #3257 --- core/variant_parser.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/variant_parser.cpp b/core/variant_parser.cpp index b95e52f7b5..a3775156ac 100644 --- a/core/variant_parser.cpp +++ b/core/variant_parser.cpp @@ -338,6 +338,8 @@ Error VariantParser::get_token(Stream *p_stream, Token& r_token, int &line, Stri exp_beg=true; } else if ((c=='-' || c=='+') && !exp_sign && !exp_beg) { + if (c=='-') + is_float=true; exp_sign=true; } else { @@ -358,6 +360,7 @@ Error VariantParser::get_token(Stream *p_stream, Token& r_token, int &line, Stri r_token.type=TK_NUMBER; + if (is_float) r_token.value=num.to_double(); else -- cgit v1.2.3