Skip to content

Commit 876fce2

Browse files
committed
cleanup
1 parent 32f97cc commit 876fce2

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

src/libsyntax/parse/lexer.rs

-1
Original file line numberDiff line numberDiff line change
@@ -868,7 +868,6 @@ fn consume_whitespace(rdr: @mut StringReader) {
868868
mod test {
869869
use super::*;
870870

871-
use ast;
872871
use codemap::{BytePos, CodeMap, Span};
873872
use diagnostic;
874873
use parse::token;

src/libsyntax/parse/mod.rs

+2-9
Original file line numberDiff line numberDiff line change
@@ -324,17 +324,10 @@ mod test {
324324
use abi;
325325
use parse::parser::Parser;
326326
use parse::token::{str_to_ident};
327-
use util::parser_testing::{string_to_tts_and_sess, string_to_parser};
327+
use util::parser_testing::{string_to_tts, string_to_parser};
328328
use util::parser_testing::{string_to_expr, string_to_item};
329329
use util::parser_testing::string_to_stmt;
330330

331-
// map a string to tts, return the tt without its parsesess
332-
fn string_to_tts_only(source_str : @str) -> ~[ast::token_tree] {
333-
let (tts,_ps) = string_to_tts_and_sess(source_str);
334-
tts
335-
}
336-
337-
338331
#[cfg(test)] fn to_json_str<E : Encodable<extra::json::Encoder>>(val: @E) -> ~str {
339332
do io::with_str_writer |writer| {
340333
let mut encoder = extra::json::Encoder(writer);
@@ -396,7 +389,7 @@ mod test {
396389
}
397390

398391
#[test] fn string_to_tts_1 () {
399-
let (tts,_ps) = string_to_tts_and_sess(@"fn a (b : int) { b; }");
392+
let tts = string_to_tts(@"fn a (b : int) { b; }");
400393
assert_eq!(to_json_str(@tts),
401394
~"[\
402395
{\

src/libsyntax/parse/parser.rs

+5
Original file line numberDiff line numberDiff line change
@@ -2035,6 +2035,11 @@ impl Parser {
20352035

20362036
// parse a single token tree from the input.
20372037
pub fn parse_token_tree(&self) -> token_tree {
2038+
// FIXME #6994: currently, this is too eager. It
2039+
// parses token trees but also identifies tt_seq's
2040+
// and tt_nonterminals; it's too early to know yet
2041+
// whether something will be a nonterminal or a seq
2042+
// yet.
20382043
maybe_whole!(deref self, nt_tt);
20392044

20402045
// this is the fall-through for the 'match' below.

0 commit comments

Comments
 (0)