]> git.lizzy.rs Git - rust.git/commitdiff
Added tokenstream parser procedure
authorcgswords <cameronswords@gmail.com>
Thu, 14 Jul 2016 16:52:43 +0000 (09:52 -0700)
committercgswords <cameronswords@gmail.com>
Fri, 15 Jul 2016 22:20:43 +0000 (15:20 -0700)
src/libsyntax/parse/mod.rs

index 9502bc48a3e110f84e0ddf107a3a3181ec92c06d..80ffd8775188d88b811c416f937f93b74f9f8dfe 100644 (file)
@@ -224,10 +224,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<tokenstream::TokenTree>) -> Parser<'a> {
+                               tts: Vec<tokenstream::TokenTree>)
+                               -> 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