diff options
| author | topecongiro <seuchida@gmail.com> | 2019-05-21 13:18:20 +0900 |
|---|---|---|
| committer | topecongiro <seuchida@gmail.com> | 2019-05-21 13:18:20 +0900 |
| commit | e186d3f3e057eef69c60c7d34e474461432ee544 (patch) | |
| tree | da5cca87c2b4bb7abe16e711fde78fd40619e3b2 /src/libsyntax/parse | |
| parent | b7f6b8a56befa0b83b869d27f7887cbcc0f38197 (diff) | |
| download | rust-e186d3f3e057eef69c60c7d34e474461432ee544.tar.gz rust-e186d3f3e057eef69c60c7d34e474461432ee544.zip | |
Add stream_to_parser_with_base_dir
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/mod.rs | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/libsyntax/parse/mod.rs b/src/libsyntax/parse/mod.rs index 0611c1d9b42..53d6838939d 100644 --- a/src/libsyntax/parse/mod.rs +++ b/src/libsyntax/parse/mod.rs @@ -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. |
