Do not reparse token tree when it is not delimited by braces

This commit is contained in:
darksv
2018-09-10 23:21:16 +02:00
parent 64d07c1bd4
commit d0cfeb4f16
2 changed files with 6 additions and 1 deletions
+1 -1
View File
@@ -149,7 +149,7 @@ fn reparser(node: SyntaxNodeRef) -> Option<fn(&mut Parser)> {
MATCH_ARM_LIST => grammar::match_arm_list,
USE_TREE_LIST => grammar::use_tree_list,
EXTERN_ITEM_LIST => grammar::extern_item_list,
TOKEN_TREE => grammar::token_tree,
TOKEN_TREE if node.first_child().unwrap().kind() == L_CURLY => grammar::token_tree,
ITEM_LIST => {
let parent = node.parent().unwrap();
match parent.kind() {
+5
View File
@@ -85,6 +85,11 @@ pub enum A {
foo!{a, b<|><|> d}
", ", c[3]");
do_check(r"
fn foo() {
vec![<|><|>]
}
", "123");
do_check(r"
extern {
fn<|>;<|>
}