Skip to content

Commit e186d3f

Browse files
committed
Add stream_to_parser_with_base_dir
1 parent b7f6b8a commit e186d3f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Diff for: src/libsyntax/parse/mod.rs

+7
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,13 @@ pub fn stream_to_parser(sess: &ParseSess, stream: TokenStream) -> Parser<'_> {
329329
Parser::new(sess, stream, None, true, false)
330330
}
331331

332+
/// Given stream, the `ParseSess` and the base directory, produces a parser.
333+
pub fn stream_to_parser_with_base_dir<'a>(sess: &'a ParseSess,
334+
stream: TokenStream,
335+
base_dir: Directory<'a>) -> Parser<'a> {
336+
Parser::new(sess, stream, Some(base_dir), true, false)
337+
}
338+
332339
/// A sequence separator.
333340
pub struct SeqSep {
334341
/// The seperator token.

0 commit comments

Comments
 (0)