Allow trailing comma in macro 2.0 declarations.

This commit is contained in:
Robert Bartlensky 2019-08-01 21:07:47 +01:00
parent 9152fe4ea0
commit cefbf4d7b5

View File

@ -282,7 +282,10 @@ pub fn compile(
quoted::TokenTree::Sequence(
DelimSpan::dummy(),
Lrc::new(quoted::SequenceRepetition {
tts: vec![quoted::TokenTree::token(token::Semi, def.span)],
tts: vec![quoted::TokenTree::token(
if body.legacy { token::Semi } else { token::Comma },
def.span,
)],
separator: None,
kleene: quoted::KleeneToken::new(quoted::KleeneOp::ZeroOrMore, def.span),
num_captures: 0,