diff options
Diffstat (limited to 'modules/gdscript/gdscript_parser.h')
| -rw-r--r-- | modules/gdscript/gdscript_parser.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/modules/gdscript/gdscript_parser.h b/modules/gdscript/gdscript_parser.h index d047fa8e46..7fb9ffe9a5 100644 --- a/modules/gdscript/gdscript_parser.h +++ b/modules/gdscript/gdscript_parser.h @@ -1321,6 +1321,7 @@ public: private: friend class GDScriptAnalyzer; + friend class GDScriptParserRef; bool _is_tool = false; String script_path; @@ -1329,6 +1330,7 @@ private: bool can_break = false; bool can_continue = false; List<bool> multiline_stack; + HashMap<String, Ref<GDScriptParserRef>> depended_parsers; ClassNode *head = nullptr; Node *list = nullptr; @@ -1427,6 +1429,8 @@ private: void reset_extents(Node *p_node, GDScriptTokenizer::Token p_token); void reset_extents(Node *p_node, Node *p_from); + HashSet<String> dependencies; + template <typename T> T *alloc_node() { T *node = memnew(T); @@ -1558,6 +1562,8 @@ public: Error parse_binary(const Vector<uint8_t> &p_binary, const String &p_script_path); ClassNode *get_tree() const { return head; } bool is_tool() const { return _is_tool; } + Ref<GDScriptParserRef> get_depended_parser_for(const String &p_path); + const HashMap<String, Ref<GDScriptParserRef>> &get_depended_parsers(); ClassNode *find_class(const String &p_qualified_name) const; bool has_class(const GDScriptParser::ClassNode *p_class) const; static Variant::Type get_builtin_type(const StringName &p_type); // Excluding `Variant::NIL` and `Variant::OBJECT`. @@ -1568,9 +1574,11 @@ public: bool annotation_exists(const String &p_annotation_name) const; const List<ParserError> &get_errors() const { return errors; } - const List<String> get_dependencies() const { - // TODO: Keep track of deps. - return List<String>(); + const HashSet<String> &get_dependencies() const { + return dependencies; + } + void add_dependency(const String &p_dependency) { + dependencies.insert(p_dependency); } #ifdef DEBUG_ENABLED const List<GDScriptWarning> &get_warnings() const { return warnings; } |
