@@ -893,16 +893,9 @@ pub impl Parser {
893893 codemap:: spanned { node : lit, span : mk_sp ( lo, self . last_span . hi ) }
894894 }
895895
896- fn parse_path_without_tps ( & self ) -> @path {
897- self . parse_path_without_tps_ ( |p| p. parse_ident ( ) ,
898- |p| p. parse_ident ( ) )
899- }
900-
901- fn parse_path_without_tps_ (
902- & self ,
903- parse_ident : fn ( & Parser ) -> ident ,
904- parse_last_ident : fn ( & Parser ) -> ident
905- ) -> @path {
896+ // parse a path that doesn't have type parameters attached
897+ fn parse_path_without_tps ( & self )
898+ -> @ast:: path {
906899 maybe_whole ! ( self , nt_path) ;
907900 let lo = self . span . lo ;
908901 let global = self . eat ( & token:: MOD_SEP ) ;
@@ -913,10 +906,10 @@ pub impl Parser {
913906 && self . look_ahead ( 1 u) == token:: MOD_SEP ;
914907
915908 if is_not_last {
916- ids. push ( parse_ident ( self ) ) ;
909+ ids. push ( self . parse_ident ( ) ) ;
917910 self . expect ( & token:: MOD_SEP ) ;
918911 } else {
919- ids. push ( parse_last_ident ( self ) ) ;
912+ ids. push ( self . parse_ident ( ) ) ;
920913 break ;
921914 }
922915 }
@@ -927,12 +920,7 @@ pub impl Parser {
927920 types : ~[ ] }
928921 }
929922
930- fn parse_value_path ( & self ) -> @path {
931- self . parse_path_without_tps_ ( |p| p. parse_ident ( ) ,
932- |p| p. parse_value_ident ( ) )
933- }
934-
935- fn parse_path_with_tps ( & self , colons : bool ) -> @path {
923+ fn parse_path_with_tps ( & self , colons : bool ) -> @ast:: path {
936924 debug ! ( "parse_path_with_tps(colons=%b)" , colons) ;
937925
938926 maybe_whole ! ( self , nt_path) ;
@@ -2282,7 +2270,7 @@ pub impl Parser {
22822270 }
22832271
22842272 if is_plain_ident ( & * self . token ) && cannot_be_enum_or_struct {
2285- let name = self . parse_value_path ( ) ;
2273+ let name = self . parse_path_without_tps ( ) ;
22862274 let sub;
22872275 if self . eat ( & token:: AT ) {
22882276 sub = Some ( self . parse_pat ( refutable) ) ;
@@ -2355,7 +2343,7 @@ pub impl Parser {
23552343 * self . last_span ,
23562344 ~"expected identifier, found path") ;
23572345 }
2358- let name = self . parse_value_path ( ) ;
2346+ let name = self . parse_path_without_tps ( ) ;
23592347 let sub = if self . eat ( & token:: AT ) {
23602348 Some ( self . parse_pat ( refutable) )
23612349 } else { None } ;
@@ -2453,7 +2441,7 @@ pub impl Parser {
24532441
24542442 // Potential trouble: if we allow macros with paths instead of
24552443 // idents, we'd need to look ahead past the whole path here...
2456- let pth = self . parse_value_path ( ) ;
2444+ let pth = self . parse_path_without_tps ( ) ;
24572445 self . bump ( ) ;
24582446
24592447 let id = if * self . token == token:: LPAREN {
0 commit comments