Auto merge of #34829 - cgswords:tstream, r=nrc
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.
This commit is contained in:
commit
6aba7be9a6
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user