diff options
| author | P1start <rewi-github@whanau.org> | 2014-11-30 17:39:50 +1300 |
|---|---|---|
| committer | P1start <rewi-github@whanau.org> | 2014-11-30 22:28:54 +1300 |
| commit | f5715f7867ab7e13fd3304d85861b1dcb1375a89 (patch) | |
| tree | 81bb4c8b5fe01b53d7fc16a671ec644d86a8ce94 /src/libsyntax/parse/parser.rs | |
| parent | 8d8f41b75f9bec7c7676122f85e049e7d7933298 (diff) | |
| download | rust-f5715f7867ab7e13fd3304d85861b1dcb1375a89.tar.gz rust-f5715f7867ab7e13fd3304d85861b1dcb1375a89.zip | |
Allow trailing commas in array patterns and attributes
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 447f2a376e1..9623a1b75b5 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -3129,6 +3129,11 @@ impl<'a> Parser<'a> { first = false; } else { self.expect(&token::Comma); + + if self.token == token::CloseDelim(token::Bracket) + && (before_slice || after.len() != 0) { + break + } } if before_slice { |
