You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-12 13:20:55 +00:00
This commit is contained in:
@@ -776,7 +776,8 @@ GDScriptParser::Node *GDScriptParser::_parse_expression(Node *p_parent, bool p_s
|
|||||||
}
|
}
|
||||||
_add_warning(GDScriptWarning::UNASSIGNED_VARIABLE_OP_ASSIGN, -1, identifier.operator String());
|
_add_warning(GDScriptWarning::UNASSIGNED_VARIABLE_OP_ASSIGN, -1, identifier.operator String());
|
||||||
}
|
}
|
||||||
} break;
|
FALLTHROUGH;
|
||||||
|
}
|
||||||
case GDScriptTokenizer::TK_OP_ASSIGN: {
|
case GDScriptTokenizer::TK_OP_ASSIGN: {
|
||||||
lv->assignments += 1;
|
lv->assignments += 1;
|
||||||
lv->usages--; // Assignment is not really usage
|
lv->usages--; // Assignment is not really usage
|
||||||
@@ -846,24 +847,11 @@ GDScriptParser::Node *GDScriptParser::_parse_expression(Node *p_parent, bool p_s
|
|||||||
if (current_function) {
|
if (current_function) {
|
||||||
int arg_idx = current_function->arguments.find(identifier);
|
int arg_idx = current_function->arguments.find(identifier);
|
||||||
if (arg_idx != -1) {
|
if (arg_idx != -1) {
|
||||||
switch (tokenizer->get_token()) {
|
if (tokenizer->get_token() == GDScriptTokenizer::TK_OP_ASSIGN) {
|
||||||
case GDScriptTokenizer::TK_OP_ASSIGN_ADD:
|
// Assignment is not really usage
|
||||||
case GDScriptTokenizer::TK_OP_ASSIGN_BIT_AND:
|
current_function->arguments_usage.write[arg_idx] = current_function->arguments_usage[arg_idx] - 1;
|
||||||
case GDScriptTokenizer::TK_OP_ASSIGN_BIT_OR:
|
} else {
|
||||||
case GDScriptTokenizer::TK_OP_ASSIGN_BIT_XOR:
|
current_function->arguments_usage.write[arg_idx] = current_function->arguments_usage[arg_idx] + 1;
|
||||||
case GDScriptTokenizer::TK_OP_ASSIGN_DIV:
|
|
||||||
case GDScriptTokenizer::TK_OP_ASSIGN_MOD:
|
|
||||||
case GDScriptTokenizer::TK_OP_ASSIGN_MUL:
|
|
||||||
case GDScriptTokenizer::TK_OP_ASSIGN_SHIFT_LEFT:
|
|
||||||
case GDScriptTokenizer::TK_OP_ASSIGN_SHIFT_RIGHT:
|
|
||||||
case GDScriptTokenizer::TK_OP_ASSIGN_SUB:
|
|
||||||
case GDScriptTokenizer::TK_OP_ASSIGN: {
|
|
||||||
// Assignment is not really usage
|
|
||||||
current_function->arguments_usage.write[arg_idx] = current_function->arguments_usage[arg_idx] - 1;
|
|
||||||
} break;
|
|
||||||
default: {
|
|
||||||
current_function->arguments_usage.write[arg_idx] = current_function->arguments_usage[arg_idx] + 1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user