about summary refs log tree commit diff
path: root/src/comp/syntax
diff options
context:
space:
mode:
authorMarijn Haverbeke <marijnh@gmail.com>2012-02-01 11:54:14 +0100
committerMarijn Haverbeke <marijnh@gmail.com>2012-02-01 12:23:13 +0100
commit2dbaa05af8f2aeef709712725e103836405fa5f5 (patch)
tree9b60a37a5ee7c9d93910e2e8e8c7589730b23d1f /src/comp/syntax
parent856a544d0c55ba00ddcc8aa821e642796673c40e (diff)
downloadrust-2dbaa05af8f2aeef709712725e103836405fa5f5.tar.gz
rust-2dbaa05af8f2aeef709712725e103836405fa5f5.zip
Remove support for native types
Issue #1673
Diffstat (limited to 'src/comp/syntax')
-rw-r--r--src/comp/syntax/ast.rs2
-rw-r--r--src/comp/syntax/ast_util.rs3
-rw-r--r--src/comp/syntax/fold.rs1
-rw-r--r--src/comp/syntax/parse/parser.rs16
-rw-r--r--src/comp/syntax/print/pprust.rs10
-rw-r--r--src/comp/syntax/visit.rs1
6 files changed, 2 insertions, 31 deletions
diff --git a/src/comp/syntax/ast.rs b/src/comp/syntax/ast.rs
index 38986ea9d64..79285c810c9 100644
--- a/src/comp/syntax/ast.rs
+++ b/src/comp/syntax/ast.rs
@@ -45,7 +45,6 @@ enum def {
     def_ty_param(def_id, uint),
     def_binding(def_id),
     def_use(def_id),
-    def_native_ty(def_id),
     def_upvar(def_id, @def, node_id), // node_id == expr_fn or expr_fn_block
 }
 
@@ -477,7 +476,6 @@ type native_item =
      span: span};
 
 enum native_item_ {
-    native_item_ty,
     native_item_fn(fn_decl, [ty_param]),
 }
 
diff --git a/src/comp/syntax/ast_util.rs b/src/comp/syntax/ast_util.rs
index 2e6be5d27d9..bdfaee5d4c2 100644
--- a/src/comp/syntax/ast_util.rs
+++ b/src/comp/syntax/ast_util.rs
@@ -30,8 +30,7 @@ fn def_id_of_def(d: def) -> def_id {
       def_fn(id, _) | def_self(id) | def_mod(id) |
       def_native_mod(id) | def_const(id) | def_arg(id, _) | def_local(id, _) |
       def_variant(_, id) | def_ty(id) | def_ty_param(id, _) |
-      def_binding(id) | def_use(id) | def_native_ty(id) |
-      def_upvar(id, _, _) { id }
+      def_binding(id) | def_use(id) | def_upvar(id, _, _) { id }
     }
 }
 
diff --git a/src/comp/syntax/fold.rs b/src/comp/syntax/fold.rs
index a6e10d183c3..42a6dd22b5b 100644
--- a/src/comp/syntax/fold.rs
+++ b/src/comp/syntax/fold.rs
@@ -189,7 +189,6 @@ fn noop_fold_native_item(&&ni: @native_item, fld: ast_fold) -> @native_item {
           attrs: vec::map(ni.attrs, fold_attribute),
           node:
               alt ni.node {
-                native_item_ty { native_item_ty }
                 native_item_fn(fdec, typms) {
                   native_item_fn({inputs: vec::map(fdec.inputs, fold_arg),
                                   output: fld.fold_ty(fdec.output),
diff --git a/src/comp/syntax/parse/parser.rs b/src/comp/syntax/parse/parser.rs
index 06f4e78372d..35c0bce9a4b 100644
--- a/src/comp/syntax/parse/parser.rs
+++ b/src/comp/syntax/parse/parser.rs
@@ -1963,18 +1963,6 @@ fn parse_item_mod(p: parser, attrs: [ast::attribute]) -> @ast::item {
     ret mk_item(p, lo, hi, id, ast::item_mod(m), attrs + inner_attrs.inner);
 }
 
-fn parse_item_native_type(p: parser, attrs: [ast::attribute]) ->
-   @ast::native_item {
-    let t = parse_type_decl(p);
-    let hi = p.span.hi;
-    expect(p, token::SEMI);
-    ret @{ident: t.ident,
-          attrs: attrs,
-          node: ast::native_item_ty,
-          id: p.get_id(),
-          span: ast_util::mk_sp(t.lo, hi)};
-}
-
 fn parse_item_native_fn(p: parser, attrs: [ast::attribute],
                         purity: ast::purity) -> @ast::native_item {
     let lo = p.last_span.lo;
@@ -1991,9 +1979,7 @@ fn parse_item_native_fn(p: parser, attrs: [ast::attribute],
 
 fn parse_native_item(p: parser, attrs: [ast::attribute]) ->
    @ast::native_item {
-    if eat_word(p, "type") {
-        ret parse_item_native_type(p, attrs);
-    } else if eat_word(p, "fn") {
+    if eat_word(p, "fn") {
         ret parse_item_native_fn(p, attrs, ast::impure_fn);
     } else if eat_word(p, "pure") {
         expect_word(p, "fn");
diff --git a/src/comp/syntax/print/pprust.rs b/src/comp/syntax/print/pprust.rs
index 938e86fc74e..cf2f09d50ea 100644
--- a/src/comp/syntax/print/pprust.rs
+++ b/src/comp/syntax/print/pprust.rs
@@ -380,16 +380,6 @@ fn print_native_item(s: ps, item: @ast::native_item) {
     maybe_print_comment(s, item.span.lo);
     print_outer_attributes(s, item.attrs);
     alt item.node {
-      ast::native_item_ty {
-        ibox(s, indent_unit);
-        ibox(s, 0u);
-        word_nbsp(s, "type");
-        word(s.s, item.ident);
-        end(s); // end the inner ibox
-        word(s.s, ";");
-        end(s); // end the outer ibox
-
-      }
       ast::native_item_fn(decl, typarams) {
         print_fn(s, decl, item.ident, typarams);
         end(s); // end head-ibox
diff --git a/src/comp/syntax/visit.rs b/src/comp/syntax/visit.rs
index de8b53af2c4..8249bd873bf 100644
--- a/src/comp/syntax/visit.rs
+++ b/src/comp/syntax/visit.rs
@@ -211,7 +211,6 @@ fn visit_native_item<E>(ni: @native_item, e: E, v: vt<E>) {
         v.visit_ty_params(tps, e, v);
         visit_fn_decl(fd, e, v);
       }
-      native_item_ty { }
     }
 }