@@ -2,18 +2,18 @@ use std::borrow::Cow;
22use std:: panic:: { catch_unwind, AssertUnwindSafe } ;
33use std:: path:: { Path , PathBuf } ;
44
5+ use rustc_parse:: { new_sub_parser_from_file, parser:: Parser as RawParser } ;
56use rustc_span:: { DUMMY_SP , Span , symbol:: kw} ;
67use syntax:: ast;
78use syntax:: errors:: Diagnostic ;
8- use syntax:: parse:: parser:: Parser as RawParser ;
99use syntax:: parse:: token:: { DelimToken , TokenKind } ;
10- use syntax:: parse:: { new_sub_parser_from_file , PResult } ;
10+ use syntax:: parse:: PResult ;
1111
1212use crate :: syntux:: session:: ParseSess ;
1313use crate :: { Config , Input } ;
1414
15- pub ( crate ) type DirectoryOwnership = syntax :: parse :: DirectoryOwnership ;
16- pub ( crate ) type ModulePathSuccess = syntax :: parse :: parser:: ModulePathSuccess ;
15+ pub ( crate ) type DirectoryOwnership = rustc_parse :: DirectoryOwnership ;
16+ pub ( crate ) type ModulePathSuccess = rustc_parse :: parser:: ModulePathSuccess ;
1717
1818#[ derive( Clone ) ]
1919pub ( crate ) struct Directory {
@@ -22,8 +22,8 @@ pub(crate) struct Directory {
2222}
2323
2424impl < ' a > Directory {
25- fn to_syntax_directory ( & ' a self ) -> syntax :: parse :: Directory < ' a > {
26- syntax :: parse :: Directory {
25+ fn to_syntax_directory ( & ' a self ) -> rustc_parse :: Directory < ' a > {
26+ rustc_parse :: Directory {
2727 path : Cow :: Borrowed ( & self . path ) ,
2828 ownership : self . ownership ,
2929 }
@@ -89,23 +89,23 @@ impl<'a> ParserBuilder<'a> {
8989 }
9090
9191 fn parser (
92- sess : & ' a syntax:: parse :: ParseSess ,
92+ sess : & ' a syntax:: sess :: ParseSess ,
9393 input : Input ,
9494 directory_ownership : Option < DirectoryOwnership > ,
95- ) -> Result < syntax :: parse :: parser:: Parser < ' a > , Vec < Diagnostic > > {
95+ ) -> Result < rustc_parse :: parser:: Parser < ' a > , Vec < Diagnostic > > {
9696 match input {
9797 Input :: File ( ref file) => Ok ( if let Some ( directory_ownership) = directory_ownership {
98- syntax :: parse :: new_sub_parser_from_file (
98+ rustc_parse :: new_sub_parser_from_file (
9999 sess,
100100 file,
101101 directory_ownership,
102102 None ,
103103 DUMMY_SP ,
104104 )
105105 } else {
106- syntax :: parse :: new_parser_from_file ( sess, file)
106+ rustc_parse :: new_parser_from_file ( sess, file)
107107 } ) ,
108- Input :: Text ( text) => syntax :: parse :: maybe_new_parser_from_source_str (
108+ Input :: Text ( text) => rustc_parse :: maybe_new_parser_from_source_str (
109109 sess,
110110 rustc_span:: FileName :: Custom ( "stdin" . to_owned ( ) ) ,
111111 text,
@@ -130,7 +130,7 @@ pub(crate) enum ParserError {
130130
131131impl < ' a > Parser < ' a > {
132132 pub ( crate ) fn submod_path_from_attr ( attrs : & [ ast:: Attribute ] , path : & Path ) -> Option < PathBuf > {
133- syntax :: parse :: parser:: Parser :: submod_path_from_attr ( attrs, path)
133+ rustc_parse :: parser:: Parser :: submod_path_from_attr ( attrs, path)
134134 }
135135
136136 // FIXME(topecongiro) Use the method from libsyntax[1] once it become public.
@@ -280,7 +280,7 @@ impl<'a> Parser<'a> {
280280 mac : & ' a ast:: Mac ,
281281 base_dir : & Directory ,
282282 ) -> Result < Vec < ast:: Item > , & ' static str > {
283- let mut parser = syntax :: parse :: stream_to_parser_with_base_dir (
283+ let mut parser = rustc_parse :: stream_to_parser_with_base_dir (
284284 sess. inner ( ) ,
285285 mac. tts . clone ( ) ,
286286 base_dir. to_syntax_directory ( ) ,
0 commit comments