mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-30 21:16:27 +03:00
Do not reparse token tree when it is not delimited by braces
This commit is contained in:
@@ -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() {
|
||||
|
||||
@@ -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<|>;<|>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user