@@ -389,7 +389,7 @@ pub fn quote(stream: TokenStream) -> TokenStream {
389389 }
390390}
391391
392- /// Consume a `$( CONTENTS ) SEP *` accordingly. It handles repetition by expanding `$( CONTENTS ) SEP *` to `{ REP_EXPANDED }`.
392+ /// Consume a `$( CONTENTS ) SEP *` accordingly.
393393fn consume_dollar_group_sep_star (
394394 content_stream : TokenStream ,
395395 sep_iter : & mut Peekable < <TokenStream as IntoIterator >:: IntoIter > ,
@@ -427,13 +427,13 @@ fn consume_dollar_group_sep_star(
427427 // Check for repeated `$( CONTENTS )` pattern
428428 Some ( TokenTree :: Punct ( dollar) ) if dollar. as_char ( ) == '$' => {
429429 let mut peek_iter = sep_iter. clone ( ) ;
430- peek_iter. next ( ) ; // Skip `$`
430+ peek_iter. next ( ) ; // Skip the `$`
431431 if let Some ( TokenTree :: Group ( next_contents) ) = peek_iter. peek ( )
432432 && next_contents. delimiter ( ) == Delimiter :: Parenthesis
433- // NOTE: only single separator of `$` does not match this `is_valid_sep`` to escape via `$$`.
433+ // NOTE: Only a separator of a single `$` does not match this `is_valid_sep` bacause it is escaped via `$$`.
434434 && is_valid_sep ( & sep_cand)
435435 {
436- // Output current group without expansion
436+ // Output the current `$( CONTENTS ) SEP` without expansion
437437 output_dollar_group_sep ( & mut tokens, current_contents, sep_cand) ;
438438
439439 // Move to the next `$( CONTENTS ) SEP *`
@@ -448,7 +448,7 @@ fn consume_dollar_group_sep_star(
448448 _ => { }
449449 }
450450
451- // Try to extend separator with any other token
451+ // Try to extend separator
452452 if let Some ( token) = sep_iter. peek ( ) {
453453 sep_cand. push ( token. clone ( ) ) ;
454454 if is_valid_sep_prefix ( & sep_cand) {
@@ -466,7 +466,7 @@ fn consume_dollar_group_sep_star(
466466 tokens
467467}
468468
469- /// Output `$( CONTENTS ) SEP *` without expansion
469+ /// Output `$( CONTENTS ) SEP *` without expansion.
470470fn output_dollar_group_sep (
471471 tokens : & mut TokenStream ,
472472 contents : TokenStream ,
@@ -566,6 +566,7 @@ fn is_valid_sep(ts: &[TokenTree]) -> bool {
566566 }
567567}
568568
569+ /// Handle repetition by expanding `$( CONTENTS ) SEP *` to `{ REP_EXPANDED }`.
569570fn expand_dollar_group_sep_star ( tokens : & mut TokenStream , contents : TokenStream , sep : TokenStream ) {
570571 let mut rep_expanded = TokenStream :: new ( ) ;
571572 let meta_vars = collect_meta_vars ( contents. clone ( ) ) ;
0 commit comments