diff options
Diffstat (limited to 'modules/visual_script/visual_script_expression.cpp')
-rw-r--r-- | modules/visual_script/visual_script_expression.cpp | 55 |
1 files changed, 28 insertions, 27 deletions
diff --git a/modules/visual_script/visual_script_expression.cpp b/modules/visual_script/visual_script_expression.cpp index 868d22b541..772092fabe 100644 --- a/modules/visual_script/visual_script_expression.cpp +++ b/modules/visual_script/visual_script_expression.cpp @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2018 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2018 Godot Engine contributors (cf. AUTHORS.md) */ +/* Copyright (c) 2007-2019 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2019 Godot Engine contributors (cf. AUTHORS.md) */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -679,10 +679,10 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() { } str_ofs = cofs; //revert //parse an expression - ENode *expr = _parse_expression(); - if (!expr) + ENode *expr2 = _parse_expression(); + if (!expr2) return NULL; - dn->dict.push_back(expr); + dn->dict.push_back(expr2); _get_token(tk); if (tk.type != TK_COLON) { @@ -690,11 +690,11 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() { return NULL; } - expr = _parse_expression(); - if (!expr) + expr2 = _parse_expression(); + if (!expr2) return NULL; - dn->dict.push_back(expr); + dn->dict.push_back(expr2); cofs = str_ofs; _get_token(tk); @@ -723,10 +723,10 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() { } str_ofs = cofs; //revert //parse an expression - ENode *expr = _parse_expression(); - if (!expr) + ENode *expr2 = _parse_expression(); + if (!expr2) return NULL; - an->array.push_back(expr); + an->array.push_back(expr2); cofs = str_ofs; _get_token(tk); @@ -807,11 +807,11 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() { } str_ofs = cofs; //revert //parse an expression - ENode *expr = _parse_expression(); - if (!expr) + ENode *expr2 = _parse_expression(); + if (!expr2) return NULL; - constructor->arguments.push_back(expr); + constructor->arguments.push_back(expr2); cofs = str_ofs; _get_token(tk); @@ -848,11 +848,11 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() { } str_ofs = cofs; //revert //parse an expression - ENode *expr = _parse_expression(); - if (!expr) + ENode *expr2 = _parse_expression(); + if (!expr2) return NULL; - bifunc->arguments.push_back(expr); + bifunc->arguments.push_back(expr2); cofs = str_ofs; _get_token(tk); @@ -947,25 +947,25 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() { while (true) { - int cofs = str_ofs; + int cofs3 = str_ofs; _get_token(tk); if (tk.type == TK_PARENTHESIS_CLOSE) { break; } - str_ofs = cofs; //revert + str_ofs = cofs3; //revert //parse an expression - ENode *expr = _parse_expression(); - if (!expr) + ENode *expr2 = _parse_expression(); + if (!expr2) return NULL; - func_call->arguments.push_back(expr); + func_call->arguments.push_back(expr2); - cofs = str_ofs; + cofs3 = str_ofs; _get_token(tk); if (tk.type == TK_COMMA) { //all good } else if (tk.type == TK_PARENTHESIS_CLOSE) { - str_ofs = cofs; + str_ofs = cofs3; } else { _set_error("Expected ',' or ')'"); } @@ -1032,7 +1032,8 @@ VisualScriptExpression::ENode *VisualScriptExpression::_parse_expression() { case TK_OP_BIT_OR: op = Variant::OP_BIT_OR; break; case TK_OP_BIT_XOR: op = Variant::OP_BIT_XOR; break; case TK_OP_BIT_INVERT: op = Variant::OP_BIT_NEGATE; break; - default: {}; + default: { + }; } if (op == Variant::OP_MAX) { //stop appending stuff @@ -1426,8 +1427,8 @@ public: for (int i = 0; i < call->arguments.size(); i++) { Variant value; - bool ret = _execute(p_inputs, call->arguments[i], value, r_error_str, ce); - if (ret) + bool ret2 = _execute(p_inputs, call->arguments[i], value, r_error_str, ce); + if (ret2) return true; arr.write[i] = value; argp.write[i] = &arr[i]; |