about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2012-09-07 18:08:21 -0700
committerBrian Anderson <banderson@mozilla.com>2012-09-10 19:04:26 -0700
commit298eb8c7260fe321e30d9c5e22f4ecefc82c4f64 (patch)
treeddd18bdc6c940595bd1df41cfa5d414ffa862a5d /src/libsyntax
parent1a8a0a77b14c44d98501cd9fb0f14ed88d4c38d9 (diff)
downloadrust-298eb8c7260fe321e30d9c5e22f4ecefc82c4f64.tar.gz
rust-298eb8c7260fe321e30d9c5e22f4ecefc82c4f64.zip
Convert 'import' to 'use'. Remove 'import' keyword.
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/ext/auto_serialize.rs6
-rw-r--r--src/libsyntax/ext/base.rs6
-rw-r--r--src/libsyntax/ext/pipes/ast_builder.rs6
-rw-r--r--src/libsyntax/ext/pipes/pipec.rs8
-rw-r--r--src/libsyntax/parse/parser.rs12
-rw-r--r--src/libsyntax/parse/token.rs4
-rw-r--r--src/libsyntax/print/pprust.rs2
7 files changed, 13 insertions, 31 deletions
diff --git a/src/libsyntax/ext/auto_serialize.rs b/src/libsyntax/ext/auto_serialize.rs
index 1bb207adfc2..6a31dac2e8f 100644
--- a/src/libsyntax/ext/auto_serialize.rs
+++ b/src/libsyntax/ext/auto_serialize.rs
@@ -78,10 +78,8 @@ export expand;
 
 // Transitional reexports so qquote can find the paths it is looking for
 mod syntax {
-    import ext;
-    export ext;
-    import parse;
-    export parse;
+    pub use ext;
+    pub use parse;
 }
 
 type ser_tps_map = map::HashMap<ast::ident, fn@(@ast::expr) -> ~[@ast::stmt]>;
diff --git a/src/libsyntax/ext/base.rs b/src/libsyntax/ext/base.rs
index 6de6be82ae2..7894a8d05d3 100644
--- a/src/libsyntax/ext/base.rs
+++ b/src/libsyntax/ext/base.rs
@@ -299,9 +299,9 @@ fn get_mac_body(cx: ext_ctxt, sp: span, args: ast::mac_body)
 // using new syntax. This will be obsolete when #old_macros go away.
 fn tt_args_to_original_flavor(cx: ext_ctxt, sp: span, arg: ~[ast::token_tree])
     -> ast::mac_arg {
-    import ast::{matcher, matcher_, match_tok, match_seq, match_nonterminal};
-    import parse::lexer::{new_tt_reader, reader};
-    import tt::macro_parser::{parse_or_else, matched_seq,
+    use ast::{matcher, matcher_, match_tok, match_seq, match_nonterminal};
+    use parse::lexer::{new_tt_reader, reader};
+    use tt::macro_parser::{parse_or_else, matched_seq,
                               matched_nonterminal};
 
     // these spans won't matter, anyways
diff --git a/src/libsyntax/ext/pipes/ast_builder.rs b/src/libsyntax/ext/pipes/ast_builder.rs
index 9edf97daaee..a4512b7b098 100644
--- a/src/libsyntax/ext/pipes/ast_builder.rs
+++ b/src/libsyntax/ext/pipes/ast_builder.rs
@@ -10,10 +10,8 @@ use ext::base::mk_ctxt;
 
 // Transitional reexports so qquote can find the paths it is looking for
 mod syntax {
-    import ext;
-    export ext;
-    import parse;
-    export parse;
+    pub use ext;
+    pub use parse;
 }
 
 fn path(ids: ~[ident], span: span) -> @ast::path {
diff --git a/src/libsyntax/ext/pipes/pipec.rs b/src/libsyntax/ext/pipes/pipec.rs
index 123628a28a2..600c30f1f8b 100644
--- a/src/libsyntax/ext/pipes/pipec.rs
+++ b/src/libsyntax/ext/pipes/pipec.rs
@@ -16,10 +16,8 @@ use ast_builder::{append_types, path, empty_span};
 
 // Transitional reexports so qquote can find the paths it is looking for
 mod syntax {
-    import ext;
-    export ext;
-    import parse;
-    export parse;
+    pub use ext;
+    pub use parse;
 }
 
 trait gen_send {
@@ -321,7 +319,7 @@ impl protocol: gen_init {
         };
 
         cx.parse_item(fmt!("fn init%s() -> (client::%s, server::%s)\
-                            { import pipes::HasBuffer; %s }",
+                            { use pipes::HasBuffer; %s }",
                            start_state.ty_params.to_source(cx),
                            start_state.to_ty(cx).to_source(cx),
                            start_state.to_ty(cx).to_source(cx),
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 6cec730d83d..74370d005ce 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -3345,15 +3345,6 @@ impl parser {
                 vis: visibility,
                 span: mk_sp(lo, self.last_span.hi)
             });
-        } else if self.eat_keyword(~"import") {
-            let view_paths = self.parse_view_paths();
-            self.expect(token::SEMI);
-            return iovi_view_item(@{
-                node: view_item_import(view_paths),
-                attrs: attrs,
-                vis: visibility,
-                span: mk_sp(lo, self.last_span.hi)
-            });
         } else if self.eat_keyword(~"export") {
             let view_paths = self.parse_view_paths();
             self.expect(token::SEMI);
@@ -3506,7 +3497,6 @@ impl parser {
             next_tok = self.look_ahead(2);
         };
         self.token_is_keyword(~"use", tok)
-            || self.token_is_keyword(~"import", tok)
             || self.token_is_keyword(~"export", tok)
             || (self.token_is_keyword(~"extern", tok) &&
                 self.token_is_keyword(~"mod", next_tok))
@@ -3516,8 +3506,6 @@ impl parser {
         let lo = self.span.lo, vis = self.parse_visibility();
         let node = if self.eat_keyword(~"use") {
             self.parse_use(vis)
-        } else if self.eat_keyword(~"import") {
-            view_item_import(self.parse_view_paths())
         } else if self.eat_keyword(~"export") {
             view_item_export(self.parse_view_paths())
         } else if self.eat_keyword(~"extern") {
diff --git a/src/libsyntax/parse/token.rs b/src/libsyntax/parse/token.rs
index 5f1bdf2ff3e..cfef2f96581 100644
--- a/src/libsyntax/parse/token.rs
+++ b/src/libsyntax/parse/token.rs
@@ -279,7 +279,7 @@ pure fn is_bar(t: token) -> bool {
 
 
 mod special_idents {
-    import ast::ident;
+    use ast::ident;
     const underscore : ident = 0u;
     const anon : ident = 1u;
     const dtor : ident = 2u; // 'drop', but that's reserved
@@ -433,7 +433,7 @@ fn strict_keyword_table() -> HashMap<~str, ()> {
         ~"do", ~"drop",
         ~"else", ~"enum", ~"export", ~"extern",
         ~"false", ~"for",
-        ~"if", ~"import",
+        ~"if",
         ~"let", ~"log", ~"loop",
         ~"match", ~"mod", ~"move", ~"mut",
         ~"pure",
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index 46faa67114e..62ec882e345 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -1757,7 +1757,7 @@ fn print_view_item(s: ps, item: @ast::view_item) {
       }
 
       ast::view_item_import(vps) => {
-        head(s, ~"import");
+        head(s, ~"use");
         print_view_paths(s, vps);
       }