Skip to content

Commit fecf3b6

Browse files
committed
Added tokenstream parser procedure
1 parent 3dbbe2f commit fecf3b6

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/libsyntax/parse/mod.rs

+9-1
Original file line numberDiff line numberDiff line change
@@ -224,10 +224,18 @@ pub fn filemap_to_parser<'a>(sess: &'a ParseSess,
224224
// compiler expands into it
225225
pub fn new_parser_from_tts<'a>(sess: &'a ParseSess,
226226
cfg: ast::CrateConfig,
227-
tts: Vec<tokenstream::TokenTree>) -> Parser<'a> {
227+
tts: Vec<tokenstream::TokenTree>)
228+
-> Parser<'a> {
228229
tts_to_parser(sess, tts, cfg)
229230
}
230231

232+
pub fn new_parser_from_ts<'a>(sess: &'a ParseSess,
233+
cfg: ast::CrateConfig,
234+
ts: tokenstream::TokenStream)
235+
-> Parser<'a> {
236+
tts_to_parser(sess, ts.tts, cfg)
237+
}
238+
231239

232240
// base abstractions
233241

0 commit comments

Comments
 (0)