Distinguish stmt_mac
s that are followed by semicolons and those that aren't.
This commit is contained in:
parent
e77491bd87
commit
0f707f42c8
7 changed files with 17 additions and 12 deletions
|
@ -2228,7 +2228,7 @@ impl Parser {
|
|||
|
||||
if id == token::special_idents::invalid {
|
||||
return @spanned(lo, hi, stmt_mac(
|
||||
spanned(lo, hi, mac_invoc_tt(pth, tts))));
|
||||
spanned(lo, hi, mac_invoc_tt(pth, tts)), false));
|
||||
} else {
|
||||
// if it has a special ident, it's definitely an item
|
||||
return @spanned(lo, hi, stmt_decl(
|
||||
|
@ -2380,12 +2380,13 @@ impl Parser {
|
|||
}
|
||||
}
|
||||
|
||||
stmt_mac(m) => {
|
||||
stmt_mac(m, false) => {
|
||||
// Statement macro; might be an expr
|
||||
match self.token {
|
||||
token::SEMI => {
|
||||
self.bump();
|
||||
stmts.push(stmt);
|
||||
stmts.push(@{node: stmt_mac(m, true),
|
||||
..*stmt});
|
||||
}
|
||||
token::RBRACE => {
|
||||
// if a block ends in `m!(arg)` without
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue