mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Simpliy how collecting token from src
This commit is contained in:
parent
c8c9230dd2
commit
98aac6b751
3 changed files with 39 additions and 72 deletions
|
@ -298,11 +298,7 @@ fn delim_to_str(d: tt::Delimiter, closing: bool) -> SmolStr {
|
|||
impl<'a> TreeSink for TtTreeSink<'a> {
|
||||
fn token(&mut self, kind: SyntaxKind, n_tokens: u8) {
|
||||
if kind == L_DOLLAR || kind == R_DOLLAR {
|
||||
if let Some(_) = self.cursor.end() {
|
||||
self.cursor = self.cursor.bump();
|
||||
} else {
|
||||
self.cursor = self.cursor.subtree().unwrap();
|
||||
}
|
||||
self.cursor = self.cursor.bump_subtree();
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue