mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-13 04:26:48 +00:00
Skip Dollars when bump raw token
This commit is contained in:
parent
71c13528cd
commit
a42f26502d
@ -129,7 +129,15 @@ impl<'t> Parser<'t> {
|
||||
/// Advances the parser by one token unconditionally
|
||||
/// Mainly use in `token_tree` parsing
|
||||
pub(crate) fn bump_raw(&mut self) {
|
||||
let kind = self.token_source.token_kind(self.token_pos);
|
||||
let mut kind = self.token_source.token_kind(self.token_pos);
|
||||
|
||||
// Skip dollars, do_bump will eat these later
|
||||
let mut i = 0;
|
||||
while kind == SyntaxKind::L_DOLLAR || kind == SyntaxKind::R_DOLLAR {
|
||||
kind = self.token_source.token_kind(self.token_pos + i);
|
||||
i += 1;
|
||||
}
|
||||
|
||||
if kind == EOF {
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user