提交 69899b7f 编写于 作者: M Mark Simulacrum

Inline function to avoid naming confusion.

上级 ba07bd5d
......@@ -1032,13 +1032,6 @@ pub fn bump(&mut self) {
self.check_unknown_macro_variable();
}
/// Advance the parser by one token and return the bumped token.
pub fn bump_and_get(&mut self) -> token::Token {
let old_token = mem::replace(&mut self.token, token::Underscore);
self.bump();
old_token
}
/// Advance the parser using provided token as a next one. Use this when
/// consuming a part of a token. For example a single `<` from `<<`.
pub fn bump_with(&mut self,
......@@ -2663,7 +2656,12 @@ pub fn parse_token_tree(&mut self) -> PResult<'a, TokenTree> {
}));
},
token::CloseDelim(_) | token::Eof => unreachable!(),
_ => Ok(TokenTree::Token(self.span, self.bump_and_get())),
_ => {
let token = mem::replace(&mut self.token, token::Underscore);
let res = Ok(TokenTree::Token(self.span, token));
self.bump();
res
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册