@@ -763,6 +763,7 @@ pub impl Parser {
763
763
return ty_rptr ( opt_lifetime, mt) ;
764
764
}
765
765
766
+ // parse an optional mode.
766
767
fn parse_arg_mode ( & self ) -> mode {
767
768
if self . eat ( & token:: BINOP ( token:: MINUS ) ) {
768
769
self . obsolete ( * self . span , ObsoleteMode ) ;
@@ -829,6 +830,7 @@ pub impl Parser {
829
830
ty: t, pat: pat, id: self.get_id() }
830
831
}
831
832
833
+ // parse a single function argument
832
834
fn parse_arg(&self) -> arg_or_capture_item {
833
835
either::Left(self.parse_arg_general(true))
834
836
}
@@ -2883,6 +2885,8 @@ pub impl Parser {
2883
2885
self . bump ( ) ;
2884
2886
}
2885
2887
2888
+ // parse the argument list and result type of a function
2889
+ // that may have a self type.
2886
2890
fn parse_fn_decl_with_self (
2887
2891
& self ,
2888
2892
parse_arg_fn :
@@ -3056,6 +3060,7 @@ pub impl Parser {
3056
3060
}
3057
3061
}
3058
3062
3063
+ // parse the name and optional generic types of a function header.
3059
3064
fn parse_fn_header ( & self ) -> ( ident , ast:: Generics ) {
3060
3065
let id = self . parse_ident ( ) ;
3061
3066
let generics = self . parse_generics ( ) ;
@@ -3073,6 +3078,7 @@ pub impl Parser {
3073
3078
span: mk_sp ( lo, hi) }
3074
3079
}
3075
3080
3081
+ // parse an item-position function declaration.
3076
3082
fn parse_item_fn ( & self , purity : purity , abis : AbiSet ) -> item_info {
3077
3083
let ( ident, generics) = self . parse_fn_header ( ) ;
3078
3084
let decl = self . parse_fn_decl ( |p| p. parse_arg ( ) ) ;
0 commit comments