Fix fallout in unit tests.

This commit is contained in:
Jeffrey Seyfried
2017-03-02 01:29:40 +00:00
parent a02c18aa52
commit 0d554139ad
7 changed files with 45 additions and 53 deletions

View File

@@ -9,17 +9,17 @@
// except according to those terms.
use ast::{self, Ident};
use parse::{ParseSess,PResult,filemap_to_tts};
use parse::{ParseSess, PResult, filemap_to_stream};
use parse::{lexer, new_parser_from_source_str};
use parse::parser::Parser;
use ptr::P;
use tokenstream;
use tokenstream::TokenStream;
use std::iter::Peekable;
/// Map a string to tts, using a made-up filename:
pub fn string_to_tts(source_str: String) -> Vec<tokenstream::TokenTree> {
pub fn string_to_stream(source_str: String) -> TokenStream {
let ps = ParseSess::new();
filemap_to_tts(&ps, ps.codemap().new_filemap("bogofile".to_string(), None, source_str))
filemap_to_stream(&ps, ps.codemap().new_filemap("bogofile".to_string(), None, source_str))
}
/// Map string to parser (via tts)