You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-06 12:20:30 +00:00
@@ -3686,6 +3686,11 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
|
|||||||
_add_warning(GDScriptWarning::FUNCTION_CONFLICTS_VARIABLE, -1, name);
|
_add_warning(GDScriptWarning::FUNCTION_CONFLICTS_VARIABLE, -1, name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (int i = 0; i < p_class->subclasses.size(); i++) {
|
||||||
|
if (p_class->subclasses[i]->name == name) {
|
||||||
|
_add_warning(GDScriptWarning::FUNCTION_CONFLICTS_CONSTANT, -1, name);
|
||||||
|
}
|
||||||
|
}
|
||||||
#endif // DEBUG_ENABLED
|
#endif // DEBUG_ENABLED
|
||||||
|
|
||||||
if (tokenizer->get_token() != GDScriptTokenizer::TK_PARENTHESIS_OPEN) {
|
if (tokenizer->get_token() != GDScriptTokenizer::TK_PARENTHESIS_OPEN) {
|
||||||
@@ -4630,6 +4635,13 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < current_class->subclasses.size(); i++) {
|
||||||
|
if (current_class->subclasses[i]->name == member.identifier) {
|
||||||
|
_set_error("A class named '" + String(member.identifier) + "' already exists in this class (at line " + itos(current_class->subclasses[i]->line) + ").");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
#ifdef DEBUG_ENABLED
|
#ifdef DEBUG_ENABLED
|
||||||
for (int i = 0; i < current_class->functions.size(); i++) {
|
for (int i = 0; i < current_class->functions.size(); i++) {
|
||||||
if (current_class->functions[i]->name == member.identifier) {
|
if (current_class->functions[i]->name == member.identifier) {
|
||||||
@@ -4874,6 +4886,13 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < current_class->subclasses.size(); i++) {
|
||||||
|
if (current_class->subclasses[i]->name == const_id) {
|
||||||
|
_set_error("A class named '" + String(const_id) + "' already exists in this class (at line " + itos(current_class->subclasses[i]->line) + ").");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tokenizer->advance();
|
tokenizer->advance();
|
||||||
|
|
||||||
if (tokenizer->get_token() == GDScriptTokenizer::TK_COLON) {
|
if (tokenizer->get_token() == GDScriptTokenizer::TK_COLON) {
|
||||||
@@ -4944,6 +4963,13 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < current_class->subclasses.size(); i++) {
|
||||||
|
if (current_class->subclasses[i]->name == enum_name) {
|
||||||
|
_set_error("A class named '" + String(enum_name) + "' already exists in this class (at line " + itos(current_class->subclasses[i]->line) + ").");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
tokenizer->advance();
|
tokenizer->advance();
|
||||||
}
|
}
|
||||||
if (tokenizer->get_token() != GDScriptTokenizer::TK_CURLY_BRACKET_OPEN) {
|
if (tokenizer->get_token() != GDScriptTokenizer::TK_CURLY_BRACKET_OPEN) {
|
||||||
@@ -5029,6 +5055,13 @@ void GDScriptParser::_parse_class(ClassNode *p_class) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (int i = 0; i < current_class->subclasses.size(); i++) {
|
||||||
|
if (current_class->subclasses[i]->name == const_id) {
|
||||||
|
_set_error("A class named '" + String(const_id) + "' already exists in this class (at line " + itos(current_class->subclasses[i]->line) + ").");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
ClassNode::Constant constant;
|
ClassNode::Constant constant;
|
||||||
constant.type.has_type = true;
|
constant.type.has_type = true;
|
||||||
constant.type.kind = DataType::BUILTIN;
|
constant.type.kind = DataType::BUILTIN;
|
||||||
|
|||||||
Reference in New Issue
Block a user