From 3155368093875e644b1adbfa29bb584134c52a89 Mon Sep 17 00:00:00 2001 From: George Marques Date: Fri, 26 Mar 2021 09:03:16 -0300 Subject: GDScript: Add lambdas to the type analyzer - Lambdas are always callables (no specific signature match). - Captures from the current context are evaluated. --- modules/gdscript/tests/test_gdscript.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'modules/gdscript/tests') diff --git a/modules/gdscript/tests/test_gdscript.cpp b/modules/gdscript/tests/test_gdscript.cpp index 445de79e9e..36da64bbaa 100644 --- a/modules/gdscript/tests/test_gdscript.cpp +++ b/modules/gdscript/tests/test_gdscript.cpp @@ -118,6 +118,18 @@ static void test_parser(const String &p_code, const String &p_script_path, const print_line(vformat("%02d:%02d: %s", error.line, error.column, error.message)); } } + + GDScriptAnalyzer analyzer(&parser); + analyzer.analyze(); + + if (err != OK) { + const List &errors = parser.get_errors(); + for (const List::Element *E = errors.front(); E != nullptr; E = E->next()) { + const GDScriptParser::ParserError &error = E->get(); + print_line(vformat("%02d:%02d: %s", error.line, error.column, error.message)); + } + } + #ifdef TOOLS_ENABLED GDScriptParser::TreePrinter printer; printer.print_tree(parser); -- cgit v1.2.3