diff options
Diffstat (limited to 'tests/data')
-rw-r--r-- | tests/data/lexer/0011_keywords.rs | 2 | ||||
-rw-r--r-- | tests/data/lexer/0011_keywords.txt | 2 | ||||
-rw-r--r-- | tests/data/parser/err/0000_struct_field_missing_comma.txt | 4 | ||||
-rw-r--r-- | tests/data/parser/err/0003_C++_semicolon.txt | 4 | ||||
-rw-r--r-- | tests/data/parser/ok/0002_struct_item_field.txt | 2 | ||||
-rw-r--r-- | tests/data/parser/ok/0016_struct_flavors.rs | 10 | ||||
-rw-r--r-- | tests/data/parser/ok/0016_struct_flavors.txt | 66 |
7 files changed, 84 insertions, 6 deletions
diff --git a/tests/data/lexer/0011_keywords.rs b/tests/data/lexer/0011_keywords.rs index aa729cdbd..c2c9e5667 100644 --- a/tests/data/lexer/0011_keywords.rs +++ b/tests/data/lexer/0011_keywords.rs | |||
@@ -1 +1 @@ | |||
fn use struct trait enum impl true false as extern crate mod pub self super in | fn use struct trait enum impl true false as extern crate mod pub self super in where | ||
diff --git a/tests/data/lexer/0011_keywords.txt b/tests/data/lexer/0011_keywords.txt index 8a1f525ac..301ee21e2 100644 --- a/tests/data/lexer/0011_keywords.txt +++ b/tests/data/lexer/0011_keywords.txt | |||
@@ -29,4 +29,6 @@ WHITESPACE 1 " " | |||
29 | SUPER_KW 5 "super" | 29 | SUPER_KW 5 "super" |
30 | WHITESPACE 1 " " | 30 | WHITESPACE 1 " " |
31 | IN_KW 2 "in" | 31 | IN_KW 2 "in" |
32 | WHITESPACE 1 " " | ||
33 | WHERE_KW 5 "where" | ||
32 | WHITESPACE 1 "\n" | 34 | WHITESPACE 1 "\n" |
diff --git a/tests/data/parser/err/0000_struct_field_missing_comma.txt b/tests/data/parser/err/0000_struct_field_missing_comma.txt index 55a4ad915..f59205f55 100644 --- a/tests/data/parser/err/0000_struct_field_missing_comma.txt +++ b/tests/data/parser/err/0000_struct_field_missing_comma.txt | |||
@@ -5,7 +5,7 @@ FILE@[0; 34) | |||
5 | IDENT@[7; 8) | 5 | IDENT@[7; 8) |
6 | WHITESPACE@[8; 9) | 6 | WHITESPACE@[8; 9) |
7 | L_CURLY@[9; 10) | 7 | L_CURLY@[9; 10) |
8 | STRUCT_FIELD@[10; 26) | 8 | NAMED_FIELD@[10; 26) |
9 | WHITESPACE@[10; 15) | 9 | WHITESPACE@[10; 15) |
10 | IDENT@[15; 16) | 10 | IDENT@[15; 16) |
11 | COLON@[16; 17) | 11 | COLON@[16; 17) |
@@ -13,7 +13,7 @@ FILE@[0; 34) | |||
13 | IDENT@[18; 21) | 13 | IDENT@[18; 21) |
14 | WHITESPACE@[21; 26) | 14 | WHITESPACE@[21; 26) |
15 | err: `expected COMMA` | 15 | err: `expected COMMA` |
16 | STRUCT_FIELD@[26; 33) | 16 | NAMED_FIELD@[26; 33) |
17 | IDENT@[26; 27) | 17 | IDENT@[26; 27) |
18 | COLON@[27; 28) | 18 | COLON@[27; 28) |
19 | WHITESPACE@[28; 29) | 19 | WHITESPACE@[28; 29) |
diff --git a/tests/data/parser/err/0003_C++_semicolon.txt b/tests/data/parser/err/0003_C++_semicolon.txt index 9308bb330..8dd45d2e5 100644 --- a/tests/data/parser/err/0003_C++_semicolon.txt +++ b/tests/data/parser/err/0003_C++_semicolon.txt | |||
@@ -5,14 +5,14 @@ FILE@[0; 40) | |||
5 | IDENT@[7; 8) | 5 | IDENT@[7; 8) |
6 | WHITESPACE@[8; 9) | 6 | WHITESPACE@[8; 9) |
7 | L_CURLY@[9; 10) | 7 | L_CURLY@[9; 10) |
8 | STRUCT_FIELD@[10; 21) | 8 | NAMED_FIELD@[10; 21) |
9 | WHITESPACE@[10; 15) | 9 | WHITESPACE@[10; 15) |
10 | IDENT@[15; 16) | 10 | IDENT@[15; 16) |
11 | COLON@[16; 17) | 11 | COLON@[16; 17) |
12 | WHITESPACE@[17; 18) | 12 | WHITESPACE@[17; 18) |
13 | IDENT@[18; 21) | 13 | IDENT@[18; 21) |
14 | COMMA@[21; 22) | 14 | COMMA@[21; 22) |
15 | STRUCT_FIELD@[22; 36) | 15 | NAMED_FIELD@[22; 36) |
16 | WHITESPACE@[22; 27) | 16 | WHITESPACE@[22; 27) |
17 | IDENT@[27; 28) | 17 | IDENT@[27; 28) |
18 | COLON@[28; 29) | 18 | COLON@[28; 29) |
diff --git a/tests/data/parser/ok/0002_struct_item_field.txt b/tests/data/parser/ok/0002_struct_item_field.txt index 87ab3f7a9..58042f6a7 100644 --- a/tests/data/parser/ok/0002_struct_item_field.txt +++ b/tests/data/parser/ok/0002_struct_item_field.txt | |||
@@ -5,7 +5,7 @@ FILE@[0; 25) | |||
5 | IDENT@[7; 8) | 5 | IDENT@[7; 8) |
6 | WHITESPACE@[8; 9) | 6 | WHITESPACE@[8; 9) |
7 | L_CURLY@[9; 10) | 7 | L_CURLY@[9; 10) |
8 | STRUCT_FIELD@[10; 24) | 8 | NAMED_FIELD@[10; 24) |
9 | WHITESPACE@[10; 15) | 9 | WHITESPACE@[10; 15) |
10 | IDENT@[15; 18) | 10 | IDENT@[15; 18) |
11 | COLON@[18; 19) | 11 | COLON@[18; 19) |
diff --git a/tests/data/parser/ok/0016_struct_flavors.rs b/tests/data/parser/ok/0016_struct_flavors.rs new file mode 100644 index 000000000..69638350c --- /dev/null +++ b/tests/data/parser/ok/0016_struct_flavors.rs | |||
@@ -0,0 +1,10 @@ | |||
1 | struct A; | ||
2 | struct B {} | ||
3 | struct C(); | ||
4 | |||
5 | struct D { | ||
6 | a: u32, | ||
7 | pub b: u32 | ||
8 | } | ||
9 | |||
10 | struct E(pub x, y,); | ||
diff --git a/tests/data/parser/ok/0016_struct_flavors.txt b/tests/data/parser/ok/0016_struct_flavors.txt new file mode 100644 index 000000000..93b16e1b9 --- /dev/null +++ b/tests/data/parser/ok/0016_struct_flavors.txt | |||
@@ -0,0 +1,66 @@ | |||
1 | FILE@[0; 97) | ||
2 | STRUCT_ITEM@[0; 10) | ||
3 | STRUCT_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | IDENT@[7; 8) | ||
6 | SEMI@[8; 9) | ||
7 | WHITESPACE@[9; 10) | ||
8 | STRUCT_ITEM@[10; 22) | ||
9 | STRUCT_KW@[10; 16) | ||
10 | WHITESPACE@[16; 17) | ||
11 | IDENT@[17; 18) | ||
12 | WHITESPACE@[18; 19) | ||
13 | L_CURLY@[19; 20) | ||
14 | R_CURLY@[20; 21) | ||
15 | WHITESPACE@[21; 22) | ||
16 | STRUCT_ITEM@[22; 35) | ||
17 | STRUCT_KW@[22; 28) | ||
18 | WHITESPACE@[28; 29) | ||
19 | IDENT@[29; 30) | ||
20 | L_PAREN@[30; 31) | ||
21 | R_PAREN@[31; 32) | ||
22 | SEMI@[32; 33) | ||
23 | WHITESPACE@[33; 35) | ||
24 | STRUCT_ITEM@[35; 76) | ||
25 | STRUCT_KW@[35; 41) | ||
26 | WHITESPACE@[41; 42) | ||
27 | IDENT@[42; 43) | ||
28 | WHITESPACE@[43; 44) | ||
29 | L_CURLY@[44; 45) | ||
30 | NAMED_FIELD@[45; 56) | ||
31 | WHITESPACE@[45; 50) | ||
32 | IDENT@[50; 51) | ||
33 | COLON@[51; 52) | ||
34 | WHITESPACE@[52; 53) | ||
35 | IDENT@[53; 56) | ||
36 | COMMA@[56; 57) | ||
37 | NAMED_FIELD@[57; 73) | ||
38 | VISIBILITY@[57; 66) | ||
39 | WHITESPACE@[57; 62) | ||
40 | PUB_KW@[62; 65) | ||
41 | WHITESPACE@[65; 66) | ||
42 | IDENT@[66; 67) | ||
43 | COLON@[67; 68) | ||
44 | WHITESPACE@[68; 69) | ||
45 | IDENT@[69; 72) | ||
46 | WHITESPACE@[72; 73) | ||
47 | R_CURLY@[73; 74) | ||
48 | WHITESPACE@[74; 76) | ||
49 | STRUCT_ITEM@[76; 97) | ||
50 | STRUCT_KW@[76; 82) | ||
51 | WHITESPACE@[82; 83) | ||
52 | IDENT@[83; 84) | ||
53 | L_PAREN@[84; 85) | ||
54 | POS_FIELD@[85; 90) | ||
55 | VISIBILITY@[85; 89) | ||
56 | PUB_KW@[85; 88) | ||
57 | WHITESPACE@[88; 89) | ||
58 | IDENT@[89; 90) | ||
59 | COMMA@[90; 91) | ||
60 | POS_FIELD@[91; 93) | ||
61 | WHITESPACE@[91; 92) | ||
62 | IDENT@[92; 93) | ||
63 | COMMA@[93; 94) | ||
64 | R_PAREN@[94; 95) | ||
65 | SEMI@[95; 96) | ||
66 | WHITESPACE@[96; 97) | ||