summaryrefslogtreecommitdiffstats
path: root/core/object/script_language.h
diff options
context:
space:
mode:
authorEric M <itsjusteza@gmail.com>2021-05-18 13:09:19 +1000
committerEric M <itsjusteza@gmail.com>2021-06-19 22:20:30 +1000
commitd0e78c86d72de1ec5d1c49de5c5ee2fff9589efc (patch)
tree4cf90a7ab74252dae0eccb64e025910b348f92c1 /core/object/script_language.h
parent0a6a71973e50e31fef7b91658ab713ae5db5033f (diff)
downloadredot-engine-d0e78c86d72de1ec5d1c49de5c5ee2fff9589efc.tar.gz
Added support for scripts reporting multiple errors to ScriptTextEditor
Scripts can now report multiple errors to the scripting editors in the engine. UI elements were added to support multiple errors.
Diffstat (limited to 'core/object/script_language.h')
-rw-r--r--core/object/script_language.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/core/object/script_language.h b/core/object/script_language.h
index a22e91870e..5d1f6a0deb 100644
--- a/core/object/script_language.h
+++ b/core/object/script_language.h
@@ -268,6 +268,12 @@ public:
String message;
};
+ struct ScriptError {
+ int line = -1;
+ int column = -1;
+ String message;
+ };
+
void get_core_type_words(List<String> *p_core_type_words) const;
virtual void get_reserved_words(List<String> *p_words) const = 0;
virtual bool is_control_flow_keyword(String p_string) const = 0;
@@ -276,7 +282,7 @@ public:
virtual Ref<Script> get_template(const String &p_class_name, const String &p_base_class_name) const = 0;
virtual void make_template(const String &p_class_name, const String &p_base_class_name, Ref<Script> &p_script) {}
virtual bool is_using_templates() { return false; }
- virtual bool validate(const String &p_script, int &r_line_error, int &r_col_error, String &r_test_error, const String &p_path = "", List<String> *r_functions = nullptr, List<Warning> *r_warnings = nullptr, Set<int> *r_safe_lines = nullptr) const = 0;
+ virtual bool validate(const String &p_script, const String &p_path = "", List<String> *r_functions = nullptr, List<ScriptError> *r_errors = nullptr, List<Warning> *r_warnings = nullptr, Set<int> *r_safe_lines = nullptr) const = 0;
virtual String validate_path(const String &p_path) const { return ""; }
virtual Script *create_script() const = 0;
virtual bool has_named_classes() const = 0;