Allow trailing commas in import lists. Closes #2582.

This commit is contained in:
Lindsey Kuper 2012-06-13 11:08:21 -07:00
parent ce750a7dbc
commit cce7327487
2 changed files with 11 additions and 1 deletions

View File

@ -2414,7 +2414,7 @@ class parser {
token::LBRACE {
let idents = self.parse_unspanned_seq(
token::LBRACE, token::RBRACE,
seq_sep_trailing_disallowed(token::COMMA),
seq_sep_trailing_allowed(token::COMMA),
{|p| p.parse_path_list_ident()});
let path = @{span: mk_sp(lo, self.span.hi),
global: false, idents: path,

View File

@ -0,0 +1,10 @@
import foo::bar::{baz, quux,};
mod foo {
mod bar {
fn baz() { }
fn quux() { }
}
}
fn main() { baz(); quux(); }