Allow trailing commas in array patterns and attributes
This commit is contained in:
parent
8d8f41b75f
commit
f5715f7867
5 changed files with 26 additions and 7 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue