mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
GDScript: Implement lambdas compilation and runtime
This commit is contained in:
parent
3155368093
commit
c201b212c7
16 changed files with 364 additions and 39 deletions
|
|
@ -4032,11 +4032,11 @@ void GDScriptParser::TreePrinter::print_if(IfNode *p_if, bool p_is_elif) {
|
|||
void GDScriptParser::TreePrinter::print_lambda(LambdaNode *p_lambda) {
|
||||
print_function(p_lambda->function, "Lambda");
|
||||
push_text("| captures [ ");
|
||||
for (const Map<StringName, IdentifierNode *>::Element *E = p_lambda->captures.front(); E; E = E->next()) {
|
||||
push_text(E->key().operator String());
|
||||
if (E->next()) {
|
||||
for (int i = 0; i < p_lambda->captures.size(); i++) {
|
||||
if (i > 0) {
|
||||
push_text(" , ");
|
||||
}
|
||||
push_text(p_lambda->captures[i]->name.operator String());
|
||||
}
|
||||
push_line(" ]");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue