]> git.lizzy.rs Git - rust.git/commitdiff
Add stream_to_parser_with_base_dir
authortopecongiro <seuchida@gmail.com>
Tue, 21 May 2019 04:18:20 +0000 (13:18 +0900)
committertopecongiro <seuchida@gmail.com>
Tue, 21 May 2019 04:18:20 +0000 (13:18 +0900)
src/libsyntax/parse/mod.rs

index 0611c1d9b42a5a6dd88791c5809e6848d5b97556..53d6838939d0572ef25426eb4f946cc237ab178e 100644 (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.