Revert "Change fold_tt
and fold_tts
to take token trees by value (instead of by reference)"
This reverts commit 5bf7970ac7
.
This commit is contained in:
parent
c2b56fb7a0
commit
547a930835
8 changed files with 72 additions and 53 deletions
|
@ -2688,12 +2688,13 @@ impl<'a> Parser<'a> {
|
|||
)?;
|
||||
let (sep, repeat) = self.parse_sep_and_kleene_op()?;
|
||||
let name_num = macro_parser::count_names(&seq);
|
||||
return Ok(TokenTree::Sequence(mk_sp(sp.lo, seq_span.hi), SequenceRepetition {
|
||||
tts: seq,
|
||||
separator: sep,
|
||||
op: repeat,
|
||||
num_captures: name_num
|
||||
}));
|
||||
return Ok(TokenTree::Sequence(mk_sp(sp.lo, seq_span.hi),
|
||||
Rc::new(SequenceRepetition {
|
||||
tts: seq,
|
||||
separator: sep,
|
||||
op: repeat,
|
||||
num_captures: name_num
|
||||
})));
|
||||
} else if self.token.is_keyword(keywords::Crate) {
|
||||
self.bump();
|
||||
return Ok(TokenTree::Token(sp, SpecialVarNt(SpecialMacroVar::CrateMacroVar)));
|
||||
|
@ -2849,12 +2850,12 @@ impl<'a> Parser<'a> {
|
|||
_ => {}
|
||||
}
|
||||
|
||||
Ok(TokenTree::Delimited(span, Delimited {
|
||||
Ok(TokenTree::Delimited(span, Rc::new(Delimited {
|
||||
delim: delim,
|
||||
open_span: open_span,
|
||||
tts: tts,
|
||||
close_span: close_span,
|
||||
}))
|
||||
})))
|
||||
},
|
||||
_ => {
|
||||
// invariants: the current token is not a left-delimiter,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue