mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 13:03:31 +00:00
Use name instead of ident for macro 2.0 sytnax
This commit is contained in:
parent
90ef070db3
commit
737045c1ea
4 changed files with 11 additions and 6 deletions
|
@ -389,7 +389,7 @@ pub(crate) fn mod_item_list(p: &mut Parser) {
|
|||
// macro m($i:ident) {}
|
||||
fn macro_def(p: &mut Parser, m: Marker) {
|
||||
p.expect(T![macro]);
|
||||
p.expect(IDENT);
|
||||
name_r(p, ITEM_RECOVERY_SET);
|
||||
if p.at(T!['{']) {
|
||||
token_tree(p);
|
||||
} else if !p.at(T!['(']) {
|
||||
|
|
|
@ -2,7 +2,8 @@ SOURCE_FILE@[0; 50)
|
|||
MACRO_DEF@[0; 28)
|
||||
MACRO_KW@[0; 5) "macro"
|
||||
WHITESPACE@[5; 6) " "
|
||||
IDENT@[6; 7) "m"
|
||||
NAME@[6; 7)
|
||||
IDENT@[6; 7) "m"
|
||||
WHITESPACE@[7; 8) " "
|
||||
TOKEN_TREE@[8; 28)
|
||||
L_CURLY@[8; 9) "{"
|
||||
|
@ -27,7 +28,8 @@ SOURCE_FILE@[0; 50)
|
|||
MACRO_DEF@[29; 49)
|
||||
MACRO_KW@[29; 34) "macro"
|
||||
WHITESPACE@[34; 35) " "
|
||||
IDENT@[35; 36) "m"
|
||||
NAME@[35; 36)
|
||||
IDENT@[35; 36) "m"
|
||||
TOKEN_TREE@[36; 49)
|
||||
TOKEN_TREE@[36; 46)
|
||||
L_PAREN@[36; 37) "("
|
||||
|
|
|
@ -5,7 +5,8 @@ SOURCE_FILE@[0; 24)
|
|||
WHITESPACE@[3; 4) " "
|
||||
MACRO_KW@[4; 9) "macro"
|
||||
WHITESPACE@[9; 10) " "
|
||||
IDENT@[10; 11) "m"
|
||||
NAME@[10; 11)
|
||||
IDENT@[10; 11) "m"
|
||||
TOKEN_TREE@[11; 23)
|
||||
TOKEN_TREE@[11; 20)
|
||||
L_PAREN@[11; 12) "("
|
||||
|
|
|
@ -2,7 +2,8 @@ SOURCE_FILE@[0; 349)
|
|||
MACRO_DEF@[0; 93)
|
||||
MACRO_KW@[0; 5) "macro"
|
||||
WHITESPACE@[5; 6) " "
|
||||
IDENT@[6; 21) "parse_use_trees"
|
||||
NAME@[6; 21)
|
||||
IDENT@[6; 21) "parse_use_trees"
|
||||
TOKEN_TREE@[21; 93)
|
||||
TOKEN_TREE@[21; 41)
|
||||
L_PAREN@[21; 22) "("
|
||||
|
@ -75,7 +76,8 @@ SOURCE_FILE@[0; 349)
|
|||
MACRO_DEF@[134; 346)
|
||||
MACRO_KW@[134; 139) "macro"
|
||||
WHITESPACE@[139; 140) " "
|
||||
IDENT@[140; 150) "test_merge"
|
||||
NAME@[140; 150)
|
||||
IDENT@[140; 150) "test_merge"
|
||||
TOKEN_TREE@[150; 346)
|
||||
TOKEN_TREE@[150; 203)
|
||||
L_PAREN@[150; 151) "("
|
||||
|
|
Loading…
Reference in a new issue