File tree Expand file tree Collapse file tree 3 files changed +17
-6
lines changed Expand file tree Collapse file tree 3 files changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -2166,13 +2166,24 @@ fn parse_fn_ty_proto(p: parser) -> ast::proto {
2166
2166
}
2167
2167
}
2168
2168
2169
+ fn fn_expr_lookahead ( tok : token:: token ) -> bool {
2170
+ alt tok {
2171
+ token : : LPAREN . | token:: AT . | token:: TILDE . | token:: BINOP ( _) {
2172
+ true
2173
+ }
2174
+ _ {
2175
+ false
2176
+ }
2177
+ }
2178
+ }
2179
+
2169
2180
fn parse_item ( p : parser , attrs : [ ast:: attribute ] ) -> option:: t < @ast:: item > {
2170
2181
if eat_word ( p, "const" ) {
2171
2182
ret some ( parse_item_const ( p, attrs) ) ;
2172
2183
} else if eat_word ( p, "inline" ) {
2173
2184
expect_word ( p, "fn" ) ;
2174
2185
ret some( parse_item_fn ( p, ast:: impure_fn, attrs) ) ;
2175
- } else if is_word ( p, "fn" ) && p. look_ahead ( 1 u) != token :: LPAREN {
2186
+ } else if is_word ( p, "fn" ) && ! fn_expr_lookahead ( p. look_ahead ( 1 u) ) {
2176
2187
p. bump ( ) ;
2177
2188
ret some( parse_item_fn ( p, ast:: impure_fn, attrs) ) ;
2178
2189
} else if eat_word ( p, "pure" ) {
Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ tag maybe_pointy {
5
5
6
6
type pointy = {
7
7
mutable a : maybe_pointy,
8
- d : sendfn ( ) -> uint,
8
+ d : fn ~ ( ) -> uint,
9
9
} ;
10
10
11
- fn make_uniq_closure < A : send > ( a : A ) -> sendfn ( ) -> uint {
12
- sendfn ( ) -> uint { ptr : : addr_of ( a) as uint }
11
+ fn make_uniq_closure < A : send > ( a : A ) -> fn ~ ( ) -> uint {
12
+ fn ~ ( ) -> uint { ptr : : addr_of ( a) as uint }
13
13
}
14
14
15
15
fn empty_pointy ( ) -> @pointy {
Original file line number Diff line number Diff line change @@ -6,14 +6,14 @@ tag maybe_pointy {
6
6
type pointy = {
7
7
mutable a : maybe_pointy,
8
8
c : ~int,
9
- d : sendfn ( ) ->( ) ,
9
+ d : fn ~ ( ) ->( ) ,
10
10
} ;
11
11
12
12
fn empty_pointy ( ) -> @pointy {
13
13
ret @{
14
14
mutable a : none,
15
15
c : ~22 ,
16
- d : sendfn ( ) ->( ) { } ,
16
+ d : fn ~ ( ) ->( ) { } ,
17
17
}
18
18
}
19
19
You can’t perform that action at this time.
0 commit comments