Skip to content

Commit

Permalink
Allow trailing commas in import lists. Closes rust-lang#2582.
Browse files Browse the repository at this point in the history
  • Loading branch information
lkuper committed Jun 13, 2012
1 parent ce750a7 commit cce7327
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/libsyntax/parse/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
10 changes: 10 additions & 0 deletions src/test/run-pass/import-trailing-comma.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import foo::bar::{baz, quux,};

mod foo {
mod bar {
fn baz() { }
fn quux() { }
}
}

fn main() { baz(); quux(); }

0 comments on commit cce7327

Please sign in to comment.