소스 검색

Merge pull request #5268 from brakhane/fix-floating-bug

correctly parse floats in scientific notation (Fix #5267)
Rémi Verschelde 9 년 전
부모
커밋
1923733ec8
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      modules/gdscript/gd_tokenizer.cpp

+ 1 - 1
modules/gdscript/gd_tokenizer.cpp

@@ -725,7 +725,7 @@ void GDTokenizerText::_advance() {
 					if (hexa_found) {
 					if (hexa_found) {
 						int val = str.hex_to_int();
 						int val = str.hex_to_int();
 						_make_constant(val);
 						_make_constant(val);
-					} else if (period_found) {
+					} else if (period_found || exponent_found) {
 						real_t val = str.to_double();
 						real_t val = str.to_double();
 						//print_line("*%*%*%*% to convert: "+str+" result: "+rtos(val));
 						//print_line("*%*%*%*% to convert: "+str+" result: "+rtos(val));
 						_make_constant(val);
 						_make_constant(val);