@@ -244,8 +244,8 @@ pub fn compile<'cx>(cx: &'cx mut ExtCtxt,
244244 // $( $lhs:tt => $rhs:tt );+
245245 // ...quasiquoting this would be nice.
246246 // These spans won't matter, anyways
247- let match_lhs_tok = MatchNt ( lhs_nm, special_idents:: tt, token :: Plain , token :: Plain ) ;
248- let match_rhs_tok = MatchNt ( rhs_nm, special_idents:: tt, token :: Plain , token :: Plain ) ;
247+ let match_lhs_tok = MatchNt ( lhs_nm, special_idents:: tt) ;
248+ let match_rhs_tok = MatchNt ( rhs_nm, special_idents:: tt) ;
249249 let argument_gram = vec ! (
250250 TokenTree :: Sequence ( DUMMY_SP ,
251251 Rc :: new( ast:: SequenceRepetition {
@@ -415,7 +415,7 @@ fn check_matcher_old<'a, I>(cx: &mut ExtCtxt, matcher: I, follow: &Token, on_fai
415415 let mut tokens = matcher. peekable ( ) ;
416416 while let Some ( token) = tokens. next ( ) {
417417 last = match * token {
418- TokenTree :: Token ( sp, MatchNt ( ref name, ref frag_spec, _ , _ ) ) => {
418+ TokenTree :: Token ( sp, MatchNt ( ref name, ref frag_spec) ) => {
419419 // ii. If T is a simple NT, look ahead to the next token T' in
420420 // M. If T' is in the set FOLLOW(NT), continue. Else; reject.
421421 if can_be_followed_by_any ( & frag_spec. name . as_str ( ) ) {
@@ -881,7 +881,7 @@ fn check_matcher_core(cx: &mut ExtCtxt,
881881 // Now `last` holds the complete set of NT tokens that could
882882 // end the sequence before SUFFIX. Check that every one works with `suffix`.
883883 ' each_last: for & ( _sp, ref t) in & last. tokens {
884- if let MatchNt ( ref name, ref frag_spec, _ , _ ) = * t {
884+ if let MatchNt ( ref name, ref frag_spec) = * t {
885885 for & ( sp, ref next_token) in & suffix_first. tokens {
886886 match is_in_follow ( cx, next_token, & frag_spec. name . as_str ( ) ) {
887887 Err ( msg) => {
@@ -917,9 +917,8 @@ fn check_matcher_core(cx: &mut ExtCtxt,
917917 last
918918}
919919
920-
921920fn token_can_be_followed_by_any ( tok : & Token ) -> bool {
922- if let & MatchNt ( _, ref frag_spec, _ , _ ) = tok {
921+ if let & MatchNt ( _, ref frag_spec) = tok {
923922 frag_can_be_followed_by_any ( & frag_spec. name . as_str ( ) )
924923 } else {
925924 // (Non NT's can always be followed by anthing in matchers.)
@@ -1005,18 +1004,17 @@ fn is_in_follow(_: &ExtCtxt, tok: &Token, frag: &str) -> Result<bool, String> {
10051004 "pat" => {
10061005 match * tok {
10071006 FatArrow | Comma | Eq | BinOp ( token:: Or ) => Ok ( true ) ,
1008- Ident ( i, _ ) if ( i. name . as_str ( ) == "if" ||
1009- i. name . as_str ( ) == "in" ) => Ok ( true ) ,
1007+ Ident ( i) if ( i. name . as_str ( ) == "if" ||
1008+ i. name . as_str ( ) == "in" ) => Ok ( true ) ,
10101009 _ => Ok ( false )
10111010 }
10121011 } ,
10131012 "path" | "ty" => {
10141013 match * tok {
10151014 OpenDelim ( token:: DelimToken :: Brace ) | OpenDelim ( token:: DelimToken :: Bracket ) |
10161015 Comma | FatArrow | Colon | Eq | Gt | Semi | BinOp ( token:: Or ) => Ok ( true ) ,
1017- MatchNt ( _, ref frag, _, _) if frag. name . as_str ( ) == "block" => Ok ( true ) ,
1018- Ident ( i, _) if ( i. name . as_str ( ) == "as" ||
1019- i. name . as_str ( ) == "where" ) => Ok ( true ) ,
1016+ MatchNt ( _, ref frag) if frag. name . as_str ( ) == "block" => Ok ( true ) ,
1017+ Ident ( i) if i. name . as_str ( ) == "as" || i. name . as_str ( ) == "where" => Ok ( true ) ,
10201018 _ => Ok ( false )
10211019 }
10221020 } ,
@@ -1036,7 +1034,7 @@ fn is_in_follow(_: &ExtCtxt, tok: &Token, frag: &str) -> Result<bool, String> {
10361034
10371035fn has_legal_fragment_specifier ( tok : & Token ) -> Result < ( ) , String > {
10381036 debug ! ( "has_legal_fragment_specifier({:?})" , tok) ;
1039- if let & MatchNt ( _, ref frag_spec, _ , _ ) = tok {
1037+ if let & MatchNt ( _, ref frag_spec) = tok {
10401038 let s = & frag_spec. name . as_str ( ) ;
10411039 if !is_legal_fragment_specifier ( s) {
10421040 return Err ( s. to_string ( ) ) ;
0 commit comments