diff options
| author | Paul Stansifer <paul.stansifer@gmail.com> | 2012-11-21 13:37:43 -0500 |
|---|---|---|
| committer | Graydon Hoare <graydon@mozilla.com> | 2012-11-29 12:09:10 -0800 |
| commit | 0f707f42c847814f60776a3b608c3016b00d7457 (patch) | |
| tree | 8e8c4a8fc17bbef3054d732999cbcd785123ab03 /src/libsyntax/parse | |
| parent | e77491bd870d9b026ebfbda07caab103f111ce8f (diff) | |
| download | rust-0f707f42c847814f60776a3b608c3016b00d7457.tar.gz rust-0f707f42c847814f60776a3b608c3016b00d7457.zip | |
Distinguish `stmt_mac`s that are followed by semicolons and those that aren't.
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index b548695d187..6851bebccc3 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -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 |
