diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-09-14 23:46:18 +0100 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-09-14 23:46:18 +0100 |
commit | 6ee4c287f9c95738f0482bf635ccc3801fc2fea2 (patch) | |
tree | 252eb01afe807e0e017d1d2b0937f457dd16a1bd /crates/libsyntax2/tests/data | |
parent | b6f8037a6f8fbcb4f127e1d2b518279650b1f5ea (diff) | |
parent | d825cffe3b101e0796dc4ac1b468abece3388c7b (diff) |
Merge #71
71: Support for unions r=matklad a=darksv
Fixes #70
Co-authored-by: darksv <[email protected]>
Diffstat (limited to 'crates/libsyntax2/tests/data')
4 files changed, 146 insertions, 0 deletions
diff --git a/crates/libsyntax2/tests/data/parser/inline/0109_struct_items.rs b/crates/libsyntax2/tests/data/parser/inline/0109_struct_items.rs new file mode 100644 index 000000000..693e3f3ee --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0109_struct_items.rs | |||
@@ -0,0 +1,8 @@ | |||
1 | struct Foo; | ||
2 | struct Foo {} | ||
3 | struct Foo(); | ||
4 | struct Foo(String, usize); | ||
5 | struct Foo { | ||
6 | a: i32, | ||
7 | b: f32, | ||
8 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0109_struct_items.txt b/crates/libsyntax2/tests/data/parser/inline/0109_struct_items.txt new file mode 100644 index 000000000..f9b34cc5e --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0109_struct_items.txt | |||
@@ -0,0 +1,87 @@ | |||
1 | ROOT@[0; 106) | ||
2 | STRUCT_DEF@[0; 11) | ||
3 | STRUCT_KW@[0; 6) | ||
4 | WHITESPACE@[6; 7) | ||
5 | NAME@[7; 10) | ||
6 | IDENT@[7; 10) "Foo" | ||
7 | SEMI@[10; 11) | ||
8 | WHITESPACE@[11; 12) | ||
9 | STRUCT_DEF@[12; 25) | ||
10 | STRUCT_KW@[12; 18) | ||
11 | WHITESPACE@[18; 19) | ||
12 | NAME@[19; 22) | ||
13 | IDENT@[19; 22) "Foo" | ||
14 | WHITESPACE@[22; 23) | ||
15 | NAMED_FIELD_DEF_LIST@[23; 25) | ||
16 | L_CURLY@[23; 24) | ||
17 | R_CURLY@[24; 25) | ||
18 | WHITESPACE@[25; 26) | ||
19 | STRUCT_DEF@[26; 39) | ||
20 | STRUCT_KW@[26; 32) | ||
21 | WHITESPACE@[32; 33) | ||
22 | NAME@[33; 36) | ||
23 | IDENT@[33; 36) "Foo" | ||
24 | POS_FIELD_LIST@[36; 38) | ||
25 | L_PAREN@[36; 37) | ||
26 | R_PAREN@[37; 38) | ||
27 | SEMI@[38; 39) | ||
28 | WHITESPACE@[39; 40) | ||
29 | STRUCT_DEF@[40; 66) | ||
30 | STRUCT_KW@[40; 46) | ||
31 | WHITESPACE@[46; 47) | ||
32 | NAME@[47; 50) | ||
33 | IDENT@[47; 50) "Foo" | ||
34 | POS_FIELD_LIST@[50; 65) | ||
35 | L_PAREN@[50; 51) | ||
36 | POS_FIELD@[51; 57) | ||
37 | PATH_TYPE@[51; 57) | ||
38 | PATH@[51; 57) | ||
39 | PATH_SEGMENT@[51; 57) | ||
40 | NAME_REF@[51; 57) | ||
41 | IDENT@[51; 57) "String" | ||
42 | COMMA@[57; 58) | ||
43 | WHITESPACE@[58; 59) | ||
44 | POS_FIELD@[59; 64) | ||
45 | PATH_TYPE@[59; 64) | ||
46 | PATH@[59; 64) | ||
47 | PATH_SEGMENT@[59; 64) | ||
48 | NAME_REF@[59; 64) | ||
49 | IDENT@[59; 64) "usize" | ||
50 | R_PAREN@[64; 65) | ||
51 | SEMI@[65; 66) | ||
52 | WHITESPACE@[66; 67) | ||
53 | STRUCT_DEF@[67; 105) | ||
54 | STRUCT_KW@[67; 73) | ||
55 | WHITESPACE@[73; 74) | ||
56 | NAME@[74; 77) | ||
57 | IDENT@[74; 77) "Foo" | ||
58 | WHITESPACE@[77; 78) | ||
59 | NAMED_FIELD_DEF_LIST@[78; 105) | ||
60 | L_CURLY@[78; 79) | ||
61 | WHITESPACE@[79; 84) | ||
62 | NAMED_FIELD_DEF@[84; 90) | ||
63 | NAME@[84; 85) | ||
64 | IDENT@[84; 85) "a" | ||
65 | COLON@[85; 86) | ||
66 | WHITESPACE@[86; 87) | ||
67 | PATH_TYPE@[87; 90) | ||
68 | PATH@[87; 90) | ||
69 | PATH_SEGMENT@[87; 90) | ||
70 | NAME_REF@[87; 90) | ||
71 | IDENT@[87; 90) "i32" | ||
72 | COMMA@[90; 91) | ||
73 | WHITESPACE@[91; 96) | ||
74 | NAMED_FIELD_DEF@[96; 102) | ||
75 | NAME@[96; 97) | ||
76 | IDENT@[96; 97) "b" | ||
77 | COLON@[97; 98) | ||
78 | WHITESPACE@[98; 99) | ||
79 | PATH_TYPE@[99; 102) | ||
80 | PATH@[99; 102) | ||
81 | PATH_SEGMENT@[99; 102) | ||
82 | NAME_REF@[99; 102) | ||
83 | IDENT@[99; 102) "f32" | ||
84 | COMMA@[102; 103) | ||
85 | WHITESPACE@[103; 104) | ||
86 | R_CURLY@[104; 105) | ||
87 | WHITESPACE@[105; 106) | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0110_union_items.rs b/crates/libsyntax2/tests/data/parser/inline/0110_union_items.rs new file mode 100644 index 000000000..b7dd610d8 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0110_union_items.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | union Foo {} | ||
2 | union Foo { | ||
3 | a: i32, | ||
4 | b: f32, | ||
5 | } | ||
diff --git a/crates/libsyntax2/tests/data/parser/inline/0110_union_items.txt b/crates/libsyntax2/tests/data/parser/inline/0110_union_items.txt new file mode 100644 index 000000000..e2e755414 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0110_union_items.txt | |||
@@ -0,0 +1,46 @@ | |||
1 | ROOT@[0; 51) | ||
2 | STRUCT_DEF@[0; 12) | ||
3 | UNION_KW@[0; 5) | ||
4 | WHITESPACE@[5; 6) | ||
5 | NAME@[6; 9) | ||
6 | IDENT@[6; 9) "Foo" | ||
7 | WHITESPACE@[9; 10) | ||
8 | NAMED_FIELD_DEF_LIST@[10; 12) | ||
9 | L_CURLY@[10; 11) | ||
10 | R_CURLY@[11; 12) | ||
11 | WHITESPACE@[12; 13) | ||
12 | STRUCT_DEF@[13; 50) | ||
13 | UNION_KW@[13; 18) | ||
14 | WHITESPACE@[18; 19) | ||
15 | NAME@[19; 22) | ||
16 | IDENT@[19; 22) "Foo" | ||
17 | WHITESPACE@[22; 23) | ||
18 | NAMED_FIELD_DEF_LIST@[23; 50) | ||
19 | L_CURLY@[23; 24) | ||
20 | WHITESPACE@[24; 29) | ||
21 | NAMED_FIELD_DEF@[29; 35) | ||
22 | NAME@[29; 30) | ||
23 | IDENT@[29; 30) "a" | ||
24 | COLON@[30; 31) | ||
25 | WHITESPACE@[31; 32) | ||
26 | PATH_TYPE@[32; 35) | ||
27 | PATH@[32; 35) | ||
28 | PATH_SEGMENT@[32; 35) | ||
29 | NAME_REF@[32; 35) | ||
30 | IDENT@[32; 35) "i32" | ||
31 | COMMA@[35; 36) | ||
32 | WHITESPACE@[36; 41) | ||
33 | NAMED_FIELD_DEF@[41; 47) | ||
34 | NAME@[41; 42) | ||
35 | IDENT@[41; 42) "b" | ||
36 | COLON@[42; 43) | ||
37 | WHITESPACE@[43; 44) | ||
38 | PATH_TYPE@[44; 47) | ||
39 | PATH@[44; 47) | ||
40 | PATH_SEGMENT@[44; 47) | ||
41 | NAME_REF@[44; 47) | ||
42 | IDENT@[44; 47) "f32" | ||
43 | COMMA@[47; 48) | ||
44 | WHITESPACE@[48; 49) | ||
45 | R_CURLY@[49; 50) | ||
46 | WHITESPACE@[50; 51) | ||