diff options
Diffstat (limited to 'crates/libsyntax2/tests/data/parser')
14 files changed, 288 insertions, 178 deletions
diff --git a/crates/libsyntax2/tests/data/parser/inline/0016_type_item_where_clause.txt b/crates/libsyntax2/tests/data/parser/inline/0016_type_item_where_clause.txt index 5309b9a7b..c3fca013e 100644 --- a/crates/libsyntax2/tests/data/parser/inline/0016_type_item_where_clause.txt +++ b/crates/libsyntax2/tests/data/parser/inline/0016_type_item_where_clause.txt | |||
@@ -16,11 +16,12 @@ ROOT@[0; 31) | |||
16 | IDENT@[15; 18) "Foo" | 16 | IDENT@[15; 18) "Foo" |
17 | COLON@[18; 19) | 17 | COLON@[18; 19) |
18 | WHITESPACE@[19; 20) | 18 | WHITESPACE@[19; 20) |
19 | PATH@[20; 24) | 19 | PATH_TYPE@[20; 24) |
20 | PATH_SEGMENT@[20; 24) | 20 | PATH@[20; 24) |
21 | NAME_REF@[20; 24) | 21 | PATH_SEGMENT@[20; 24) |
22 | IDENT@[20; 24) "Copy" | 22 | NAME_REF@[20; 24) |
23 | err: `expected COMMA` | 23 | IDENT@[20; 24) "Copy" |
24 | err: `expected COMMA` | ||
24 | WHITESPACE@[24; 25) | 25 | WHITESPACE@[24; 25) |
25 | EQ@[25; 26) | 26 | EQ@[25; 26) |
26 | WHITESPACE@[26; 27) | 27 | WHITESPACE@[26; 27) |
diff --git a/crates/libsyntax2/tests/data/parser/inline/0041_type_param_bounds.txt b/crates/libsyntax2/tests/data/parser/inline/0041_type_param_bounds.txt index ef9d1f31e..549b571c2 100644 --- a/crates/libsyntax2/tests/data/parser/inline/0041_type_param_bounds.txt +++ b/crates/libsyntax2/tests/data/parser/inline/0041_type_param_bounds.txt | |||
@@ -16,19 +16,21 @@ ROOT@[0; 35) | |||
16 | PLUS@[15; 16) | 16 | PLUS@[15; 16) |
17 | WHITESPACE@[16; 17) | 17 | WHITESPACE@[16; 17) |
18 | QUESTION@[17; 18) | 18 | QUESTION@[17; 18) |
19 | PATH@[18; 23) | 19 | PATH_TYPE@[18; 32) |
20 | PATH_SEGMENT@[18; 23) | 20 | PATH@[18; 23) |
21 | NAME_REF@[18; 23) | 21 | PATH_SEGMENT@[18; 23) |
22 | IDENT@[18; 23) "Sized" | 22 | NAME_REF@[18; 23) |
23 | WHITESPACE@[23; 24) | 23 | IDENT@[18; 23) "Sized" |
24 | PLUS@[24; 25) | 24 | WHITESPACE@[23; 24) |
25 | WHITESPACE@[25; 26) | 25 | PLUS@[24; 25) |
26 | L_PAREN@[26; 27) | 26 | WHITESPACE@[25; 26) |
27 | PATH@[27; 31) | 27 | L_PAREN@[26; 27) |
28 | PATH_SEGMENT@[27; 31) | 28 | PATH_TYPE@[27; 31) |
29 | NAME_REF@[27; 31) | 29 | PATH@[27; 31) |
30 | IDENT@[27; 31) "Copy" | 30 | PATH_SEGMENT@[27; 31) |
31 | R_PAREN@[31; 32) | 31 | NAME_REF@[27; 31) |
32 | IDENT@[27; 31) "Copy" | ||
33 | R_PAREN@[31; 32) | ||
32 | R_ANGLE@[32; 33) | 34 | R_ANGLE@[32; 33) |
33 | SEMI@[33; 34) | 35 | SEMI@[33; 34) |
34 | WHITESPACE@[34; 35) | 36 | WHITESPACE@[34; 35) |
diff --git a/crates/libsyntax2/tests/data/parser/inline/0049_trait_item_list.txt b/crates/libsyntax2/tests/data/parser/inline/0049_trait_item_list.txt index e18c166f6..72d9220e8 100644 --- a/crates/libsyntax2/tests/data/parser/inline/0049_trait_item_list.txt +++ b/crates/libsyntax2/tests/data/parser/inline/0049_trait_item_list.txt | |||
@@ -18,10 +18,11 @@ ROOT@[0; 83) | |||
18 | IDENT@[18; 19) "A" | 18 | IDENT@[18; 19) "A" |
19 | COLON@[19; 20) | 19 | COLON@[19; 20) |
20 | WHITESPACE@[20; 21) | 20 | WHITESPACE@[20; 21) |
21 | PATH@[21; 26) | 21 | PATH_TYPE@[21; 26) |
22 | PATH_SEGMENT@[21; 26) | 22 | PATH@[21; 26) |
23 | NAME_REF@[21; 26) | 23 | PATH_SEGMENT@[21; 26) |
24 | IDENT@[21; 26) "Clone" | 24 | NAME_REF@[21; 26) |
25 | IDENT@[21; 26) "Clone" | ||
25 | SEMI@[26; 27) | 26 | SEMI@[26; 27) |
26 | WHITESPACE@[27; 32) | 27 | WHITESPACE@[27; 32) |
27 | CONST_DEF@[32; 45) | 28 | CONST_DEF@[32; 45) |
diff --git a/crates/libsyntax2/tests/data/parser/inline/0056_trait_item.txt b/crates/libsyntax2/tests/data/parser/inline/0056_trait_item.txt index 6e9ddcfb4..40c77db4b 100644 --- a/crates/libsyntax2/tests/data/parser/inline/0056_trait_item.txt +++ b/crates/libsyntax2/tests/data/parser/inline/0056_trait_item.txt | |||
@@ -12,17 +12,19 @@ ROOT@[0; 42) | |||
12 | R_ANGLE@[9; 10) | 12 | R_ANGLE@[9; 10) |
13 | COLON@[10; 11) | 13 | COLON@[10; 11) |
14 | WHITESPACE@[11; 12) | 14 | WHITESPACE@[11; 12) |
15 | PATH@[12; 16) | 15 | PATH_TYPE@[12; 24) |
16 | PATH_SEGMENT@[12; 16) | 16 | PATH@[12; 16) |
17 | NAME_REF@[12; 16) | 17 | PATH_SEGMENT@[12; 16) |
18 | IDENT@[12; 16) "Hash" | 18 | NAME_REF@[12; 16) |
19 | WHITESPACE@[16; 17) | 19 | IDENT@[12; 16) "Hash" |
20 | PLUS@[17; 18) | 20 | WHITESPACE@[16; 17) |
21 | WHITESPACE@[18; 19) | 21 | PLUS@[17; 18) |
22 | PATH@[19; 24) | 22 | WHITESPACE@[18; 19) |
23 | PATH_SEGMENT@[19; 24) | 23 | PATH_TYPE@[19; 24) |
24 | NAME_REF@[19; 24) | 24 | PATH@[19; 24) |
25 | IDENT@[19; 24) "Clone" | 25 | PATH_SEGMENT@[19; 24) |
26 | NAME_REF@[19; 24) | ||
27 | IDENT@[19; 24) "Clone" | ||
26 | WHITESPACE@[24; 25) | 28 | WHITESPACE@[24; 25) |
27 | WHERE_CLAUSE@[25; 38) | 29 | WHERE_CLAUSE@[25; 38) |
28 | WHERE_KW@[25; 30) | 30 | WHERE_KW@[25; 30) |
@@ -35,10 +37,11 @@ ROOT@[0; 42) | |||
35 | IDENT@[31; 32) "U" | 37 | IDENT@[31; 32) "U" |
36 | COLON@[32; 33) | 38 | COLON@[32; 33) |
37 | WHITESPACE@[33; 34) | 39 | WHITESPACE@[33; 34) |
38 | PATH@[34; 38) | 40 | PATH_TYPE@[34; 38) |
39 | PATH_SEGMENT@[34; 38) | 41 | PATH@[34; 38) |
40 | NAME_REF@[34; 38) | 42 | PATH_SEGMENT@[34; 38) |
41 | IDENT@[34; 38) "Copy" | 43 | NAME_REF@[34; 38) |
44 | IDENT@[34; 38) "Copy" | ||
42 | WHITESPACE@[38; 39) | 45 | WHITESPACE@[38; 39) |
43 | ITEM_LIST@[39; 41) | 46 | ITEM_LIST@[39; 41) |
44 | L_CURLY@[39; 40) | 47 | L_CURLY@[39; 40) |
diff --git a/crates/libsyntax2/tests/data/parser/inline/0059_function_where_clause.txt b/crates/libsyntax2/tests/data/parser/inline/0059_function_where_clause.txt index dc90bfc28..281e79deb 100644 --- a/crates/libsyntax2/tests/data/parser/inline/0059_function_where_clause.txt +++ b/crates/libsyntax2/tests/data/parser/inline/0059_function_where_clause.txt | |||
@@ -25,10 +25,11 @@ ROOT@[0; 29) | |||
25 | IDENT@[18; 19) "T" | 25 | IDENT@[18; 19) "T" |
26 | COLON@[19; 20) | 26 | COLON@[19; 20) |
27 | WHITESPACE@[20; 21) | 27 | WHITESPACE@[20; 21) |
28 | PATH@[21; 25) | 28 | PATH_TYPE@[21; 25) |
29 | PATH_SEGMENT@[21; 25) | 29 | PATH@[21; 25) |
30 | NAME_REF@[21; 25) | 30 | PATH_SEGMENT@[21; 25) |
31 | IDENT@[21; 25) "Copy" | 31 | NAME_REF@[21; 25) |
32 | IDENT@[21; 25) "Copy" | ||
32 | WHITESPACE@[25; 26) | 33 | WHITESPACE@[25; 26) |
33 | BLOCK@[26; 28) | 34 | BLOCK@[26; 28) |
34 | L_CURLY@[26; 27) | 35 | L_CURLY@[26; 27) |
diff --git a/crates/libsyntax2/tests/data/parser/inline/0060_function_type_params.txt b/crates/libsyntax2/tests/data/parser/inline/0060_function_type_params.txt index 640a84355..b6fea5ab2 100644 --- a/crates/libsyntax2/tests/data/parser/inline/0060_function_type_params.txt +++ b/crates/libsyntax2/tests/data/parser/inline/0060_function_type_params.txt | |||
@@ -11,17 +11,19 @@ ROOT@[0; 28) | |||
11 | IDENT@[7; 8) "T" | 11 | IDENT@[7; 8) "T" |
12 | COLON@[8; 9) | 12 | COLON@[8; 9) |
13 | WHITESPACE@[9; 10) | 13 | WHITESPACE@[9; 10) |
14 | PATH@[10; 15) | 14 | PATH_TYPE@[10; 22) |
15 | PATH_SEGMENT@[10; 15) | 15 | PATH@[10; 15) |
16 | NAME_REF@[10; 15) | 16 | PATH_SEGMENT@[10; 15) |
17 | IDENT@[10; 15) "Clone" | 17 | NAME_REF@[10; 15) |
18 | WHITESPACE@[15; 16) | 18 | IDENT@[10; 15) "Clone" |
19 | PLUS@[16; 17) | 19 | WHITESPACE@[15; 16) |
20 | WHITESPACE@[17; 18) | 20 | PLUS@[16; 17) |
21 | PATH@[18; 22) | 21 | WHITESPACE@[17; 18) |
22 | PATH_SEGMENT@[18; 22) | 22 | PATH_TYPE@[18; 22) |
23 | NAME_REF@[18; 22) | 23 | PATH@[18; 22) |
24 | IDENT@[18; 22) "Copy" | 24 | PATH_SEGMENT@[18; 22) |
25 | NAME_REF@[18; 22) | ||
26 | IDENT@[18; 22) "Copy" | ||
25 | R_ANGLE@[22; 23) | 27 | R_ANGLE@[22; 23) |
26 | PARAM_LIST@[23; 25) | 28 | PARAM_LIST@[23; 25) |
27 | L_PAREN@[23; 24) | 29 | L_PAREN@[23; 24) |
diff --git a/crates/libsyntax2/tests/data/parser/inline/0063_impl_trait_type.txt b/crates/libsyntax2/tests/data/parser/inline/0063_impl_trait_type.txt index 4d54204f8..68fce58ee 100644 --- a/crates/libsyntax2/tests/data/parser/inline/0063_impl_trait_type.txt +++ b/crates/libsyntax2/tests/data/parser/inline/0063_impl_trait_type.txt | |||
@@ -10,30 +10,31 @@ ROOT@[0; 43) | |||
10 | IMPL_TRAIT_TYPE@[9; 41) | 10 | IMPL_TRAIT_TYPE@[9; 41) |
11 | IMPL_KW@[9; 13) | 11 | IMPL_KW@[9; 13) |
12 | WHITESPACE@[13; 14) | 12 | WHITESPACE@[13; 14) |
13 | PATH@[14; 36) | 13 | PATH_TYPE@[14; 41) |
14 | PATH_SEGMENT@[14; 36) | 14 | PATH@[14; 36) |
15 | NAME_REF@[14; 22) | 15 | PATH_SEGMENT@[14; 36) |
16 | IDENT@[14; 22) "Iterator" | 16 | NAME_REF@[14; 22) |
17 | TYPE_ARG_LIST@[22; 36) | 17 | IDENT@[14; 22) "Iterator" |
18 | L_ANGLE@[22; 23) | 18 | TYPE_ARG_LIST@[22; 36) |
19 | ASSOC_TYPE_ARG@[23; 35) | 19 | L_ANGLE@[22; 23) |
20 | NAME_REF@[23; 27) | 20 | ASSOC_TYPE_ARG@[23; 35) |
21 | IDENT@[23; 27) "Item" | 21 | NAME_REF@[23; 27) |
22 | EQ@[27; 28) | 22 | IDENT@[23; 27) "Item" |
23 | PATH_TYPE@[28; 35) | 23 | EQ@[27; 28) |
24 | PATH@[28; 35) | 24 | PATH_TYPE@[28; 35) |
25 | PATH_SEGMENT@[28; 35) | 25 | PATH@[28; 35) |
26 | NAME_REF@[28; 31) | 26 | PATH_SEGMENT@[28; 35) |
27 | IDENT@[28; 31) "Foo" | 27 | NAME_REF@[28; 31) |
28 | TYPE_ARG_LIST@[31; 35) | 28 | IDENT@[28; 31) "Foo" |
29 | L_ANGLE@[31; 32) | 29 | TYPE_ARG_LIST@[31; 35) |
30 | LIFETIME_ARG@[32; 34) | 30 | L_ANGLE@[31; 32) |
31 | LIFETIME@[32; 34) "'a" | 31 | LIFETIME_ARG@[32; 34) |
32 | R_ANGLE@[34; 35) | 32 | LIFETIME@[32; 34) "'a" |
33 | R_ANGLE@[35; 36) | 33 | R_ANGLE@[34; 35) |
34 | WHITESPACE@[36; 37) | 34 | R_ANGLE@[35; 36) |
35 | PLUS@[37; 38) | 35 | WHITESPACE@[36; 37) |
36 | WHITESPACE@[38; 39) | 36 | PLUS@[37; 38) |
37 | LIFETIME@[39; 41) "'a" | 37 | WHITESPACE@[38; 39) |
38 | LIFETIME@[39; 41) "'a" | ||
38 | SEMI@[41; 42) | 39 | SEMI@[41; 42) |
39 | WHITESPACE@[42; 43) | 40 | WHITESPACE@[42; 43) |
diff --git a/crates/libsyntax2/tests/data/parser/inline/0097_param_list_opt_patterns.txt b/crates/libsyntax2/tests/data/parser/inline/0097_param_list_opt_patterns.txt index 289a899a9..39bab8dd2 100644 --- a/crates/libsyntax2/tests/data/parser/inline/0097_param_list_opt_patterns.txt +++ b/crates/libsyntax2/tests/data/parser/inline/0097_param_list_opt_patterns.txt | |||
@@ -11,28 +11,29 @@ ROOT@[0; 35) | |||
11 | IDENT@[7; 8) "F" | 11 | IDENT@[7; 8) "F" |
12 | COLON@[8; 9) | 12 | COLON@[8; 9) |
13 | WHITESPACE@[9; 10) | 13 | WHITESPACE@[9; 10) |
14 | PATH@[10; 29) | 14 | PATH_TYPE@[10; 29) |
15 | PATH_SEGMENT@[10; 29) | 15 | PATH@[10; 29) |
16 | NAME_REF@[10; 15) | 16 | PATH_SEGMENT@[10; 29) |
17 | IDENT@[10; 15) "FnMut" | 17 | NAME_REF@[10; 15) |
18 | PARAM_LIST@[15; 29) | 18 | IDENT@[10; 15) "FnMut" |
19 | L_PAREN@[15; 16) | 19 | PARAM_LIST@[15; 29) |
20 | PARAM@[16; 28) | 20 | L_PAREN@[15; 16) |
21 | REFERENCE_TYPE@[16; 28) | 21 | PARAM@[16; 28) |
22 | AMP@[16; 17) | 22 | REFERENCE_TYPE@[16; 28) |
23 | MUT_KW@[17; 20) | 23 | AMP@[16; 17) |
24 | WHITESPACE@[20; 21) | 24 | MUT_KW@[17; 20) |
25 | PATH_TYPE@[21; 28) | 25 | WHITESPACE@[20; 21) |
26 | PATH@[21; 28) | 26 | PATH_TYPE@[21; 28) |
27 | PATH_SEGMENT@[21; 28) | 27 | PATH@[21; 28) |
28 | NAME_REF@[21; 24) | 28 | PATH_SEGMENT@[21; 28) |
29 | IDENT@[21; 24) "Foo" | 29 | NAME_REF@[21; 24) |
30 | TYPE_ARG_LIST@[24; 28) | 30 | IDENT@[21; 24) "Foo" |
31 | L_ANGLE@[24; 25) | 31 | TYPE_ARG_LIST@[24; 28) |
32 | LIFETIME_ARG@[25; 27) | 32 | L_ANGLE@[24; 25) |
33 | LIFETIME@[25; 27) "'a" | 33 | LIFETIME_ARG@[25; 27) |
34 | R_ANGLE@[27; 28) | 34 | LIFETIME@[25; 27) "'a" |
35 | R_PAREN@[28; 29) | 35 | R_ANGLE@[27; 28) |
36 | R_PAREN@[28; 29) | ||
36 | R_ANGLE@[29; 30) | 37 | R_ANGLE@[29; 30) |
37 | PARAM_LIST@[30; 32) | 38 | PARAM_LIST@[30; 32) |
38 | L_PAREN@[30; 31) | 39 | L_PAREN@[30; 31) |
diff --git a/crates/libsyntax2/tests/data/parser/inline/0098_where_clause.txt b/crates/libsyntax2/tests/data/parser/inline/0098_where_clause.txt index 7642c0704..9fe803554 100644 --- a/crates/libsyntax2/tests/data/parser/inline/0098_where_clause.txt +++ b/crates/libsyntax2/tests/data/parser/inline/0098_where_clause.txt | |||
@@ -30,21 +30,23 @@ ROOT@[0; 87) | |||
30 | IDENT@[34; 35) "T" | 30 | IDENT@[34; 35) "T" |
31 | COLON@[35; 36) | 31 | COLON@[35; 36) |
32 | WHITESPACE@[36; 37) | 32 | WHITESPACE@[36; 37) |
33 | PATH@[37; 42) | 33 | PATH_TYPE@[37; 59) |
34 | PATH_SEGMENT@[37; 42) | 34 | PATH@[37; 42) |
35 | NAME_REF@[37; 42) | 35 | PATH_SEGMENT@[37; 42) |
36 | IDENT@[37; 42) "Clone" | 36 | NAME_REF@[37; 42) |
37 | WHITESPACE@[42; 43) | 37 | IDENT@[37; 42) "Clone" |
38 | PLUS@[43; 44) | 38 | WHITESPACE@[42; 43) |
39 | WHITESPACE@[44; 45) | 39 | PLUS@[43; 44) |
40 | PATH@[45; 49) | 40 | WHITESPACE@[44; 45) |
41 | PATH_SEGMENT@[45; 49) | 41 | PATH_TYPE@[45; 59) |
42 | NAME_REF@[45; 49) | 42 | PATH@[45; 49) |
43 | IDENT@[45; 49) "Copy" | 43 | PATH_SEGMENT@[45; 49) |
44 | WHITESPACE@[49; 50) | 44 | NAME_REF@[45; 49) |
45 | PLUS@[50; 51) | 45 | IDENT@[45; 49) "Copy" |
46 | WHITESPACE@[51; 52) | 46 | WHITESPACE@[49; 50) |
47 | LIFETIME@[52; 59) "'static" | 47 | PLUS@[50; 51) |
48 | WHITESPACE@[51; 52) | ||
49 | LIFETIME@[52; 59) "'static" | ||
48 | COMMA@[59; 60) | 50 | COMMA@[59; 60) |
49 | WHITESPACE@[60; 64) | 51 | WHITESPACE@[60; 64) |
50 | WHERE_PRED@[64; 82) | 52 | WHERE_PRED@[64; 82) |
diff --git a/crates/libsyntax2/tests/data/parser/inline/0100_dyn_trait_type.txt b/crates/libsyntax2/tests/data/parser/inline/0100_dyn_trait_type.txt index ca53c0b52..c81ae5545 100644 --- a/crates/libsyntax2/tests/data/parser/inline/0100_dyn_trait_type.txt +++ b/crates/libsyntax2/tests/data/parser/inline/0100_dyn_trait_type.txt | |||
@@ -10,30 +10,31 @@ ROOT@[0; 42) | |||
10 | DYN_TRAIT_TYPE@[9; 40) | 10 | DYN_TRAIT_TYPE@[9; 40) |
11 | DYN_KW@[9; 12) | 11 | DYN_KW@[9; 12) |
12 | WHITESPACE@[12; 13) | 12 | WHITESPACE@[12; 13) |
13 | PATH@[13; 35) | 13 | PATH_TYPE@[13; 40) |
14 | PATH_SEGMENT@[13; 35) | 14 | PATH@[13; 35) |
15 | NAME_REF@[13; 21) | 15 | PATH_SEGMENT@[13; 35) |
16 | IDENT@[13; 21) "Iterator" | 16 | NAME_REF@[13; 21) |
17 | TYPE_ARG_LIST@[21; 35) | 17 | IDENT@[13; 21) "Iterator" |
18 | L_ANGLE@[21; 22) | 18 | TYPE_ARG_LIST@[21; 35) |
19 | ASSOC_TYPE_ARG@[22; 34) | 19 | L_ANGLE@[21; 22) |
20 | NAME_REF@[22; 26) | 20 | ASSOC_TYPE_ARG@[22; 34) |
21 | IDENT@[22; 26) "Item" | 21 | NAME_REF@[22; 26) |
22 | EQ@[26; 27) | 22 | IDENT@[22; 26) "Item" |
23 | PATH_TYPE@[27; 34) | 23 | EQ@[26; 27) |
24 | PATH@[27; 34) | 24 | PATH_TYPE@[27; 34) |
25 | PATH_SEGMENT@[27; 34) | 25 | PATH@[27; 34) |
26 | NAME_REF@[27; 30) | 26 | PATH_SEGMENT@[27; 34) |
27 | IDENT@[27; 30) "Foo" | 27 | NAME_REF@[27; 30) |
28 | TYPE_ARG_LIST@[30; 34) | 28 | IDENT@[27; 30) "Foo" |
29 | L_ANGLE@[30; 31) | 29 | TYPE_ARG_LIST@[30; 34) |
30 | LIFETIME_ARG@[31; 33) | 30 | L_ANGLE@[30; 31) |
31 | LIFETIME@[31; 33) "'a" | 31 | LIFETIME_ARG@[31; 33) |
32 | R_ANGLE@[33; 34) | 32 | LIFETIME@[31; 33) "'a" |
33 | R_ANGLE@[34; 35) | 33 | R_ANGLE@[33; 34) |
34 | WHITESPACE@[35; 36) | 34 | R_ANGLE@[34; 35) |
35 | PLUS@[36; 37) | 35 | WHITESPACE@[35; 36) |
36 | WHITESPACE@[37; 38) | 36 | PLUS@[36; 37) |
37 | LIFETIME@[38; 40) "'a" | 37 | WHITESPACE@[37; 38) |
38 | LIFETIME@[38; 40) "'a" | ||
38 | SEMI@[40; 41) | 39 | SEMI@[40; 41) |
39 | WHITESPACE@[41; 42) | 40 | WHITESPACE@[41; 42) |
diff --git a/crates/libsyntax2/tests/data/parser/ok/0001_struct_item.txt b/crates/libsyntax2/tests/data/parser/ok/0001_struct_item.txt index 90df3416a..aa2f1b712 100644 --- a/crates/libsyntax2/tests/data/parser/ok/0001_struct_item.txt +++ b/crates/libsyntax2/tests/data/parser/ok/0001_struct_item.txt | |||
@@ -11,10 +11,11 @@ ROOT@[0; 32) | |||
11 | IDENT@[9; 10) "T" | 11 | IDENT@[9; 10) "T" |
12 | COLON@[10; 11) | 12 | COLON@[10; 11) |
13 | WHITESPACE@[11; 12) | 13 | WHITESPACE@[11; 12) |
14 | PATH@[12; 16) | 14 | PATH_TYPE@[12; 16) |
15 | PATH_SEGMENT@[12; 16) | 15 | PATH@[12; 16) |
16 | NAME_REF@[12; 16) | 16 | PATH_SEGMENT@[12; 16) |
17 | IDENT@[12; 16) "Copy" | 17 | NAME_REF@[12; 16) |
18 | IDENT@[12; 16) "Copy" | ||
18 | R_ANGLE@[16; 17) | 19 | R_ANGLE@[16; 17) |
19 | WHITESPACE@[17; 18) | 20 | WHITESPACE@[17; 18) |
20 | NAMED_FIELD_DEF_LIST@[18; 31) | 21 | NAMED_FIELD_DEF_LIST@[18; 31) |
diff --git a/crates/libsyntax2/tests/data/parser/ok/0020_type_param_bounds.txt b/crates/libsyntax2/tests/data/parser/ok/0020_type_param_bounds.txt index eb01dc8f1..ac1a58e9a 100644 --- a/crates/libsyntax2/tests/data/parser/ok/0020_type_param_bounds.txt +++ b/crates/libsyntax2/tests/data/parser/ok/0020_type_param_bounds.txt | |||
@@ -102,10 +102,11 @@ ROOT@[0; 200) | |||
102 | WHITESPACE@[106; 107) | 102 | WHITESPACE@[106; 107) |
103 | PLUS@[107; 108) | 103 | PLUS@[107; 108) |
104 | WHITESPACE@[108; 109) | 104 | WHITESPACE@[108; 109) |
105 | PATH@[109; 114) | 105 | PATH_TYPE@[109; 114) |
106 | PATH_SEGMENT@[109; 114) | 106 | PATH@[109; 114) |
107 | NAME_REF@[109; 114) | 107 | PATH_SEGMENT@[109; 114) |
108 | IDENT@[109; 114) "Clone" | 108 | NAME_REF@[109; 114) |
109 | IDENT@[109; 114) "Clone" | ||
109 | R_ANGLE@[114; 115) | 110 | R_ANGLE@[114; 115) |
110 | SEMI@[115; 116) | 111 | SEMI@[115; 116) |
111 | WHITESPACE@[116; 117) | 112 | WHITESPACE@[116; 117) |
@@ -121,17 +122,19 @@ ROOT@[0; 200) | |||
121 | IDENT@[126; 127) "T" | 122 | IDENT@[126; 127) "T" |
122 | COLON@[127; 128) | 123 | COLON@[127; 128) |
123 | WHITESPACE@[128; 129) | 124 | WHITESPACE@[128; 129) |
124 | PATH@[129; 134) | 125 | PATH_TYPE@[129; 141) |
125 | PATH_SEGMENT@[129; 134) | 126 | PATH@[129; 134) |
126 | NAME_REF@[129; 134) | 127 | PATH_SEGMENT@[129; 134) |
127 | IDENT@[129; 134) "Clone" | 128 | NAME_REF@[129; 134) |
128 | WHITESPACE@[134; 135) | 129 | IDENT@[129; 134) "Clone" |
129 | PLUS@[135; 136) | 130 | WHITESPACE@[134; 135) |
130 | WHITESPACE@[136; 137) | 131 | PLUS@[135; 136) |
131 | PATH@[137; 141) | 132 | WHITESPACE@[136; 137) |
132 | PATH_SEGMENT@[137; 141) | 133 | PATH_TYPE@[137; 141) |
133 | NAME_REF@[137; 141) | 134 | PATH@[137; 141) |
134 | IDENT@[137; 141) "Copy" | 135 | PATH_SEGMENT@[137; 141) |
136 | NAME_REF@[137; 141) | ||
137 | IDENT@[137; 141) "Copy" | ||
135 | R_ANGLE@[141; 142) | 138 | R_ANGLE@[141; 142) |
136 | SEMI@[142; 143) | 139 | SEMI@[142; 143) |
137 | WHITESPACE@[143; 144) | 140 | WHITESPACE@[143; 144) |
@@ -147,26 +150,28 @@ ROOT@[0; 200) | |||
147 | IDENT@[153; 154) "T" | 150 | IDENT@[153; 154) "T" |
148 | COLON@[154; 155) | 151 | COLON@[154; 155) |
149 | WHITESPACE@[155; 156) | 152 | WHITESPACE@[155; 156) |
150 | PATH@[156; 161) | 153 | PATH_TYPE@[156; 178) |
151 | PATH_SEGMENT@[156; 161) | 154 | PATH@[156; 161) |
152 | COLONCOLON@[156; 158) | 155 | PATH_SEGMENT@[156; 161) |
153 | NAME_REF@[158; 161) | 156 | COLONCOLON@[156; 158) |
154 | IDENT@[158; 161) "Foo" | 157 | NAME_REF@[158; 161) |
155 | WHITESPACE@[161; 162) | 158 | IDENT@[158; 161) "Foo" |
156 | PLUS@[162; 163) | 159 | WHITESPACE@[161; 162) |
157 | WHITESPACE@[163; 164) | 160 | PLUS@[162; 163) |
158 | PATH@[164; 173) | 161 | WHITESPACE@[163; 164) |
159 | PATH@[164; 168) | 162 | PATH_TYPE@[164; 178) |
160 | PATH_SEGMENT@[164; 168) | 163 | PATH@[164; 173) |
161 | SELF_KW@[164; 168) | 164 | PATH@[164; 168) |
162 | COLONCOLON@[168; 170) | 165 | PATH_SEGMENT@[164; 168) |
163 | PATH_SEGMENT@[170; 173) | 166 | SELF_KW@[164; 168) |
164 | NAME_REF@[170; 173) | 167 | COLONCOLON@[168; 170) |
165 | IDENT@[170; 173) "Bar" | 168 | PATH_SEGMENT@[170; 173) |
166 | WHITESPACE@[173; 174) | 169 | NAME_REF@[170; 173) |
167 | PLUS@[174; 175) | 170 | IDENT@[170; 173) "Bar" |
168 | WHITESPACE@[175; 176) | 171 | WHITESPACE@[173; 174) |
169 | LIFETIME@[176; 178) "'a" | 172 | PLUS@[174; 175) |
173 | WHITESPACE@[175; 176) | ||
174 | LIFETIME@[176; 178) "'a" | ||
170 | R_ANGLE@[178; 179) | 175 | R_ANGLE@[178; 179) |
171 | SEMI@[179; 180) | 176 | SEMI@[179; 180) |
172 | WHITESPACE@[180; 181) | 177 | WHITESPACE@[180; 181) |
diff --git a/crates/libsyntax2/tests/data/parser/ok/0032_where_for.rs b/crates/libsyntax2/tests/data/parser/ok/0032_where_for.rs new file mode 100644 index 000000000..588170fbe --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0032_where_for.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn test_serialization<SER>() | ||
2 | where | ||
3 | SER: Serialize + for<'de> Deserialize<'de> + PartialEq + std::fmt::Debug, | ||
4 | {} | ||
diff --git a/crates/libsyntax2/tests/data/parser/ok/0032_where_for.txt b/crates/libsyntax2/tests/data/parser/ok/0032_where_for.txt new file mode 100644 index 000000000..e3b9386a8 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/ok/0032_where_for.txt | |||
@@ -0,0 +1,85 @@ | |||
1 | ROOT@[0; 116) | ||
2 | FN_DEF@[0; 115) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 21) | ||
6 | IDENT@[3; 21) "test_serialization" | ||
7 | TYPE_PARAM_LIST@[21; 26) | ||
8 | L_ANGLE@[21; 22) | ||
9 | TYPE_PARAM@[22; 25) | ||
10 | NAME@[22; 25) | ||
11 | IDENT@[22; 25) "SER" | ||
12 | R_ANGLE@[25; 26) | ||
13 | PARAM_LIST@[26; 28) | ||
14 | L_PAREN@[26; 27) | ||
15 | R_PAREN@[27; 28) | ||
16 | WHITESPACE@[28; 29) | ||
17 | WHERE_CLAUSE@[29; 112) | ||
18 | WHERE_KW@[29; 34) | ||
19 | WHITESPACE@[34; 39) | ||
20 | WHERE_PRED@[39; 111) | ||
21 | PATH_TYPE@[39; 42) | ||
22 | PATH@[39; 42) | ||
23 | PATH_SEGMENT@[39; 42) | ||
24 | NAME_REF@[39; 42) | ||
25 | IDENT@[39; 42) "SER" | ||
26 | COLON@[42; 43) | ||
27 | WHITESPACE@[43; 44) | ||
28 | PATH_TYPE@[44; 111) | ||
29 | PATH@[44; 53) | ||
30 | PATH_SEGMENT@[44; 53) | ||
31 | NAME_REF@[44; 53) | ||
32 | IDENT@[44; 53) "Serialize" | ||
33 | WHITESPACE@[53; 54) | ||
34 | PLUS@[54; 55) | ||
35 | WHITESPACE@[55; 56) | ||
36 | FOR_TYPE@[56; 81) | ||
37 | FOR_KW@[56; 59) | ||
38 | TYPE_PARAM_LIST@[59; 64) | ||
39 | L_ANGLE@[59; 60) | ||
40 | LIFETIME_PARAM@[60; 63) | ||
41 | LIFETIME@[60; 63) "'de" | ||
42 | R_ANGLE@[63; 64) | ||
43 | WHITESPACE@[64; 65) | ||
44 | PATH_TYPE@[65; 81) | ||
45 | PATH@[65; 81) | ||
46 | PATH_SEGMENT@[65; 81) | ||
47 | NAME_REF@[65; 76) | ||
48 | IDENT@[65; 76) "Deserialize" | ||
49 | TYPE_ARG_LIST@[76; 81) | ||
50 | L_ANGLE@[76; 77) | ||
51 | LIFETIME_ARG@[77; 80) | ||
52 | LIFETIME@[77; 80) "'de" | ||
53 | R_ANGLE@[80; 81) | ||
54 | WHITESPACE@[81; 82) | ||
55 | PLUS@[82; 83) | ||
56 | WHITESPACE@[83; 84) | ||
57 | PATH_TYPE@[84; 111) | ||
58 | PATH@[84; 93) | ||
59 | PATH_SEGMENT@[84; 93) | ||
60 | NAME_REF@[84; 93) | ||
61 | IDENT@[84; 93) "PartialEq" | ||
62 | WHITESPACE@[93; 94) | ||
63 | PLUS@[94; 95) | ||
64 | WHITESPACE@[95; 96) | ||
65 | PATH_TYPE@[96; 111) | ||
66 | PATH@[96; 111) | ||
67 | PATH@[96; 104) | ||
68 | PATH@[96; 99) | ||
69 | PATH_SEGMENT@[96; 99) | ||
70 | NAME_REF@[96; 99) | ||
71 | IDENT@[96; 99) "std" | ||
72 | COLONCOLON@[99; 101) | ||
73 | PATH_SEGMENT@[101; 104) | ||
74 | NAME_REF@[101; 104) | ||
75 | IDENT@[101; 104) "fmt" | ||
76 | COLONCOLON@[104; 106) | ||
77 | PATH_SEGMENT@[106; 111) | ||
78 | NAME_REF@[106; 111) | ||
79 | IDENT@[106; 111) "Debug" | ||
80 | COMMA@[111; 112) | ||
81 | WHITESPACE@[112; 113) | ||
82 | BLOCK@[113; 115) | ||
83 | L_CURLY@[113; 114) | ||
84 | R_CURLY@[114; 115) | ||
85 | WHITESPACE@[115; 116) | ||