@@ -281,8 +281,12 @@ self_param = {
|
||||
"self" ~ mutable? ~ deref_px?
|
||||
}
|
||||
|
||||
method_args = _{
|
||||
((self_param ~ ("," ~ param_list)?) | param_list) ~ ","?
|
||||
}
|
||||
|
||||
method = {
|
||||
visibility? ~ type_expr ~ identifier ~ generics_decl? ~ "(" ~ self_param? ~ ("," ~ param_list)? ~ ")" ~ block
|
||||
visibility? ~ type_expr ~ identifier ~ generics_decl? ~ "(" ~ method_args ~ ")" ~ (block | semicolon)
|
||||
}
|
||||
|
||||
class_item = _{
|
||||
@@ -310,13 +314,8 @@ impl_decl = {
|
||||
// ======================================================
|
||||
trait_requirements = { ":" ~ type_expr_param ~ ("+" ~ type_expr_param)* }
|
||||
|
||||
method_no_body = {
|
||||
visibility? ~ type_expr ~ identifier ~ generics_decl? ~ "(" ~ self_param? ~ ("," ~ param_list)? ~ ")" ~ semicolon
|
||||
}
|
||||
|
||||
trait_item = _{
|
||||
method
|
||||
| method_no_body
|
||||
}
|
||||
|
||||
trait_decl = {
|
||||
|
||||
Reference in New Issue
Block a user