@@ -2,6 +2,7 @@ pub mod attr;
22mod expr;
33mod item;
44mod module;
5+ pub use module:: { ModulePath , ModulePathSuccess } ;
56mod pat;
67mod path;
78mod ty;
@@ -117,7 +118,8 @@ pub struct Parser<'a> {
117118 /// Used to determine the path to externally loaded source files.
118119 pub ( super ) directory : Directory < ' a > ,
119120 /// `true` to parse sub-modules in other files.
120- pub ( super ) recurse_into_file_modules : bool ,
121+ // Public for rustfmt usage.
122+ pub recurse_into_file_modules : bool ,
121123 /// Name of the root module this parser originated from. If `None`, then the
122124 /// name is not known. This does not change while the parser is descending
123125 /// into modules, and sub-parsers have new values for this name.
@@ -126,7 +128,8 @@ pub struct Parser<'a> {
126128 token_cursor : TokenCursor ,
127129 desugar_doc_comments : bool ,
128130 /// `true` we should configure out of line modules as we parse.
129- cfg_mods : bool ,
131+ // Public for rustfmt usage.
132+ pub cfg_mods : bool ,
130133 /// This field is used to keep track of how many left angle brackets we have seen. This is
131134 /// required in order to detect extra leading left angle brackets (`<` characters) and error
132135 /// appropriately.
@@ -483,7 +486,8 @@ impl<'a> Parser<'a> {
483486 }
484487 }
485488
486- fn parse_ident ( & mut self ) -> PResult < ' a , ast:: Ident > {
489+ // Public for rustfmt usage.
490+ pub fn parse_ident ( & mut self ) -> PResult < ' a , ast:: Ident > {
487491 self . parse_ident_common ( true )
488492 }
489493
@@ -540,7 +544,8 @@ impl<'a> Parser<'a> {
540544
541545 /// If the next token is the given keyword, eats it and returns `true`.
542546 /// Otherwise, returns `false`. An expectation is also added for diagnostics purposes.
543- fn eat_keyword ( & mut self , kw : Symbol ) -> bool {
547+ // Public for rustfmt usage.
548+ pub fn eat_keyword ( & mut self , kw : Symbol ) -> bool {
544549 if self . check_keyword ( kw) {
545550 self . bump ( ) ;
546551 true
0 commit comments