@@ -768,15 +768,15 @@ pub impl Parser {
768
768
}
769
769
}
770
770
771
- fn parse_capture_item_or ( parse_arg_fn : fn ( Parser ) -> arg_or_capture_item )
771
+ fn parse_capture_item_or ( parse_arg_fn : fn ( & Parser ) -> arg_or_capture_item )
772
772
-> arg_or_capture_item
773
773
{
774
774
if self . eat_keyword ( & ~"copy") {
775
775
// XXX outdated syntax now that moves-based-on-type has gone in
776
776
self . parse_ident ( ) ;
777
777
either:: Right ( ( ) )
778
778
} else {
779
- parse_arg_fn ( self )
779
+ parse_arg_fn ( & self )
780
780
}
781
781
}
782
782
@@ -893,8 +893,8 @@ pub impl Parser {
893
893
}
894
894
895
895
fn parse_path_without_tps_ (
896
- parse_ident : fn ( Parser ) -> ident ,
897
- parse_last_ident : fn ( Parser ) -> ident ) -> @path {
896
+ parse_ident : fn ( & Parser ) -> ident ,
897
+ parse_last_ident : fn ( & Parser ) -> ident ) -> @path {
898
898
899
899
maybe_whole ! ( self , nt_path) ;
900
900
let lo = self . span . lo ;
@@ -906,10 +906,10 @@ pub impl Parser {
906
906
&& self . look_ahead ( 1 u) == token:: MOD_SEP ;
907
907
908
908
if is_not_last {
909
- ids. push ( parse_ident ( self ) ) ;
909
+ ids. push ( parse_ident ( & self ) ) ;
910
910
self . expect ( & token:: MOD_SEP ) ;
911
911
} else {
912
- ids. push ( parse_last_ident ( self ) ) ;
912
+ ids. push ( parse_last_ident ( & self ) ) ;
913
913
break ;
914
914
}
915
915
}
@@ -1415,7 +1415,7 @@ pub impl Parser {
1415
1415
fn parse_token_tree ( ) -> token_tree {
1416
1416
maybe_whole ! ( deref self , nt_tt) ;
1417
1417
1418
- fn parse_non_delim_tt_tok ( p : Parser ) -> token_tree {
1418
+ fn parse_non_delim_tt_tok ( p : & Parser ) -> token_tree {
1419
1419
maybe_whole ! ( deref p, nt_tt) ;
1420
1420
match * p. token {
1421
1421
token:: RPAREN | token:: RBRACE | token:: RBRACKET
@@ -1452,7 +1452,7 @@ pub impl Parser {
1452
1452
}
1453
1453
1454
1454
// turn the next token into a tt_tok:
1455
- fn parse_any_tt_tok ( p : Parser ) -> token_tree {
1455
+ fn parse_any_tt_tok ( p : & Parser ) -> token_tree {
1456
1456
let res = tt_tok ( * p. span , * p. token ) ;
1457
1457
p. bump ( ) ;
1458
1458
res
@@ -1468,20 +1468,20 @@ pub impl Parser {
1468
1468
tt_delim (
1469
1469
vec:: append (
1470
1470
// the open delimiter:
1471
- ~[ parse_any_tt_tok ( self ) ] ,
1471
+ ~[ parse_any_tt_tok ( & self ) ] ,
1472
1472
vec:: append (
1473
1473
self . parse_seq_to_before_end (
1474
1474
& ket,
1475
1475
seq_sep_none ( ) ,
1476
1476
|p| p. parse_token_tree ( )
1477
1477
) ,
1478
1478
// the close delimiter:
1479
- ~[ parse_any_tt_tok ( self ) ]
1479
+ ~[ parse_any_tt_tok ( & self ) ]
1480
1480
)
1481
1481
)
1482
1482
)
1483
1483
}
1484
- _ => parse_non_delim_tt_tok ( self )
1484
+ _ => parse_non_delim_tt_tok ( & self )
1485
1485
}
1486
1486
}
1487
1487
@@ -2441,7 +2441,7 @@ pub impl Parser {
2441
2441
fn parse_stmt( +first_item_attrs: ~[ attribute] ) -> @stmt {
2442
2442
maybe_whole ! ( self , nt_stmt) ;
2443
2443
2444
- fn check_expected_item ( p : Parser , current_attrs : ~[ attribute ] ) {
2444
+ fn check_expected_item ( p : & Parser , current_attrs : ~[ attribute ] ) {
2445
2445
// If we have attributes then we should have an item
2446
2446
if !current_attrs. is_empty ( ) {
2447
2447
p. fatal ( ~"expected item after attrs") ;
@@ -2450,15 +2450,15 @@ pub impl Parser {
2450
2450
2451
2451
let lo = self . span . lo ;
2452
2452
if self . is_keyword ( & ~"let ") {
2453
- check_expected_item(self, first_item_attrs);
2453
+ check_expected_item(& self, first_item_attrs);
2454
2454
self.expect_keyword(&~" let") ;
2455
2455
let decl = self . parse_let ( ) ;
2456
2456
return @spanned ( lo, decl. span . hi , stmt_decl ( decl, self . get_id ( ) ) ) ;
2457
2457
} else if is_ident ( & * self . token )
2458
2458
&& !self . is_any_keyword ( & copy * self . token )
2459
2459
&& self . look_ahead ( 1 ) == token:: NOT {
2460
2460
2461
- check_expected_item ( self , first_item_attrs) ;
2461
+ check_expected_item ( & self , first_item_attrs) ;
2462
2462
2463
2463
// Potential trouble: if we allow macros with paths instead of
2464
2464
// idents, we'd need to look ahead past the whole path here...
@@ -2514,7 +2514,7 @@ pub impl Parser {
2514
2514
iovi_none( ) => { /* fallthrough */ }
2515
2515
}
2516
2516
2517
- check_expected_item ( self , item_attrs) ;
2517
+ check_expected_item ( & self , item_attrs) ;
2518
2518
2519
2519
// Remainder are line-expr stmts.
2520
2520
let e = self . parse_expr_res ( RESTRICT_STMT_EXPR ) ;
@@ -2538,7 +2538,7 @@ pub impl Parser {
2538
2538
2539
2539
maybe_whole ! ( pair_empty self , nt_block) ;
2540
2540
2541
- fn maybe_parse_inner_attrs_and_next ( p : Parser , parse_attrs : bool ) ->
2541
+ fn maybe_parse_inner_attrs_and_next ( p : & Parser , parse_attrs : bool ) ->
2542
2542
( ~[ attribute ] , ~[ attribute ] ) {
2543
2543
if parse_attrs {
2544
2544
p. parse_inner_attrs_and_next ( )
@@ -2553,7 +2553,7 @@ pub impl Parser {
2553
2553
}
2554
2554
self . expect ( & token:: LBRACE ) ;
2555
2555
let ( inner, next) =
2556
- maybe_parse_inner_attrs_and_next ( self , parse_attrs) ;
2556
+ maybe_parse_inner_attrs_and_next ( & self , parse_attrs) ;
2557
2557
2558
2558
( inner, self . parse_block_tail_ ( lo, default_blk, next) )
2559
2559
}
@@ -2780,7 +2780,7 @@ pub impl Parser {
2780
2780
} else { ~[ ] }
2781
2781
}
2782
2782
2783
- fn parse_fn_decl ( parse_arg_fn : fn ( Parser ) -> arg_or_capture_item )
2783
+ fn parse_fn_decl ( parse_arg_fn : fn ( & Parser ) -> arg_or_capture_item )
2784
2784
-> fn_decl
2785
2785
{
2786
2786
let args_or_capture_items: ~[ arg_or_capture_item ] =
@@ -2823,11 +2823,11 @@ pub impl Parser {
2823
2823
2824
2824
fn parse_fn_decl_with_self (
2825
2825
parse_arg_fn :
2826
- fn ( Parser ) -> arg_or_capture_item
2826
+ fn ( & Parser ) -> arg_or_capture_item
2827
2827
) -> ( self_ty , fn_decl ) {
2828
2828
fn maybe_parse_self_ty (
2829
2829
cnstr : fn ( +v : mutability ) -> ast:: self_ty_ ,
2830
- p : Parser
2830
+ p : & Parser
2831
2831
) -> ast:: self_ty_ {
2832
2832
// We need to make sure it isn't a mode or a type
2833
2833
if p. token_is_keyword ( & ~"self ", & p. look_ahead ( 1 ) ) ||
@@ -2851,13 +2851,13 @@ pub impl Parser {
2851
2851
let lo = self . span . lo ;
2852
2852
let self_ty = match * self . token {
2853
2853
token:: BINOP ( token:: AND ) => {
2854
- maybe_parse_self_ty ( sty_region, self )
2854
+ maybe_parse_self_ty ( sty_region, & self )
2855
2855
}
2856
2856
token:: AT => {
2857
- maybe_parse_self_ty ( sty_box, self )
2857
+ maybe_parse_self_ty ( sty_box, & self )
2858
2858
}
2859
2859
token:: TILDE => {
2860
- maybe_parse_self_ty ( sty_uniq, self )
2860
+ maybe_parse_self_ty ( sty_uniq, & self )
2861
2861
}
2862
2862
token:: IDENT ( * ) if self . is_self_ident ( ) => {
2863
2863
self . bump ( ) ;
@@ -3028,7 +3028,7 @@ pub impl Parser {
3028
3028
// impl<T> ~[T] : to_str { ... }
3029
3029
// impl<T> to_str for ~[T] { ... }
3030
3030
fn parse_item_impl ( ) -> item_info {
3031
- fn wrap_path ( p : Parser , pt : @path) -> @Ty {
3031
+ fn wrap_path ( p : & Parser , pt : @path) -> @Ty {
3032
3032
@Ty {
3033
3033
id : p. get_id ( ) ,
3034
3034
node : ty_path ( pt , p. get_id ( ) ) ,
0 commit comments