You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
GDScript: Add lambdas to the type analyzer
- Lambdas are always callables (no specific signature match). - Captures from the current context are evaluated.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user