about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2015-08-01 04:49:02 +0000
committerbors <bors@rust-lang.org>2015-08-01 04:49:02 +0000
commitf50518e05ab1fd7632b83c0c6675ec072d1685ea (patch)
tree73736045dcf672a0082a1c9252c9da721c33ee17 /src
parent6beaedaa5f9e93e0f6a1eafb485db1fd26a0e210 (diff)
parentf9692d5d000bc0fc53b65663d5f10c8a187fafb2 (diff)
downloadrust-f50518e05ab1fd7632b83c0c6675ec072d1685ea.tar.gz
rust-f50518e05ab1fd7632b83c0c6675ec072d1685ea.zip
Auto merge of #27447 - eefriedman:parser-cleanup, r=alexcrichton
Diffstat (limited to 'src')
-rw-r--r--src/libsyntax/parse/obsolete.rs31
1 files changed, 0 insertions, 31 deletions
diff --git a/src/libsyntax/parse/obsolete.rs b/src/libsyntax/parse/obsolete.rs
index 5a72477d4ac..bc355f70fb3 100644
--- a/src/libsyntax/parse/obsolete.rs
+++ b/src/libsyntax/parse/obsolete.rs
@@ -13,11 +13,8 @@
 //!
 //! Obsolete syntax that becomes too hard to parse can be removed.
 
-use ast::{Expr, ExprTup};
 use codemap::Span;
 use parse::parser;
-use parse::token;
-use ptr::P;
 
 /// The specific types of unsupported syntax
 #[derive(Copy, Clone, PartialEq, Eq, Hash)]
@@ -29,17 +26,12 @@ pub enum ObsoleteSyntax {
 pub trait ParserObsoleteMethods {
     /// Reports an obsolete syntax non-fatal error.
     fn obsolete(&mut self, sp: Span, kind: ObsoleteSyntax);
-    /// Reports an obsolete syntax non-fatal error, and returns
-    /// a placeholder expression
-    fn obsolete_expr(&mut self, sp: Span, kind: ObsoleteSyntax) -> P<Expr>;
     fn report(&mut self,
               sp: Span,
               kind: ObsoleteSyntax,
               kind_str: &str,
               desc: &str,
               error: bool);
-    fn is_obsolete_ident(&mut self, ident: &str) -> bool;
-    fn eat_obsolete_ident(&mut self, ident: &str) -> bool;
 }
 
 impl<'a> ParserObsoleteMethods for parser::Parser<'a> {
@@ -61,13 +53,6 @@ impl<'a> ParserObsoleteMethods for parser::Parser<'a> {
         self.report(sp, kind, kind_str, desc, error);
     }
 
-    /// Reports an obsolete syntax non-fatal error, and returns
-    /// a placeholder expression
-    fn obsolete_expr(&mut self, sp: Span, kind: ObsoleteSyntax) -> P<Expr> {
-        self.obsolete(sp, kind);
-        self.mk_expr(sp.lo, sp.hi, ExprTup(vec![]))
-    }
-
     fn report(&mut self,
               sp: Span,
               kind: ObsoleteSyntax,
@@ -89,20 +74,4 @@ impl<'a> ParserObsoleteMethods for parser::Parser<'a> {
             self.obsolete_set.insert(kind);
         }
     }
-
-    fn is_obsolete_ident(&mut self, ident: &str) -> bool {
-        match self.token {
-            token::Ident(sid, _) => sid.name == ident,
-            _ => false,
-        }
-    }
-
-    fn eat_obsolete_ident(&mut self, ident: &str) -> bool {
-        if self.is_obsolete_ident(ident) {
-            panictry!(self.bump());
-            true
-        } else {
-            false
-        }
-    }
 }