Updated closure syntax

This commit is contained in:
2026-06-23 17:41:49 +02:00
parent e4b7b4abf9
commit 2f12f5ac53
3 changed files with 8 additions and 8 deletions
+6 -6
View File
@@ -30,7 +30,6 @@ keyword = {
| "false"
| "dyn"
| "loop"
| "fn"
| "unsafe"
| "override"
}
@@ -200,8 +199,8 @@ attributes = {
// DECLARATION HELPERS
// ======================================================
var_decl = {
("let" ~ pattern) |
type_expr ~ (!tuple_pattern ~ pattern)
("let" ~ pattern)
| type_expr ~ (!tuple_pattern ~ pattern)
}
field = {
@@ -343,7 +342,8 @@ function_decl = {
// ======================================================
top_level = {
mod_attribute | (attributes ~ (import | impl_for_decl | impl_decl | trait_decl | struct_decl | enum_decl | class_decl | declare_module | function_decl))
mod_attribute
| (attributes ~ (import | impl_for_decl | impl_decl | trait_decl | struct_decl | enum_decl | class_decl | declare_module | function_decl))
}
// ======================================================
@@ -466,8 +466,8 @@ match_stmt = {
// ------------------------------------------------------
closure = {
"fn" ~ "(" ~ param_list ~ ")" ~ type_expr? ~ block
| "fn" ~ "(" ~ param_list ~ ")" ~ type_expr? ~ "->" ~ expr
("(" ~ param_list ~ ")" ~ "=>" ~ expr)
| (type_expr ~ "(" ~ param_list ~ ")" ~ "=>" ~ expr)
}
// ------------------------------------------------------