From 9a76ab8b6a787edd6e09be4b7833eaf8703cbff7 Mon Sep 17 00:00:00 2001 From: George Marques Date: Wed, 10 Jun 2020 19:53:25 -0300 Subject: Add new GDScript type checker --- modules/gdscript/gdscript_editor.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'modules/gdscript/gdscript_editor.cpp') diff --git a/modules/gdscript/gdscript_editor.cpp b/modules/gdscript/gdscript_editor.cpp index 5cbd8afc07..e5d72c31da 100644 --- a/modules/gdscript/gdscript_editor.cpp +++ b/modules/gdscript/gdscript_editor.cpp @@ -33,6 +33,7 @@ #include "core/engine.h" #include "core/global_constants.h" #include "core/os/file_access.h" +#include "gdscript_analyzer.h" #include "gdscript_compiler.h" #include "gdscript_parser.h" #include "gdscript_tokenizer.h" @@ -130,6 +131,7 @@ static void get_function_names_recursively(const GDScriptParser::ClassNode *p_cl bool GDScriptLanguage::validate(const String &p_script, int &r_line_error, int &r_col_error, String &r_test_error, const String &p_path, List *r_functions, List *r_warnings, Set *r_safe_lines) const { GDScriptParser parser; + GDScriptAnalyzer analyzer(&parser); Error err = parser.parse(p_script, p_path, false); #ifdef DEBUG_ENABLED @@ -146,6 +148,9 @@ bool GDScriptLanguage::validate(const String &p_script, int &r_line_error, int & // } // } #endif + if (err == OK) { + err = analyzer.analyze(); + } if (err) { GDScriptParser::ParserError parse_error = parser.get_errors().front()->get(); r_line_error = parse_error.line; -- cgit v1.2.3