Add stream_to_parser_with_base_dir

This commit is contained in:
topecongiro 2019-05-21 13:18:20 +09:00
parent b7f6b8a56b
commit e186d3f3e0
1 changed files with 7 additions and 0 deletions

View File

@ -329,6 +329,13 @@ pub fn stream_to_parser(sess: &ParseSess, stream: TokenStream) -> Parser<'_> {
Parser::new(sess, stream, None, true, false)
}
/// Given stream, the `ParseSess` and the base directory, produces a parser.
pub fn stream_to_parser_with_base_dir<'a>(sess: &'a ParseSess,
stream: TokenStream,
base_dir: Directory<'a>) -> Parser<'a> {
Parser::new(sess, stream, Some(base_dir), true, false)
}
/// A sequence separator.
pub struct SeqSep {
/// The seperator token.