about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2013-10-10 12:57:34 -0700
committerAlex Crichton <alex@alexcrichton.com>2013-10-10 18:04:58 -0700
commitb70306158ff41706e08c691596087502ba40f635 (patch)
treeddd4423a7b803d445042b9ad99a7e97ce9d282c9 /src/libsyntax/parse
parent34d123db4eb03c1b2378b6248ebea5f0f40f2a4f (diff)
downloadrust-b70306158ff41706e08c691596087502ba40f635.tar.gz
rust-b70306158ff41706e08c691596087502ba40f635.zip
Remove named extern blocks from the AST
There's currently a fair amount of code which is being ignored on unnamed blocks
(which are the default now), and I opted to leave it commented out for now. I
intend on very soon revisiting on how we perform linking with extern crates in
an effort to support static linking.
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 9f1a436a4d5..e7c579d2f19 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -4128,7 +4128,6 @@ impl Parser {
     // at this point, this is essentially a wrapper for
     // parse_foreign_items.
     fn parse_foreign_mod_items(&self,
-                               sort: ast::foreign_mod_sort,
                                abis: AbiSet,
                                first_item_attrs: ~[Attribute])
                                -> foreign_mod {
@@ -4144,7 +4143,6 @@ impl Parser {
         }
         assert!(*self.token == token::RBRACE);
         ast::foreign_mod {
-            sort: sort,
             abis: abis,
             view_items: view_items,
             items: foreign_items
@@ -4169,7 +4167,7 @@ impl Parser {
                                  self.this_token_to_str()));
         }
 
-        let (sort, maybe_path, ident) = match *self.token {
+        let (named, maybe_path, ident) = match *self.token {
             token::IDENT(*) => {
                 let the_ident = self.parse_ident();
                 let path = if *self.token == token::EQ {
@@ -4177,7 +4175,7 @@ impl Parser {
                     Some(self.parse_str())
                 }
                 else { None };
-                (ast::named, path, the_ident)
+                (true, path, the_ident)
             }
             _ => {
                 if must_be_named_mod {
@@ -4187,7 +4185,7 @@ impl Parser {
                                          self.this_token_to_str()));
                 }
 
-                (ast::anonymous, None,
+                (false, None,
                  special_idents::clownshoes_foreign_mod)
             }
         };
@@ -4195,14 +4193,14 @@ impl Parser {
         // extern mod foo { ... } or extern { ... }
         if items_allowed && self.eat(&token::LBRACE) {
             // `extern mod foo { ... }` is obsolete.
-            if sort == ast::named {
+            if named {
                 self.obsolete(*self.last_span, ObsoleteNamedExternModule);
             }
 
             let abis = opt_abis.unwrap_or(AbiSet::C());
 
             let (inner, next) = self.parse_inner_attrs_and_next();
-            let m = self.parse_foreign_mod_items(sort, abis, next);
+            let m = self.parse_foreign_mod_items(abis, next);
             self.expect(&token::RBRACE);
 
             return iovi_item(self.mk_item(lo,