Updated closure syntax
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user