diff options
author | Juan Linietsky <reduzio@gmail.com> | 2014-09-21 01:43:42 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2014-09-21 01:43:42 -0300 |
commit | 11a5ed508b1cbde61a4d9dd4f469e86e74667623 (patch) | |
tree | e4bc1926057d788aeeef3633930bb958eb976d3a /modules/gdscript | |
parent | c5b905fca82f1437486f2168270c5caa0b4bf104 (diff) |
Fixed too many little issues, check the issues closed today.
Diffstat (limited to 'modules/gdscript')
-rw-r--r-- | modules/gdscript/gd_parser.cpp | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/modules/gdscript/gd_parser.cpp b/modules/gdscript/gd_parser.cpp index 143a81d48a..46eade0b7c 100644 --- a/modules/gdscript/gd_parser.cpp +++ b/modules/gdscript/gd_parser.cpp @@ -2117,9 +2117,15 @@ void GDParser::_parse_class(ClassNode *p_class) { break; } - }; + }; //fallthrough to use the same case Variant::REAL: { + float sign=1.0; + + if (tokenizer->get_token()==GDTokenizer::TK_OP_SUB) { + sign=-1; + tokenizer->advance(); + } if (tokenizer->get_token()!=GDTokenizer::TK_CONSTANT || !tokenizer->get_token_constant().is_num()) { current_export=PropertyInfo(); @@ -2130,7 +2136,7 @@ void GDParser::_parse_class(ClassNode *p_class) { //enumeration current_export.hint=PROPERTY_HINT_RANGE; - current_export.hint_string=tokenizer->get_token_constant().operator String(); + current_export.hint_string=rtos(sign*double(tokenizer->get_token_constant())); tokenizer->advance(); if (tokenizer->get_token()==GDTokenizer::TK_PARENTHESIS_CLOSE) { @@ -2147,6 +2153,12 @@ void GDParser::_parse_class(ClassNode *p_class) { tokenizer->advance(); + sign=1.0; + if (tokenizer->get_token()==GDTokenizer::TK_OP_SUB) { + sign=-1; + tokenizer->advance(); + } + if (tokenizer->get_token()!=GDTokenizer::TK_CONSTANT || !tokenizer->get_token_constant().is_num()) { current_export=PropertyInfo(); @@ -2154,7 +2166,7 @@ void GDParser::_parse_class(ClassNode *p_class) { return; } - current_export.hint_string+=","+tokenizer->get_token_constant().operator String(); + current_export.hint_string+=","+rtos(sign*double(tokenizer->get_token_constant())); tokenizer->advance(); if (tokenizer->get_token()==GDTokenizer::TK_PARENTHESIS_CLOSE) @@ -2168,6 +2180,11 @@ void GDParser::_parse_class(ClassNode *p_class) { } tokenizer->advance(); + sign=1.0; + if (tokenizer->get_token()==GDTokenizer::TK_OP_SUB) { + sign=-1; + tokenizer->advance(); + } if (tokenizer->get_token()!=GDTokenizer::TK_CONSTANT || !tokenizer->get_token_constant().is_num()) { @@ -2176,7 +2193,7 @@ void GDParser::_parse_class(ClassNode *p_class) { return; } - current_export.hint_string+=","+tokenizer->get_token_constant().operator String(); + current_export.hint_string+=","+rtos(sign*double(tokenizer->get_token_constant())); tokenizer->advance(); } break; |