summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2013-03-22 14:51:35 -0700
committerPatrick Walton <pcwalton@mimiga.net>2013-03-22 22:24:35 -0700
commit68cb53672b74e8b4352453e181667848cd63a183 (patch)
tree6569d209622f27f450785080563b982a51e92726 /src/libsyntax/parse/parser.rs
parent85c9fc6f8f59c146c44aacb4b9abfb2c35e16089 (diff)
downloadrust-68cb53672b74e8b4352453e181667848cd63a183.tar.gz
rust-68cb53672b74e8b4352453e181667848cd63a183.zip
libsyntax: Stop parsing `const`.
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 6f2c0f7ddf5..b7cc0b35023 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -81,6 +81,7 @@ use parse::obsolete::{ObsoleteBareFnType, ObsoleteNewtypeEnum};
 use parse::obsolete::{ObsoleteMode, ObsoleteImplicitSelf};
 use parse::obsolete::{ObsoleteLifetimeNotation, ObsoleteConstManagedPointer};
 use parse::obsolete::{ObsoletePurity, ObsoleteStaticMethod};
+use parse::obsolete::{ObsoleteConstItem};
 use parse::prec::{as_prec, token_to_binop};
 use parse::token::{can_begin_expr, is_ident, is_ident_or_path};
 use parse::token::{is_plain_ident, INTERPOLATED, special_idents};
@@ -3563,7 +3564,9 @@ pub impl Parser {
         let lo = self.span.lo;
 
         // XXX: Obsolete; remove after snap.
-        if !self.eat_keyword(&~"const") {
+        if self.eat_keyword(&~"const") {
+            self.obsolete(*self.last_span, ObsoleteConstItem);
+        } else {
             self.expect_keyword(&~"static");
         }
 
@@ -3959,6 +3962,9 @@ pub impl Parser {
                 (self.is_keyword(&~"static") &&
                     !self.token_is_keyword(&~"fn", &self.look_ahead(1)))) {
             // CONST ITEM
+            if self.is_keyword(&~"const") {
+                self.obsolete(*self.span, ObsoleteConstItem);
+            }
             self.bump();
             let (ident, item_, extra_attrs) = self.parse_item_const();
             return iovi_item(self.mk_item(lo, self.last_span.hi, ident, item_,