Updated closures

This commit is contained in:
2026-06-05 12:14:19 +02:00
parent 8df4351563
commit 0955bca5bc
4 changed files with 46 additions and 32 deletions
+4 -3
View File
@@ -30,6 +30,7 @@ keyword = {
| "false"
| "dyn"
| "loop"
| "fn"
}
identifier = @{
@@ -448,7 +449,7 @@ match_stmt = {
// CLOSURES
// ------------------------------------------------------
closure = { type_expr? ~ "|" ~ param_list ~ "|" }
closure = { type_expr? ~ "fn" ~ "(" ~ param_list ~ ")" ~ expr }
// ------------------------------------------------------
// TUPLES & ARRAYS
@@ -490,6 +491,7 @@ expr_path = {
primary = {
control_flow
| closure
| basic_stmt
| literal
| expr_path
@@ -571,8 +573,7 @@ not_px = { "!" }
neg_px = { "-" }
prefix = {
closure
| deref_px
deref_px
| mut_ref_px
| ref_px
| not_px