mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
GDScript: Add lambda syntax parsing
Lambda syntax is the same as a the function syntax (using the same
`func` keyword) except that the name is optional and it can be embedded
anywhere an expression is expected. E.g.:
func _ready():
var my_lambda = func(x):
print(x)
my_lambda.call("hello")
This commit is contained in:
parent
f879a08a62
commit
c6e66a43b0
6 changed files with 229 additions and 68 deletions
|
|
@ -66,7 +66,7 @@ static void test_tokenizer(const String &p_code, const Vector<String> &p_lines)
|
|||
StringBuilder token;
|
||||
token += " --> "; // Padding for line number.
|
||||
|
||||
for (int l = current.start_line; l <= current.end_line; l++) {
|
||||
for (int l = current.start_line; l <= current.end_line && l <= p_lines.size(); l++) {
|
||||
print_line(vformat("%04d %s", l, p_lines[l - 1]).replace("\t", tab));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue