summaryrefslogtreecommitdiffstats
path: root/modules/gdscript/gdscript_parser.h
diff options
context:
space:
mode:
authorGeorge Marques <george@gmarqu.es>2019-03-03 16:36:42 -0300
committerGeorge Marques <george@gmarqu.es>2019-03-03 16:51:54 -0300
commitbda60bfa29a43315755bac92dc15fb0a1a30c22e (patch)
tree04b23f17700651850e109e43ca5b8187ff400af5 /modules/gdscript/gdscript_parser.h
parent4f0590338f0506b74a3a154112598fadb442e13d (diff)
downloadredot-engine-bda60bfa29a43315755bac92dc15fb0a1a30c22e.tar.gz
Add a dependency search mode for GDScript parser
- This mode avoids loading any other resource. - Search for class_name now uses this mode, to avoid loading in the scan thread. - Implement get_dependencies() for GDScript loader, now exporting dependencies only should include the preloaded resources.
Diffstat (limited to 'modules/gdscript/gdscript_parser.h')
-rw-r--r--modules/gdscript/gdscript_parser.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_parser.h b/modules/gdscript/gdscript_parser.h
index 9c1ea1c7e4..809bff8f20 100644
--- a/modules/gdscript/gdscript_parser.h
+++ b/modules/gdscript/gdscript_parser.h
@@ -533,6 +533,8 @@ private:
int error_line;
int error_column;
bool check_types;
+ bool dependencies_only;
+ List<String> dependencies;
#ifdef DEBUG_ENABLED
Set<int> *safe_lines;
#endif // DEBUG_ENABLED
@@ -634,7 +636,7 @@ public:
#ifdef DEBUG_ENABLED
const List<GDScriptWarning> &get_warnings() const { return warnings; }
#endif // DEBUG_ENABLED
- Error parse(const String &p_code, const String &p_base_path = "", bool p_just_validate = false, const String &p_self_path = "", bool p_for_completion = false, Set<int> *r_safe_lines = NULL);
+ Error parse(const String &p_code, const String &p_base_path = "", bool p_just_validate = false, const String &p_self_path = "", bool p_for_completion = false, Set<int> *r_safe_lines = NULL, bool p_dependencies_only = false);
Error parse_bytecode(const Vector<uint8_t> &p_bytecode, const String &p_base_path = "", const String &p_self_path = "");
bool is_tool_script() const;
@@ -653,6 +655,8 @@ public:
int get_completion_argument_index();
int get_completion_identifier_is_function();
+ const List<String> &get_dependencies() const { return dependencies; }
+
void clear();
GDScriptParser();
~GDScriptParser();