]> git.lizzy.rs Git - rust.git/commitdiff
cleanup
authorJohn Clements <clements@racket-lang.org>
Tue, 24 Sep 2013 19:31:24 +0000 (12:31 -0700)
committerJohn Clements <clements@racket-lang.org>
Tue, 24 Sep 2013 19:31:24 +0000 (12:31 -0700)
src/libsyntax/parse/lexer.rs
src/libsyntax/parse/mod.rs
src/libsyntax/parse/parser.rs

index d3b0866d4a79c4635ab7325bc78a9f8625406935..797fd5ba7f6d89c1e22d120d59dc9a9648e342b6 100644 (file)
@@ -868,7 +868,6 @@ fn consume_whitespace(rdr: @mut StringReader) {
 mod test {
     use super::*;
 
-    use ast;
     use codemap::{BytePos, CodeMap, Span};
     use diagnostic;
     use parse::token;
index 91ef55c78f6af106d9d9fa0847b6be0fbfd13664..f5fe53ddb4f713bd67ef09559872c12bb83c6a6b 100644 (file)
@@ -324,17 +324,10 @@ mod test {
     use abi;
     use parse::parser::Parser;
     use parse::token::{str_to_ident};
-    use util::parser_testing::{string_to_tts_and_sess, string_to_parser};
+    use util::parser_testing::{string_to_tts, string_to_parser};
     use util::parser_testing::{string_to_expr, string_to_item};
     use util::parser_testing::string_to_stmt;
 
-    // map a string to tts, return the tt without its parsesess
-    fn string_to_tts_only(source_str : @str) -> ~[ast::token_tree] {
-        let (tts,_ps) = string_to_tts_and_sess(source_str);
-        tts
-    }
-
-
     #[cfg(test)] fn to_json_str<E : Encodable<extra::json::Encoder>>(val: @E) -> ~str {
         do io::with_str_writer |writer| {
             let mut encoder = extra::json::Encoder(writer);
@@ -396,7 +389,7 @@ fn sp (a: uint, b: uint) -> Span {
     }
 
     #[test] fn string_to_tts_1 () {
-        let (tts,_ps) = string_to_tts_and_sess(@"fn a (b : int) { b; }");
+        let tts = string_to_tts(@"fn a (b : int) { b; }");
         assert_eq!(to_json_str(@tts),
         ~"[\
     {\
index 4aad5c24d0f3d8e07e3355f38bd32d4908d844a1..4e64508944e2c20638e54bbe4352d4d5e4657b7d 100644 (file)
@@ -2035,6 +2035,11 @@ fn parse_zerok(parser: &Parser) -> Option<bool> {
 
     // parse a single token tree from the input.
     pub fn parse_token_tree(&self) -> token_tree {
+        // FIXME #6994: currently, this is too eager. It
+        // parses token trees but also identifies tt_seq's
+        // and tt_nonterminals; it's too early to know yet
+        // whether something will be a nonterminal or a seq
+        // yet.
         maybe_whole!(deref self, nt_tt);
 
         // this is the fall-through for the 'match' below.