about summary refs log tree commit diff
path: root/src/libsyntax/parse/lexer
diff options
context:
space:
mode:
authorBrendan Zabarauskas <bjzaba@yahoo.com.au>2014-10-27 23:33:30 +1100
committerBrendan Zabarauskas <bjzaba@yahoo.com.au>2014-10-28 15:55:37 +1100
commitfcb78d65f2a3b553b9aaca762910daf10fbb1dce (patch)
tree1c3bfdaa6a50f90d377fdac1dac1bccd18550fd0 /src/libsyntax/parse/lexer
parentd8b1fa0ae0c27e54d3539190683c01e194d36fbd (diff)
downloadrust-fcb78d65f2a3b553b9aaca762910daf10fbb1dce.tar.gz
rust-fcb78d65f2a3b553b9aaca762910daf10fbb1dce.zip
Convert some token functions into methods
Diffstat (limited to 'src/libsyntax/parse/lexer')
-rw-r--r--src/libsyntax/parse/lexer/comments.rs2
-rw-r--r--src/libsyntax/parse/lexer/mod.rs9
2 files changed, 5 insertions, 6 deletions
diff --git a/src/libsyntax/parse/lexer/comments.rs b/src/libsyntax/parse/lexer/comments.rs
index 3298eae125a..66b21aed552 100644
--- a/src/libsyntax/parse/lexer/comments.rs
+++ b/src/libsyntax/parse/lexer/comments.rs
@@ -367,7 +367,7 @@ pub fn gather_comments_and_literals(span_diagnostic: &diagnostic::SpanHandler,
         rdr.next_token();
         //discard, and look ahead; we're working with internal state
         let TokenAndSpan { tok, sp } = rdr.peek();
-        if token::is_lit(&tok) {
+        if tok.is_lit() {
             rdr.with_str_from(bstart, |s| {
                 debug!("tok lit: {}", s);
                 literals.push(Literal {lit: s.to_string(), pos: sp.lo});
diff --git a/src/libsyntax/parse/lexer/mod.rs b/src/libsyntax/parse/lexer/mod.rs
index 4226c3ce3a4..5c642f4096a 100644
--- a/src/libsyntax/parse/lexer/mod.rs
+++ b/src/libsyntax/parse/lexer/mod.rs
@@ -1058,15 +1058,14 @@ impl<'a> StringReader<'a> {
                 let keyword_checking_token =
                     &token::Ident(keyword_checking_ident, false);
                 let last_bpos = self.last_pos;
-                if token::is_keyword(token::keywords::Self,
-                                     keyword_checking_token) {
+                if keyword_checking_token.is_keyword(token::keywords::Self) {
                     self.err_span_(start,
                                    last_bpos,
                                    "invalid lifetime name: 'self \
                                     is no longer a special lifetime");
-                } else if token::is_any_keyword(keyword_checking_token) &&
-                    !token::is_keyword(token::keywords::Static,
-                                       keyword_checking_token) {
+                } else if keyword_checking_token.is_any_keyword() &&
+                    !keyword_checking_token.is_keyword(token::keywords::Static)
+                {
                     self.err_span_(start,
                                    last_bpos,
                                    "invalid lifetime name");