mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Don't wrap most syntax trees in invisible delimiters when converting to token tree
Otherwise parsing them again doesn't work.
This commit is contained in:
parent
18f6a995d0
commit
ab4ecca210
1 changed files with 8 additions and 2 deletions
|
@ -245,8 +245,14 @@ impl Convertor {
|
|||
}
|
||||
}
|
||||
NodeOrToken::Node(node) => {
|
||||
let child = self.go(&node)?.into();
|
||||
token_trees.push(child);
|
||||
let child_subtree = self.go(&node)?;
|
||||
if child_subtree.delimiter == tt::Delimiter::None
|
||||
&& node.kind() != SyntaxKind::TOKEN_TREE
|
||||
{
|
||||
token_trees.extend(child_subtree.token_trees);
|
||||
} else {
|
||||
token_trees.push(child_subtree.into());
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue