diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 6af4d95e888..2147e8ec2eb 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -228,10 +228,18 @@ pub fn filemap_to_parser<'a>(sess: &'a ParseSess, // compiler expands into it pub fn new_parser_from_tts<'a>(sess: &'a ParseSess, cfg: ast::CrateConfig, - tts: Vec) -> Parser<'a> { + tts: Vec) + -> Parser<'a> { tts_to_parser(sess, tts, cfg) } +pub fn new_parser_from_ts<'a>(sess: &'a ParseSess, + cfg: ast::CrateConfig, + ts: tokenstream::TokenStream) + -> Parser<'a> { + tts_to_parser(sess, ts.tts, cfg) +} + // base abstractions