Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Scony committed Jun 27, 2024
1 parent 696b67e commit 81e8749
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
11 changes: 10 additions & 1 deletion gdtoolkit/parser/gdscript.lark
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,17 @@ _lambda_suite: _lambda_body
| _standalone_lambda_stmt
_lambda_body: _NL _INDENT _func_stmt+ _DEDENT
_standalone_lambda_stmt: _simple_func_stmt
| annotation* compound_func_stmt
| annotation* compound_lambda_stmt
| annotation*
?compound_lambda_stmt: lambda_if_stmt
// | while_stmt
// | for_stmt
// | for_stmt_typed
// | match_stmt
lambda_if_stmt: lambda_if_branch (_NL? lambda_elif_branch)* [_NL? lambda_else_branch]
lambda_if_branch: "if" expr ":" _lambda_suite
lambda_elif_branch: "xelif" expr ":" _lambda_suite
lambda_else_branch: "xelse" ":" _lambda_suite
?literal: NUMBER
| string
| rstring
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ func foo():
var x13a = func(): const foo:int =1
var x13b = func(): const foo:=1
# TODO: fix
# var x14 = func(): if true: pass
var x14 = func(): if true: pass
# var x15 = func(): while false: pass
# var x16 = func(): for x in [1]: pass
# var x17 = func(): for x : int in [1]: pass
pass
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ func foo():
var x13a = func(): const foo: int = 1
var x13b = func(): const foo := 1
# TODO: fix
# var x14 = func(): if true: pass
var x14 = func(): if true: pass
# var x15 = func(): while false: pass
# var x16 = func(): for x in [1]: pass
# var x17 = func(): for x : int in [1]: pass
pass

0 comments on commit 81e8749

Please sign in to comment.