summary refs log tree commit diff
path: root/src/libsyntax/parse/common.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2012-07-30 16:33:02 -0700
committerPatrick Walton <pcwalton@mimiga.net>2012-07-30 19:37:20 -0700
commit51a06c15da1511a79cd7260f7d7473ed94292785 (patch)
tree868d622154bb09cd47583b679f8a9af78285220e /src/libsyntax/parse/common.rs
parent290f079474670a14168104af5e3a32ff49abfae9 (diff)
downloadrust-51a06c15da1511a79cd7260f7d7473ed94292785.tar.gz
rust-51a06c15da1511a79cd7260f7d7473ed94292785.zip
libsyntax: Parse self types in methods
Diffstat (limited to 'src/libsyntax/parse/common.rs')
-rw-r--r--src/libsyntax/parse/common.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libsyntax/parse/common.rs b/src/libsyntax/parse/common.rs
index 314d0494bfb..c747c8e9165 100644
--- a/src/libsyntax/parse/common.rs
+++ b/src/libsyntax/parse/common.rs
@@ -117,14 +117,18 @@ impl parser_common of parser_common for parser {
         }
     }
 
-    fn token_is_keyword(word: ~str, ++tok: token::token) -> bool {
-        self.require_keyword(word);
+    fn token_is_word(word: ~str, ++tok: token::token) -> bool {
         alt tok {
-          token::IDENT(sid, false) { str::eq(word, *self.get_str(sid)) }
-          _ { false }
+          token::IDENT(sid, false) => { str::eq(word, *self.get_str(sid)) }
+          _ => { false }
         }
     }
 
+    fn token_is_keyword(word: ~str, ++tok: token::token) -> bool {
+        self.require_keyword(word);
+        self.token_is_word(word, tok)
+    }
+
     fn is_keyword(word: ~str) -> bool {
         self.token_is_keyword(word, self.token)
     }