diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-02-14 10:10:06 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-02-14 22:55:21 -0800 |
| commit | a41b0c25295e06b8eebc4bdcb3021354f766cba0 (patch) | |
| tree | d1b3262191eb927bc9e0535318676d711e2a655d /src/libsyntax | |
| parent | 359ac360a453b31494d18bf838f6620032a663e5 (diff) | |
| download | rust-a41b0c25295e06b8eebc4bdcb3021354f766cba0.tar.gz rust-a41b0c25295e06b8eebc4bdcb3021354f766cba0.zip | |
extern mod => extern crate
This was previously implemented, and it just needed a snapshot to go through
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax/lib.rs | 8 | ||||
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 20 | ||||
| -rw-r--r-- | src/libsyntax/print/pprust.rs | 2 |
4 files changed, 16 insertions, 16 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 132cb396ddd..a3025d394da 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -1058,7 +1058,7 @@ pub enum ViewItem_ { // ident: name used to refer to this crate in the code // optional (InternedString,StrStyle): if present, this is a location // (containing arbitrary characters) from which to fetch the crate sources - // For example, extern mod whatever = "github.com/mozilla/rust" + // For example, extern crate whatever = "github.com/mozilla/rust" ViewItemExternMod(Ident, Option<(InternedString,StrStyle)>, NodeId), ViewItemUse(~[@ViewPath]), } diff --git a/src/libsyntax/lib.rs b/src/libsyntax/lib.rs index 78e40a795db..3cbdad9a71d 100644 --- a/src/libsyntax/lib.rs +++ b/src/libsyntax/lib.rs @@ -32,10 +32,10 @@ This API is completely unstable and subject to change. #[deny(non_camel_case_types)]; -#[cfg(test)] extern mod extra; -extern mod serialize; -extern mod term; -extern mod collections; +#[cfg(test)] extern crate extra; +extern crate serialize; +extern crate term; +extern crate collections; pub mod util { pub mod interner; diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index f602925140b..6cde22fad10 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4528,7 +4528,7 @@ impl Parser { // parse one of the items or view items allowed by the // flags; on failure, return IoviNone. // NB: this function no longer parses the items inside an - // extern mod. + // extern crate. fn parse_item_or_view_item(&mut self, attrs: ~[Attribute], macros_allowed: bool) @@ -4567,10 +4567,10 @@ impl Parser { if next_is_mod || self.eat_keyword(keywords::Crate) { if next_is_mod { - self.span_err(self.span, - format!("`extern mod` is obsolete, use \ - `extern crate` instead \ - to refer to external crates.")) + self.span_err(mk_sp(lo, self.last_span.hi), + format!("`extern mod` is obsolete, use \ + `extern crate` instead \ + to refer to external crates.")) } return self.parse_item_extern_crate(lo, visibility, attrs); } @@ -4970,7 +4970,7 @@ impl Parser { let mut items = ~[]; // I think this code would probably read better as a single - // loop with a mutable three-state-variable (for extern mods, + // loop with a mutable three-state-variable (for extern crates, // view items, and regular items) ... except that because // of macros, I'd like to delay that entire check until later. loop { @@ -4986,12 +4986,12 @@ impl Parser { IoviViewItem(view_item) => { match view_item.node { ViewItemUse(..) => { - // `extern mod` must precede `use`. + // `extern crate` must precede `use`. extern_mod_allowed = false; } ViewItemExternMod(..) if !extern_mod_allowed => { self.span_err(view_item.span, - "\"extern mod\" declarations are not allowed here"); + "\"extern crate\" declarations are not allowed here"); } ViewItemExternMod(..) => {} } @@ -5019,7 +5019,7 @@ impl Parser { IoviViewItem(view_item) => { attrs = self.parse_outer_attributes(); self.span_err(view_item.span, - "`use` and `extern mod` declarations must precede items"); + "`use` and `extern crate` declarations must precede items"); } IoviItem(item) => { attrs = self.parse_outer_attributes(); @@ -5059,7 +5059,7 @@ impl Parser { IoviViewItem(view_item) => { // I think this can't occur: self.span_err(view_item.span, - "`use` and `extern mod` declarations must precede items"); + "`use` and `extern crate` declarations must precede items"); } IoviItem(item) => { // FIXME #5668: this will occur for a macro invocation: diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs index bb2f345ac28..ceaa7d1a9a1 100644 --- a/src/libsyntax/print/pprust.rs +++ b/src/libsyntax/print/pprust.rs @@ -2061,7 +2061,7 @@ pub fn print_view_item(s: &mut State, item: &ast::ViewItem) -> io::IoResult<()> if_ok!(print_visibility(s, item.vis)); match item.node { ast::ViewItemExternMod(id, ref optional_path, _) => { - if_ok!(head(s, "extern mod")); + if_ok!(head(s, "extern crate")); if_ok!(print_ident(s, id)); for &(ref p, style) in optional_path.iter() { if_ok!(space(&mut s.s)); |
