cleanup
This commit is contained in:
parent
32f97cc891
commit
876fce2751
@ -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;
|
||||
|
@ -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),
|
||||
~"[\
|
||||
{\
|
||||
|
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user