diff options
author | darksv <[email protected]> | 2018-09-14 21:51:12 +0100 |
---|---|---|
committer | darksv <[email protected]> | 2018-09-14 21:51:12 +0100 |
commit | 100968b68999231368fbacf62e8b8f242fbfdd3a (patch) | |
tree | 7b07ab4d4206bdaf5c8c41fe4bdcb5c11ad5c3f5 /crates/libsyntax2/tests | |
parent | b6f8037a6f8fbcb4f127e1d2b518279650b1f5ea (diff) |
Support for unions
Diffstat (limited to 'crates/libsyntax2/tests')
-rw-r--r-- | crates/libsyntax2/tests/data/parser/inline/0109_struct_items.txt | 86 | ||||
-rw-r--r-- | crates/libsyntax2/tests/data/parser/inline/0110_union_items.txt | 45 |
2 files changed, 131 insertions, 0 deletions
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..ea016d393 --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0109_struct_items.txt | |||
@@ -0,0 +1,86 @@ | |||
1 | ROOT@[0; 105) | ||
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) | ||
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..93e8a4e8d --- /dev/null +++ b/crates/libsyntax2/tests/data/parser/inline/0110_union_items.txt | |||
@@ -0,0 +1,45 @@ | |||
1 | ROOT@[0; 50) | ||
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) | ||