@@ -2,6 +2,7 @@ pub mod attr;
2
2
mod expr;
3
3
mod item;
4
4
mod module;
5
+ pub use module:: { ModulePath , ModulePathSuccess } ;
5
6
mod pat;
6
7
mod path;
7
8
mod ty;
@@ -117,7 +118,8 @@ pub struct Parser<'a> {
117
118
/// Used to determine the path to externally loaded source files.
118
119
pub ( super ) directory : Directory < ' a > ,
119
120
/// `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 ,
121
123
/// Name of the root module this parser originated from. If `None`, then the
122
124
/// name is not known. This does not change while the parser is descending
123
125
/// into modules, and sub-parsers have new values for this name.
@@ -126,7 +128,8 @@ pub struct Parser<'a> {
126
128
token_cursor : TokenCursor ,
127
129
desugar_doc_comments : bool ,
128
130
/// `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 ,
130
133
/// This field is used to keep track of how many left angle brackets we have seen. This is
131
134
/// required in order to detect extra leading left angle brackets (`<` characters) and error
132
135
/// appropriately.
@@ -483,7 +486,8 @@ impl<'a> Parser<'a> {
483
486
}
484
487
}
485
488
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 > {
487
491
self . parse_ident_common ( true )
488
492
}
489
493
@@ -540,7 +544,8 @@ impl<'a> Parser<'a> {
540
544
541
545
/// If the next token is the given keyword, eats it and returns `true`.
542
546
/// 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 {
544
549
if self . check_keyword ( kw) {
545
550
self . bump ( ) ;
546
551
true
0 commit comments