diff options
author | George Marques <george@gmarqu.es> | 2021-03-26 09:03:16 -0300 |
---|---|---|
committer | George Marques <george@gmarqu.es> | 2021-04-28 10:56:16 -0300 |
commit | 3155368093875e644b1adbfa29bb584134c52a89 (patch) | |
tree | 1ab3313b8813c6ca9f39cac46c6fcdb347882b61 /modules/gdscript/tests | |
parent | c6e66a43b0eae569b60c85d3f26009ed52f97861 (diff) |
GDScript: Add lambdas to the type analyzer
- Lambdas are always callables (no specific signature match).
- Captures from the current context are evaluated.
Diffstat (limited to 'modules/gdscript/tests')
-rw-r--r-- | modules/gdscript/tests/test_gdscript.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
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<GDScriptParser::ParserError> &errors = parser.get_errors(); + for (const List<GDScriptParser::ParserError>::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); |