diff options
Diffstat (limited to 'crates/ra_syntax/test_data/parser/inline')
7 files changed, 97 insertions, 5 deletions
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.txt b/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.txt index 4a714ad6b..b05ccc0ed 100644 --- a/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.txt +++ b/crates/ra_syntax/test_data/parser/inline/ok/0129_marco_pat.txt | |||
@@ -16,11 +16,10 @@ SOURCE_FILE@[0; 33) | |||
16 | LET_KW@[16; 19) "let" | 16 | LET_KW@[16; 19) "let" |
17 | WHITESPACE@[19; 20) " " | 17 | WHITESPACE@[19; 20) " " |
18 | MACRO_CALL@[20; 25) | 18 | MACRO_CALL@[20; 25) |
19 | PATH_PAT@[20; 21) | 19 | PATH@[20; 21) |
20 | PATH@[20; 21) | 20 | PATH_SEGMENT@[20; 21) |
21 | PATH_SEGMENT@[20; 21) | 21 | NAME_REF@[20; 21) |
22 | NAME_REF@[20; 21) | 22 | IDENT@[20; 21) "m" |
23 | IDENT@[20; 21) "m" | ||
24 | EXCL@[21; 22) "!" | 23 | EXCL@[21; 22) "!" |
25 | TOKEN_TREE@[22; 25) | 24 | TOKEN_TREE@[22; 25) |
26 | L_PAREN@[22; 23) "(" | 25 | L_PAREN@[22; 23) "(" |
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0147_const_param.rs b/crates/ra_syntax/test_data/parser/inline/ok/0147_const_param.rs new file mode 100644 index 000000000..8cdb3b703 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0147_const_param.rs | |||
@@ -0,0 +1 @@ | |||
struct S<const N: u32>; | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0147_const_param.txt b/crates/ra_syntax/test_data/parser/inline/ok/0147_const_param.txt new file mode 100644 index 000000000..f81de7bac --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0147_const_param.txt | |||
@@ -0,0 +1,23 @@ | |||
1 | SOURCE_FILE@[0; 24) | ||
2 | STRUCT_DEF@[0; 23) | ||
3 | STRUCT_KW@[0; 6) "struct" | ||
4 | WHITESPACE@[6; 7) " " | ||
5 | NAME@[7; 8) | ||
6 | IDENT@[7; 8) "S" | ||
7 | TYPE_PARAM_LIST@[8; 22) | ||
8 | L_ANGLE@[8; 9) "<" | ||
9 | CONST_PARAM@[9; 21) | ||
10 | CONST_KW@[9; 14) "const" | ||
11 | WHITESPACE@[14; 15) " " | ||
12 | NAME@[15; 16) | ||
13 | IDENT@[15; 16) "N" | ||
14 | COLON@[16; 17) ":" | ||
15 | WHITESPACE@[17; 18) " " | ||
16 | PATH_TYPE@[18; 21) | ||
17 | PATH@[18; 21) | ||
18 | PATH_SEGMENT@[18; 21) | ||
19 | NAME_REF@[18; 21) | ||
20 | IDENT@[18; 21) "u32" | ||
21 | R_ANGLE@[21; 22) ">" | ||
22 | SEMI@[22; 23) ";" | ||
23 | WHITESPACE@[23; 24) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0147_macro_def.rs b/crates/ra_syntax/test_data/parser/inline/ok/0147_macro_def.rs new file mode 100644 index 000000000..319a4e2aa --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0147_macro_def.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | macro m { ($i:ident) => {} } | ||
2 | macro m($i:ident) {} | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0147_macro_def.txt b/crates/ra_syntax/test_data/parser/inline/ok/0147_macro_def.txt new file mode 100644 index 000000000..3556099bd --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0147_macro_def.txt | |||
@@ -0,0 +1,45 @@ | |||
1 | SOURCE_FILE@[0; 50) | ||
2 | MACRO_DEF@[0; 28) | ||
3 | MACRO_KW@[0; 5) "macro" | ||
4 | WHITESPACE@[5; 6) " " | ||
5 | NAME@[6; 7) | ||
6 | IDENT@[6; 7) "m" | ||
7 | WHITESPACE@[7; 8) " " | ||
8 | TOKEN_TREE@[8; 28) | ||
9 | L_CURLY@[8; 9) "{" | ||
10 | WHITESPACE@[9; 10) " " | ||
11 | TOKEN_TREE@[10; 20) | ||
12 | L_PAREN@[10; 11) "(" | ||
13 | DOLLAR@[11; 12) "$" | ||
14 | IDENT@[12; 13) "i" | ||
15 | COLON@[13; 14) ":" | ||
16 | IDENT@[14; 19) "ident" | ||
17 | R_PAREN@[19; 20) ")" | ||
18 | WHITESPACE@[20; 21) " " | ||
19 | EQ@[21; 22) "=" | ||
20 | R_ANGLE@[22; 23) ">" | ||
21 | WHITESPACE@[23; 24) " " | ||
22 | TOKEN_TREE@[24; 26) | ||
23 | L_CURLY@[24; 25) "{" | ||
24 | R_CURLY@[25; 26) "}" | ||
25 | WHITESPACE@[26; 27) " " | ||
26 | R_CURLY@[27; 28) "}" | ||
27 | WHITESPACE@[28; 29) "\n" | ||
28 | MACRO_DEF@[29; 49) | ||
29 | MACRO_KW@[29; 34) "macro" | ||
30 | WHITESPACE@[34; 35) " " | ||
31 | NAME@[35; 36) | ||
32 | IDENT@[35; 36) "m" | ||
33 | TOKEN_TREE@[36; 49) | ||
34 | TOKEN_TREE@[36; 46) | ||
35 | L_PAREN@[36; 37) "(" | ||
36 | DOLLAR@[37; 38) "$" | ||
37 | IDENT@[38; 39) "i" | ||
38 | COLON@[39; 40) ":" | ||
39 | IDENT@[40; 45) "ident" | ||
40 | R_PAREN@[45; 46) ")" | ||
41 | WHITESPACE@[46; 47) " " | ||
42 | TOKEN_TREE@[47; 49) | ||
43 | L_CURLY@[47; 48) "{" | ||
44 | R_CURLY@[48; 49) "}" | ||
45 | WHITESPACE@[49; 50) "\n" | ||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.rs b/crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.rs new file mode 100644 index 000000000..3b2be597f --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.rs | |||
@@ -0,0 +1 @@ | |||
pub macro m($:ident) {} | |||
diff --git a/crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.txt b/crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.txt new file mode 100644 index 000000000..cfd79d9c2 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/inline/ok/0148_pub_macro_def.txt | |||
@@ -0,0 +1,21 @@ | |||
1 | SOURCE_FILE@[0; 24) | ||
2 | MACRO_DEF@[0; 23) | ||
3 | VISIBILITY@[0; 3) | ||
4 | PUB_KW@[0; 3) "pub" | ||
5 | WHITESPACE@[3; 4) " " | ||
6 | MACRO_KW@[4; 9) "macro" | ||
7 | WHITESPACE@[9; 10) " " | ||
8 | NAME@[10; 11) | ||
9 | IDENT@[10; 11) "m" | ||
10 | TOKEN_TREE@[11; 23) | ||
11 | TOKEN_TREE@[11; 20) | ||
12 | L_PAREN@[11; 12) "(" | ||
13 | DOLLAR@[12; 13) "$" | ||
14 | COLON@[13; 14) ":" | ||
15 | IDENT@[14; 19) "ident" | ||
16 | R_PAREN@[19; 20) ")" | ||
17 | WHITESPACE@[20; 21) " " | ||
18 | TOKEN_TREE@[21; 23) | ||
19 | L_CURLY@[21; 22) "{" | ||
20 | R_CURLY@[22; 23) "}" | ||
21 | WHITESPACE@[23; 24) "\n" | ||