summaryrefslogtreecommitdiff
path: root/modules/gdscript/gdscript_parser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/gdscript/gdscript_parser.cpp')
-rw-r--r--modules/gdscript/gdscript_parser.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/modules/gdscript/gdscript_parser.cpp b/modules/gdscript/gdscript_parser.cpp
index f52d3100aa..b7189a1af0 100644
--- a/modules/gdscript/gdscript_parser.cpp
+++ b/modules/gdscript/gdscript_parser.cpp
@@ -240,6 +240,7 @@ void GDScriptParser::push_warning(const Node *p_source, GDScriptWarning::Code p_
Error GDScriptParser::parse(const String &p_source_code, const String &p_script_path, bool p_for_completion) {
clear();
tokenizer.set_source_code(p_source_code);
+ script_path = p_script_path;
current = tokenizer.scan();
// Avoid error as the first token.
while (current.type == GDScriptTokenizer::Token::ERROR) {
@@ -936,7 +937,7 @@ GDScriptParser::EnumNode *GDScriptParser::parse_enum() {
}
item.value = current_value++;
enum_node->values.push_back(item);
- if (!found) {
+ if (!named) {
// Add as member of current class.
current_class->add_member(item);
}
@@ -2763,8 +2764,7 @@ String GDScriptParser::DataType::to_string() const {
if (class_type->identifier != nullptr) {
return class_type->identifier->name.operator String();
}
- // TODO: GDScript FQCN
- return "<unnamed GDScript class>";
+ return class_type->fqcn;
case SCRIPT: {
if (is_meta_type) {
return script_type->get_class_name().operator String();
@@ -2779,6 +2779,10 @@ String GDScriptParser::DataType::to_string() const {
}
return native_type.operator String();
}
+ case ENUM:
+ return enum_type.operator String() + " (enum)";
+ case ENUM_VALUE:
+ return enum_type.operator String() + " (enum value)";
case UNRESOLVED:
return "<unresolved type>";
}