diff options
Diffstat (limited to 'tests/data')
-rw-r--r-- | tests/data/parser/err/0004_use_path_bad_segment.txt | 17 | ||||
-rw-r--r-- | tests/data/parser/ok/0009_use_item.txt | 20 | ||||
-rw-r--r-- | tests/data/parser/ok/0010_use_path_segments.txt | 52 | ||||
-rw-r--r-- | tests/data/parser/ok/0013_use_path_self_super.txt | 77 | ||||
-rw-r--r-- | tests/data/parser/ok/0014_use_tree.rs | 7 | ||||
-rw-r--r-- | tests/data/parser/ok/0014_use_tree.txt | 85 | ||||
-rw-r--r-- | tests/data/parser/ok/0015_use_tree.rs | 2 | ||||
-rw-r--r-- | tests/data/parser/ok/0015_use_tree.txt | 57 |
8 files changed, 238 insertions, 79 deletions
diff --git a/tests/data/parser/err/0004_use_path_bad_segment.txt b/tests/data/parser/err/0004_use_path_bad_segment.txt index 241ee8562..cd7e86d68 100644 --- a/tests/data/parser/err/0004_use_path_bad_segment.txt +++ b/tests/data/parser/err/0004_use_path_bad_segment.txt | |||
@@ -1,14 +1,15 @@ | |||
1 | FILE@[0; 12) | 1 | FILE@[0; 12) |
2 | USE_ITEM@[0; 9) | 2 | USE_ITEM@[0; 9) |
3 | USE_KW@[0; 3) | 3 | USE_KW@[0; 3) |
4 | PATH@[3; 9) | 4 | USE_TREE@[3; 9) |
5 | PATH@[3; 7) | 5 | PATH@[3; 9) |
6 | PATH_SEGMENT@[3; 7) | 6 | PATH@[3; 7) |
7 | WHITESPACE@[3; 4) | 7 | PATH_SEGMENT@[3; 7) |
8 | IDENT@[4; 7) | 8 | WHITESPACE@[3; 4) |
9 | COLONCOLON@[7; 9) | 9 | IDENT@[4; 7) |
10 | PATH_SEGMENT@[9; 9) | 10 | COLONCOLON@[7; 9) |
11 | err: `expected identifier` | 11 | PATH_SEGMENT@[9; 9) |
12 | err: `expected identifier` | ||
12 | err: `expected SEMI` | 13 | err: `expected SEMI` |
13 | ERROR@[9; 12) | 14 | ERROR@[9; 12) |
14 | err: `expected item` | 15 | err: `expected item` |
diff --git a/tests/data/parser/ok/0009_use_item.txt b/tests/data/parser/ok/0009_use_item.txt index f15c30940..63274125d 100644 --- a/tests/data/parser/ok/0009_use_item.txt +++ b/tests/data/parser/ok/0009_use_item.txt | |||
@@ -1,17 +1,19 @@ | |||
1 | FILE@[0; 19) | 1 | FILE@[0; 19) |
2 | USE_ITEM@[0; 9) | 2 | USE_ITEM@[0; 9) |
3 | USE_KW@[0; 3) | 3 | USE_KW@[0; 3) |
4 | PATH@[3; 7) | 4 | USE_TREE@[3; 7) |
5 | PATH_SEGMENT@[3; 7) | 5 | PATH@[3; 7) |
6 | WHITESPACE@[3; 4) | 6 | PATH_SEGMENT@[3; 7) |
7 | IDENT@[4; 7) | 7 | WHITESPACE@[3; 4) |
8 | IDENT@[4; 7) | ||
8 | SEMI@[7; 8) | 9 | SEMI@[7; 8) |
9 | WHITESPACE@[8; 9) | 10 | WHITESPACE@[8; 9) |
10 | USE_ITEM@[9; 19) | 11 | USE_ITEM@[9; 19) |
11 | USE_KW@[9; 12) | 12 | USE_KW@[9; 12) |
12 | PATH@[12; 18) | 13 | USE_TREE@[12; 18) |
13 | PATH_SEGMENT@[12; 18) | 14 | PATH@[12; 18) |
14 | WHITESPACE@[12; 13) | 15 | PATH_SEGMENT@[12; 18) |
15 | COLONCOLON@[13; 15) | 16 | WHITESPACE@[12; 13) |
16 | IDENT@[15; 18) | 17 | COLONCOLON@[13; 15) |
18 | IDENT@[15; 18) | ||
17 | SEMI@[18; 19) | 19 | SEMI@[18; 19) |
diff --git a/tests/data/parser/ok/0010_use_path_segments.txt b/tests/data/parser/ok/0010_use_path_segments.txt index a407be826..d0f2033ce 100644 --- a/tests/data/parser/ok/0010_use_path_segments.txt +++ b/tests/data/parser/ok/0010_use_path_segments.txt | |||
@@ -1,34 +1,36 @@ | |||
1 | FILE@[0; 40) | 1 | FILE@[0; 40) |
2 | USE_ITEM@[0; 21) | 2 | USE_ITEM@[0; 21) |
3 | USE_KW@[0; 3) | 3 | USE_KW@[0; 3) |
4 | PATH@[3; 19) | 4 | USE_TREE@[3; 19) |
5 | PATH@[3; 14) | 5 | PATH@[3; 19) |
6 | PATH@[3; 9) | 6 | PATH@[3; 14) |
7 | PATH_SEGMENT@[3; 9) | 7 | PATH@[3; 9) |
8 | WHITESPACE@[3; 4) | 8 | PATH_SEGMENT@[3; 9) |
9 | COLONCOLON@[4; 6) | 9 | WHITESPACE@[3; 4) |
10 | IDENT@[6; 9) | 10 | COLONCOLON@[4; 6) |
11 | COLONCOLON@[9; 11) | 11 | IDENT@[6; 9) |
12 | PATH_SEGMENT@[11; 14) | 12 | COLONCOLON@[9; 11) |
13 | IDENT@[11; 14) | 13 | PATH_SEGMENT@[11; 14) |
14 | COLONCOLON@[14; 16) | 14 | IDENT@[11; 14) |
15 | PATH_SEGMENT@[16; 19) | 15 | COLONCOLON@[14; 16) |
16 | IDENT@[16; 19) | 16 | PATH_SEGMENT@[16; 19) |
17 | IDENT@[16; 19) | ||
17 | SEMI@[19; 20) | 18 | SEMI@[19; 20) |
18 | WHITESPACE@[20; 21) | 19 | WHITESPACE@[20; 21) |
19 | USE_ITEM@[21; 40) | 20 | USE_ITEM@[21; 40) |
20 | USE_KW@[21; 24) | 21 | USE_KW@[21; 24) |
21 | PATH@[24; 38) | 22 | USE_TREE@[24; 38) |
22 | PATH@[24; 33) | 23 | PATH@[24; 38) |
23 | PATH@[24; 28) | 24 | PATH@[24; 33) |
24 | PATH_SEGMENT@[24; 28) | 25 | PATH@[24; 28) |
25 | WHITESPACE@[24; 25) | 26 | PATH_SEGMENT@[24; 28) |
26 | IDENT@[25; 28) | 27 | WHITESPACE@[24; 25) |
27 | COLONCOLON@[28; 30) | 28 | IDENT@[25; 28) |
28 | PATH_SEGMENT@[30; 33) | 29 | COLONCOLON@[28; 30) |
29 | IDENT@[30; 33) | 30 | PATH_SEGMENT@[30; 33) |
30 | COLONCOLON@[33; 35) | 31 | IDENT@[30; 33) |
31 | PATH_SEGMENT@[35; 38) | 32 | COLONCOLON@[33; 35) |
32 | IDENT@[35; 38) | 33 | PATH_SEGMENT@[35; 38) |
34 | IDENT@[35; 38) | ||
33 | SEMI@[38; 39) | 35 | SEMI@[38; 39) |
34 | WHITESPACE@[39; 40) | 36 | WHITESPACE@[39; 40) |
diff --git a/tests/data/parser/ok/0013_use_path_self_super.txt b/tests/data/parser/ok/0013_use_path_self_super.txt index 90bbb9b2d..2b0934e97 100644 --- a/tests/data/parser/ok/0013_use_path_self_super.txt +++ b/tests/data/parser/ok/0013_use_path_self_super.txt | |||
@@ -1,50 +1,53 @@ | |||
1 | FILE@[0; 65) | 1 | FILE@[0; 65) |
2 | USE_ITEM@[0; 15) | 2 | USE_ITEM@[0; 15) |
3 | USE_KW@[0; 3) | 3 | USE_KW@[0; 3) |
4 | PATH@[3; 13) | 4 | USE_TREE@[3; 13) |
5 | PATH@[3; 8) | 5 | PATH@[3; 13) |
6 | PATH_SEGMENT@[3; 8) | 6 | PATH@[3; 8) |
7 | WHITESPACE@[3; 4) | 7 | PATH_SEGMENT@[3; 8) |
8 | SELF_KW@[4; 8) | 8 | WHITESPACE@[3; 4) |
9 | COLONCOLON@[8; 10) | 9 | SELF_KW@[4; 8) |
10 | PATH_SEGMENT@[10; 13) | 10 | COLONCOLON@[8; 10) |
11 | IDENT@[10; 13) | 11 | PATH_SEGMENT@[10; 13) |
12 | IDENT@[10; 13) | ||
12 | SEMI@[13; 14) | 13 | SEMI@[13; 14) |
13 | WHITESPACE@[14; 15) | 14 | WHITESPACE@[14; 15) |
14 | USE_ITEM@[15; 38) | 15 | USE_ITEM@[15; 38) |
15 | USE_KW@[15; 18) | 16 | USE_KW@[15; 18) |
16 | PATH@[18; 36) | 17 | USE_TREE@[18; 36) |
17 | PATH@[18; 31) | 18 | PATH@[18; 36) |
18 | PATH@[18; 24) | 19 | PATH@[18; 31) |
19 | PATH_SEGMENT@[18; 24) | 20 | PATH@[18; 24) |
20 | WHITESPACE@[18; 19) | 21 | PATH_SEGMENT@[18; 24) |
21 | SUPER_KW@[19; 24) | 22 | WHITESPACE@[18; 19) |
22 | COLONCOLON@[24; 26) | 23 | SUPER_KW@[19; 24) |
23 | PATH_SEGMENT@[26; 31) | 24 | COLONCOLON@[24; 26) |
24 | SUPER_KW@[26; 31) | 25 | PATH_SEGMENT@[26; 31) |
25 | COLONCOLON@[31; 33) | 26 | SUPER_KW@[26; 31) |
26 | PATH_SEGMENT@[33; 36) | 27 | COLONCOLON@[31; 33) |
27 | IDENT@[33; 36) | 28 | PATH_SEGMENT@[33; 36) |
29 | IDENT@[33; 36) | ||
28 | SEMI@[36; 37) | 30 | SEMI@[36; 37) |
29 | WHITESPACE@[37; 38) | 31 | WHITESPACE@[37; 38) |
30 | USE_ITEM@[38; 65) | 32 | USE_ITEM@[38; 65) |
31 | USE_KW@[38; 41) | 33 | USE_KW@[38; 41) |
32 | PATH@[41; 63) | 34 | USE_TREE@[41; 63) |
33 | PATH@[41; 58) | 35 | PATH@[41; 63) |
34 | PATH@[41; 51) | 36 | PATH@[41; 58) |
35 | PATH@[41; 48) | 37 | PATH@[41; 51) |
36 | PATH_SEGMENT@[41; 48) | 38 | PATH@[41; 48) |
37 | WHITESPACE@[41; 42) | 39 | PATH_SEGMENT@[41; 48) |
38 | COLONCOLON@[42; 44) | 40 | WHITESPACE@[41; 42) |
39 | SELF_KW@[44; 48) | 41 | COLONCOLON@[42; 44) |
40 | COLONCOLON@[48; 50) | 42 | SELF_KW@[44; 48) |
41 | PATH_SEGMENT@[50; 51) | 43 | COLONCOLON@[48; 50) |
42 | IDENT@[50; 51) | 44 | PATH_SEGMENT@[50; 51) |
43 | COLONCOLON@[51; 53) | 45 | IDENT@[50; 51) |
44 | PATH_SEGMENT@[53; 58) | 46 | COLONCOLON@[51; 53) |
45 | SUPER_KW@[53; 58) | 47 | PATH_SEGMENT@[53; 58) |
46 | COLONCOLON@[58; 60) | 48 | SUPER_KW@[53; 58) |
47 | PATH_SEGMENT@[60; 63) | 49 | COLONCOLON@[58; 60) |
48 | IDENT@[60; 63) | 50 | PATH_SEGMENT@[60; 63) |
51 | IDENT@[60; 63) | ||
49 | SEMI@[63; 64) | 52 | SEMI@[63; 64) |
50 | WHITESPACE@[64; 65) | 53 | WHITESPACE@[64; 65) |
diff --git a/tests/data/parser/ok/0014_use_tree.rs b/tests/data/parser/ok/0014_use_tree.rs new file mode 100644 index 000000000..5e4aa3a33 --- /dev/null +++ b/tests/data/parser/ok/0014_use_tree.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | use *; | ||
2 | use ::*; | ||
3 | use ::{}; | ||
4 | use {}; | ||
5 | use foo::*; | ||
6 | use foo::{}; | ||
7 | use ::foo::{a, b, c}; | ||
diff --git a/tests/data/parser/ok/0014_use_tree.txt b/tests/data/parser/ok/0014_use_tree.txt new file mode 100644 index 000000000..ca91e63e1 --- /dev/null +++ b/tests/data/parser/ok/0014_use_tree.txt | |||
@@ -0,0 +1,85 @@ | |||
1 | FILE@[0; 81) | ||
2 | USE_ITEM@[0; 7) | ||
3 | USE_KW@[0; 3) | ||
4 | USE_TREE@[3; 5) | ||
5 | WHITESPACE@[3; 4) | ||
6 | STAR@[4; 5) | ||
7 | SEMI@[5; 6) | ||
8 | WHITESPACE@[6; 7) | ||
9 | USE_ITEM@[7; 16) | ||
10 | USE_KW@[7; 10) | ||
11 | USE_TREE@[10; 14) | ||
12 | WHITESPACE@[10; 11) | ||
13 | COLONCOLON@[11; 13) | ||
14 | STAR@[13; 14) | ||
15 | SEMI@[14; 15) | ||
16 | WHITESPACE@[15; 16) | ||
17 | USE_ITEM@[16; 26) | ||
18 | USE_KW@[16; 19) | ||
19 | USE_TREE@[19; 24) | ||
20 | WHITESPACE@[19; 20) | ||
21 | COLONCOLON@[20; 22) | ||
22 | L_CURLY@[22; 23) | ||
23 | R_CURLY@[23; 24) | ||
24 | SEMI@[24; 25) | ||
25 | WHITESPACE@[25; 26) | ||
26 | USE_ITEM@[26; 34) | ||
27 | USE_KW@[26; 29) | ||
28 | USE_TREE@[29; 32) | ||
29 | WHITESPACE@[29; 30) | ||
30 | L_CURLY@[30; 31) | ||
31 | R_CURLY@[31; 32) | ||
32 | SEMI@[32; 33) | ||
33 | WHITESPACE@[33; 34) | ||
34 | USE_ITEM@[34; 46) | ||
35 | USE_KW@[34; 37) | ||
36 | USE_TREE@[37; 44) | ||
37 | PATH@[37; 41) | ||
38 | PATH_SEGMENT@[37; 41) | ||
39 | WHITESPACE@[37; 38) | ||
40 | IDENT@[38; 41) | ||
41 | COLONCOLON@[41; 43) | ||
42 | STAR@[43; 44) | ||
43 | SEMI@[44; 45) | ||
44 | WHITESPACE@[45; 46) | ||
45 | USE_ITEM@[46; 59) | ||
46 | USE_KW@[46; 49) | ||
47 | USE_TREE@[49; 57) | ||
48 | PATH@[49; 53) | ||
49 | PATH_SEGMENT@[49; 53) | ||
50 | WHITESPACE@[49; 50) | ||
51 | IDENT@[50; 53) | ||
52 | COLONCOLON@[53; 55) | ||
53 | L_CURLY@[55; 56) | ||
54 | R_CURLY@[56; 57) | ||
55 | SEMI@[57; 58) | ||
56 | WHITESPACE@[58; 59) | ||
57 | USE_ITEM@[59; 81) | ||
58 | USE_KW@[59; 62) | ||
59 | USE_TREE@[62; 79) | ||
60 | PATH@[62; 68) | ||
61 | PATH_SEGMENT@[62; 68) | ||
62 | WHITESPACE@[62; 63) | ||
63 | COLONCOLON@[63; 65) | ||
64 | IDENT@[65; 68) | ||
65 | COLONCOLON@[68; 70) | ||
66 | L_CURLY@[70; 71) | ||
67 | USE_TREE@[71; 72) | ||
68 | PATH@[71; 72) | ||
69 | PATH_SEGMENT@[71; 72) | ||
70 | IDENT@[71; 72) | ||
71 | COMMA@[72; 73) | ||
72 | USE_TREE@[73; 75) | ||
73 | PATH@[73; 75) | ||
74 | PATH_SEGMENT@[73; 75) | ||
75 | WHITESPACE@[73; 74) | ||
76 | IDENT@[74; 75) | ||
77 | COMMA@[75; 76) | ||
78 | USE_TREE@[76; 78) | ||
79 | PATH@[76; 78) | ||
80 | PATH_SEGMENT@[76; 78) | ||
81 | WHITESPACE@[76; 77) | ||
82 | IDENT@[77; 78) | ||
83 | R_CURLY@[78; 79) | ||
84 | SEMI@[79; 80) | ||
85 | WHITESPACE@[80; 81) | ||
diff --git a/tests/data/parser/ok/0015_use_tree.rs b/tests/data/parser/ok/0015_use_tree.rs new file mode 100644 index 000000000..46a0783a2 --- /dev/null +++ b/tests/data/parser/ok/0015_use_tree.rs | |||
@@ -0,0 +1,2 @@ | |||
1 | use foo as bar; | ||
2 | use foo::{a as b, *, ::*, ::foo as x}; | ||
diff --git a/tests/data/parser/ok/0015_use_tree.txt b/tests/data/parser/ok/0015_use_tree.txt new file mode 100644 index 000000000..c1975f6cb --- /dev/null +++ b/tests/data/parser/ok/0015_use_tree.txt | |||
@@ -0,0 +1,57 @@ | |||
1 | FILE@[0; 55) | ||
2 | USE_ITEM@[0; 16) | ||
3 | USE_KW@[0; 3) | ||
4 | USE_TREE@[3; 14) | ||
5 | PATH@[3; 8) | ||
6 | PATH_SEGMENT@[3; 8) | ||
7 | WHITESPACE@[3; 4) | ||
8 | IDENT@[4; 7) | ||
9 | WHITESPACE@[7; 8) | ||
10 | ALIAS@[8; 14) | ||
11 | AS_KW@[8; 10) | ||
12 | WHITESPACE@[10; 11) | ||
13 | IDENT@[11; 14) | ||
14 | SEMI@[14; 15) | ||
15 | WHITESPACE@[15; 16) | ||
16 | USE_ITEM@[16; 55) | ||
17 | USE_KW@[16; 19) | ||
18 | USE_TREE@[19; 53) | ||
19 | PATH@[19; 23) | ||
20 | PATH_SEGMENT@[19; 23) | ||
21 | WHITESPACE@[19; 20) | ||
22 | IDENT@[20; 23) | ||
23 | COLONCOLON@[23; 25) | ||
24 | L_CURLY@[25; 26) | ||
25 | USE_TREE@[26; 32) | ||
26 | PATH@[26; 28) | ||
27 | PATH_SEGMENT@[26; 28) | ||
28 | IDENT@[26; 27) | ||
29 | WHITESPACE@[27; 28) | ||
30 | ALIAS@[28; 32) | ||
31 | AS_KW@[28; 30) | ||
32 | WHITESPACE@[30; 31) | ||
33 | IDENT@[31; 32) | ||
34 | COMMA@[32; 33) | ||
35 | USE_TREE@[33; 35) | ||
36 | WHITESPACE@[33; 34) | ||
37 | STAR@[34; 35) | ||
38 | COMMA@[35; 36) | ||
39 | USE_TREE@[36; 40) | ||
40 | WHITESPACE@[36; 37) | ||
41 | COLONCOLON@[37; 39) | ||
42 | STAR@[39; 40) | ||
43 | COMMA@[40; 41) | ||
44 | USE_TREE@[41; 52) | ||
45 | PATH@[41; 48) | ||
46 | PATH_SEGMENT@[41; 48) | ||
47 | WHITESPACE@[41; 42) | ||
48 | COLONCOLON@[42; 44) | ||
49 | IDENT@[44; 47) | ||
50 | WHITESPACE@[47; 48) | ||
51 | ALIAS@[48; 52) | ||
52 | AS_KW@[48; 50) | ||
53 | WHITESPACE@[50; 51) | ||
54 | IDENT@[51; 52) | ||
55 | R_CURLY@[52; 53) | ||
56 | SEMI@[53; 54) | ||
57 | WHITESPACE@[54; 55) | ||