Skip to content

Commit

Permalink
Auto merge of #34829 - cgswords:tstream, r=nrc
Browse files Browse the repository at this point in the history
Added tokenstream parser procedure

A tiny PR that simply adds a procedure for parsing `TokenStream`s to the parser in `src/libsyntax`. This is to ease using `TokenStream`s with the current (old) procedural macro system.
  • Loading branch information
bors authored Jul 17, 2016
2 parents 7ed6068 + fecf3b6 commit 6aba7be
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/libsyntax/parse/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<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

Expand Down

0 comments on commit 6aba7be

Please sign in to comment.