@@ -99,7 +99,7 @@ matching, by enforcing the following restrictions on its input:
99
99
is common in the HTML5 syntax.
100
100
*/
101
101
102
- use quote:: { ToTokens , Tokens } ;
102
+ use quote:: ToTokens ;
103
103
use std:: collections:: HashSet ;
104
104
use std:: fs:: File ;
105
105
use std:: io:: { Read , Write } ;
@@ -114,7 +114,7 @@ pub fn expand(from: &Path, to: &Path) {
114
114
let ast = syn:: parse_file ( & source) . expect ( "Parsing rules.rs module" ) ;
115
115
let mut m = MatchTokenParser { } ;
116
116
let ast = m. fold_file ( ast) ;
117
- let code = ast. into_tokens ( ) . to_string ( ) . replace ( "{ " , "{\n " ) . replace ( " }" , "\n }" ) ;
117
+ let code = ast. into_token_stream ( ) . to_string ( ) . replace ( "{ " , "{\n " ) . replace ( " }" , "\n }" ) ;
118
118
File :: create ( to) . unwrap ( ) . write_all ( code. as_bytes ( ) ) . unwrap ( ) ;
119
119
}
120
120
@@ -238,7 +238,7 @@ pub fn expand_match_token(body: &TokenStream) -> syn::Expr {
238
238
syn:: parse2 ( ast. into ( ) ) . unwrap ( )
239
239
}
240
240
241
- fn expand_match_token_macro ( match_token : MatchToken ) -> Tokens {
241
+ fn expand_match_token_macro ( match_token : MatchToken ) -> TokenStream {
242
242
let mut arms = match_token. arms ;
243
243
let to_be_matched = match_token. expr ;
244
244
// Handle the last arm specially at the end.
@@ -249,11 +249,11 @@ fn expand_match_token_macro(match_token: MatchToken) -> Tokens {
249
249
250
250
// Case arms for wildcard matching. We collect these and
251
251
// emit them later.
252
- let mut wildcards_patterns: Vec < Tokens > = Vec :: new ( ) ;
252
+ let mut wildcards_patterns: Vec < TokenStream > = Vec :: new ( ) ;
253
253
let mut wildcards_expressions: Vec < syn:: Expr > = Vec :: new ( ) ;
254
254
255
255
// Tags excluded (by an 'else' RHS) from wildcard matching.
256
- let mut wild_excluded_patterns: Vec < Tokens > = Vec :: new ( ) ;
256
+ let mut wild_excluded_patterns: Vec < TokenStream > = Vec :: new ( ) ;
257
257
258
258
let mut arms_code = Vec :: new ( ) ;
259
259
@@ -284,7 +284,7 @@ fn expand_match_token_macro(match_token: MatchToken) -> Tokens {
284
284
if tag. name . is_none ( ) {
285
285
panic ! ( "'else' may not appear with a wildcard tag" ) ;
286
286
}
287
- wild_excluded_patterns. push ( make_tag_pattern ( & Tokens :: new ( ) , tag) ) ;
287
+ wild_excluded_patterns. push ( make_tag_pattern ( & TokenStream :: new ( ) , tag) ) ;
288
288
}
289
289
}
290
290
@@ -422,7 +422,7 @@ impl Fold for MatchTokenParser {
422
422
}
423
423
}
424
424
425
- fn make_tag_pattern ( binding : & Tokens , tag : Tag ) -> Tokens {
425
+ fn make_tag_pattern ( binding : & TokenStream , tag : Tag ) -> TokenStream {
426
426
let kind = match tag. kind {
427
427
TagKind :: StartTag => quote ! ( :: tokenizer:: StartTag ) ,
428
428
TagKind :: EndTag => quote ! ( :: tokenizer:: EndTag ) ,
0 commit comments