Remove desugar_doc_comments
arg from Parser::new()
.
It's only true at one call site; do the desugaring there instead.
This commit is contained in:
parent
d72fc5ce44
commit
2e6ce68fba
3 changed files with 12 additions and 12 deletions
|
@ -205,7 +205,7 @@ pub fn stream_to_parser<'a>(
|
|||
stream: TokenStream,
|
||||
subparser_name: Option<&'static str>,
|
||||
) -> Parser<'a> {
|
||||
Parser::new(sess, stream, false, subparser_name)
|
||||
Parser::new(sess, stream, subparser_name)
|
||||
}
|
||||
|
||||
/// Runs the given subparser `f` on the tokens of the given `attr`'s item.
|
||||
|
@ -215,7 +215,7 @@ pub fn parse_in<'a, T>(
|
|||
name: &'static str,
|
||||
mut f: impl FnMut(&mut Parser<'a>) -> PResult<'a, T>,
|
||||
) -> PResult<'a, T> {
|
||||
let mut parser = Parser::new(sess, tts, false, Some(name));
|
||||
let mut parser = Parser::new(sess, tts, Some(name));
|
||||
let result = f(&mut parser)?;
|
||||
if parser.token != token::Eof {
|
||||
parser.unexpected()?;
|
||||
|
|
|
@ -388,14 +388,9 @@ pub(super) fn token_descr(token: &Token) -> String {
|
|||
impl<'a> Parser<'a> {
|
||||
pub fn new(
|
||||
sess: &'a ParseSess,
|
||||
mut stream: TokenStream,
|
||||
desugar_doc_comments: bool,
|
||||
stream: TokenStream,
|
||||
subparser_name: Option<&'static str>,
|
||||
) -> Self {
|
||||
if desugar_doc_comments {
|
||||
stream.desugar_doc_comments();
|
||||
}
|
||||
|
||||
let mut parser = Parser {
|
||||
sess,
|
||||
token: Token::dummy(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue