1
Fork 0

ast_lowering: Stop wrapping ident matchers into groups

The lowered forms goes to metadata, for example during encoding of macro definitions
This commit is contained in:
Vadim Petrochenkov 2022-04-01 23:54:05 +03:00
parent 297a8018b5
commit a150fc2990
3 changed files with 10 additions and 18 deletions

View file

@ -132,6 +132,9 @@ impl<'a> FlattenNonterminals<'a> {
pub fn process_token(&mut self, token: Token) -> TokenStream {
match token.kind {
token::Interpolated(nt) if let token::NtIdent(ident, is_raw) = *nt => {
TokenTree::Token(Token::new(token::Ident(ident.name, is_raw), ident.span)).into()
}
token::Interpolated(nt) => {
let tts = (self.nt_to_tokenstream)(&nt, self.parse_sess, self.synthesize_tokens);
TokenTree::Delimited(