diff options
Diffstat (limited to 'tests')
6 files changed, 162 insertions, 0 deletions
diff --git a/tests/data/parser/inline/0087_stmt_postfix_expr_ambiguity.rs b/tests/data/parser/inline/0087_stmt_postfix_expr_ambiguity.rs new file mode 100644 index 000000000..2edd578f9 --- /dev/null +++ b/tests/data/parser/inline/0087_stmt_postfix_expr_ambiguity.rs | |||
@@ -0,0 +1,7 @@ | |||
1 | fn foo() { | ||
2 | match () { | ||
3 | _ => {} | ||
4 | () => {} | ||
5 | [] => {} | ||
6 | } | ||
7 | } | ||
diff --git a/tests/data/parser/inline/0087_stmt_postfix_expr_ambiguity.txt b/tests/data/parser/inline/0087_stmt_postfix_expr_ambiguity.txt new file mode 100644 index 000000000..47b4d4481 --- /dev/null +++ b/tests/data/parser/inline/0087_stmt_postfix_expr_ambiguity.txt | |||
@@ -0,0 +1,58 @@ | |||
1 | FILE@[0; 84) | ||
2 | FN_ITEM@[0; 83) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 83) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | MATCH_EXPR@[15; 81) | ||
15 | MATCH_KW@[15; 20) | ||
16 | WHITESPACE@[20; 21) | ||
17 | TUPLE_EXPR@[21; 23) | ||
18 | L_PAREN@[21; 22) | ||
19 | R_PAREN@[22; 23) | ||
20 | WHITESPACE@[23; 24) | ||
21 | L_CURLY@[24; 25) | ||
22 | WHITESPACE@[25; 34) | ||
23 | MATCH_ARM@[34; 41) | ||
24 | PLACEHOLDER_PAT@[34; 35) | ||
25 | UNDERSCORE@[34; 35) | ||
26 | WHITESPACE@[35; 36) | ||
27 | FAT_ARROW@[36; 38) | ||
28 | WHITESPACE@[38; 39) | ||
29 | BLOCK_EXPR@[39; 41) | ||
30 | L_CURLY@[39; 40) | ||
31 | R_CURLY@[40; 41) | ||
32 | WHITESPACE@[41; 50) | ||
33 | MATCH_ARM@[50; 58) | ||
34 | TUPLE_PAT@[50; 52) | ||
35 | L_PAREN@[50; 51) | ||
36 | R_PAREN@[51; 52) | ||
37 | WHITESPACE@[52; 53) | ||
38 | FAT_ARROW@[53; 55) | ||
39 | WHITESPACE@[55; 56) | ||
40 | BLOCK_EXPR@[56; 58) | ||
41 | L_CURLY@[56; 57) | ||
42 | R_CURLY@[57; 58) | ||
43 | WHITESPACE@[58; 67) | ||
44 | MATCH_ARM@[67; 75) | ||
45 | SLICE_PAT@[67; 69) | ||
46 | L_BRACK@[67; 68) | ||
47 | R_BRACK@[68; 69) | ||
48 | WHITESPACE@[69; 70) | ||
49 | FAT_ARROW@[70; 72) | ||
50 | WHITESPACE@[72; 73) | ||
51 | BLOCK_EXPR@[73; 75) | ||
52 | L_CURLY@[73; 74) | ||
53 | R_CURLY@[74; 75) | ||
54 | WHITESPACE@[75; 80) | ||
55 | R_CURLY@[80; 81) | ||
56 | WHITESPACE@[81; 82) | ||
57 | R_CURLY@[82; 83) | ||
58 | WHITESPACE@[83; 84) | ||
diff --git a/tests/data/parser/inline/0088_stmt_bin_expr_ambiguity.rs b/tests/data/parser/inline/0088_stmt_bin_expr_ambiguity.rs new file mode 100644 index 000000000..37b843742 --- /dev/null +++ b/tests/data/parser/inline/0088_stmt_bin_expr_ambiguity.rs | |||
@@ -0,0 +1,4 @@ | |||
1 | fn foo() { | ||
2 | let _ = {1} & 2; | ||
3 | {1} &2; | ||
4 | } | ||
diff --git a/tests/data/parser/inline/0088_stmt_bin_expr_ambiguity.txt b/tests/data/parser/inline/0088_stmt_bin_expr_ambiguity.txt new file mode 100644 index 000000000..df0aa44b3 --- /dev/null +++ b/tests/data/parser/inline/0088_stmt_bin_expr_ambiguity.txt | |||
@@ -0,0 +1,50 @@ | |||
1 | FILE@[0; 46) | ||
2 | FN_ITEM@[0; 45) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 45) | ||
12 | L_CURLY@[9; 10) | ||
13 | WHITESPACE@[10; 15) | ||
14 | LET_STMT@[15; 31) | ||
15 | LET_KW@[15; 18) | ||
16 | WHITESPACE@[18; 19) | ||
17 | PLACEHOLDER_PAT@[19; 20) | ||
18 | UNDERSCORE@[19; 20) | ||
19 | WHITESPACE@[20; 21) | ||
20 | EQ@[21; 22) | ||
21 | WHITESPACE@[22; 23) | ||
22 | BIN_EXPR@[23; 30) | ||
23 | BLOCK_EXPR@[23; 26) | ||
24 | L_CURLY@[23; 24) | ||
25 | LITERAL@[24; 25) | ||
26 | INT_NUMBER@[24; 25) "1" | ||
27 | R_CURLY@[25; 26) | ||
28 | WHITESPACE@[26; 27) | ||
29 | AMP@[27; 28) | ||
30 | WHITESPACE@[28; 29) | ||
31 | LITERAL@[29; 30) | ||
32 | INT_NUMBER@[29; 30) "2" | ||
33 | SEMI@[30; 31) | ||
34 | WHITESPACE@[31; 36) | ||
35 | EXPR_STMT@[36; 39) | ||
36 | BLOCK_EXPR@[36; 39) | ||
37 | L_CURLY@[36; 37) | ||
38 | LITERAL@[37; 38) | ||
39 | INT_NUMBER@[37; 38) "1" | ||
40 | R_CURLY@[38; 39) | ||
41 | WHITESPACE@[39; 40) | ||
42 | EXPR_STMT@[40; 43) | ||
43 | REF_EXPR@[40; 42) | ||
44 | AMP@[40; 41) | ||
45 | LITERAL@[41; 42) | ||
46 | INT_NUMBER@[41; 42) "2" | ||
47 | SEMI@[42; 43) | ||
48 | WHITESPACE@[43; 44) | ||
49 | R_CURLY@[44; 45) | ||
50 | WHITESPACE@[45; 46) | ||
diff --git a/tests/data/parser/inline/0089_slice_pat.rs b/tests/data/parser/inline/0089_slice_pat.rs new file mode 100644 index 000000000..7955973b9 --- /dev/null +++ b/tests/data/parser/inline/0089_slice_pat.rs | |||
@@ -0,0 +1,3 @@ | |||
1 | fn main() { | ||
2 | let [a, b, ..] = []; | ||
3 | } | ||
diff --git a/tests/data/parser/inline/0089_slice_pat.txt b/tests/data/parser/inline/0089_slice_pat.txt new file mode 100644 index 000000000..1e7f20119 --- /dev/null +++ b/tests/data/parser/inline/0089_slice_pat.txt | |||
@@ -0,0 +1,40 @@ | |||
1 | FILE@[0; 39) | ||
2 | FN_ITEM@[0; 38) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 7) | ||
6 | IDENT@[3; 7) "main" | ||
7 | PARAM_LIST@[7; 9) | ||
8 | L_PAREN@[7; 8) | ||
9 | R_PAREN@[8; 9) | ||
10 | WHITESPACE@[9; 10) | ||
11 | BLOCK_EXPR@[10; 38) | ||
12 | L_CURLY@[10; 11) | ||
13 | WHITESPACE@[11; 16) | ||
14 | LET_STMT@[16; 36) | ||
15 | LET_KW@[16; 19) | ||
16 | WHITESPACE@[19; 20) | ||
17 | SLICE_PAT@[20; 30) | ||
18 | L_BRACK@[20; 21) | ||
19 | BIND_PAT@[21; 22) | ||
20 | NAME@[21; 22) | ||
21 | IDENT@[21; 22) "a" | ||
22 | COMMA@[22; 23) | ||
23 | WHITESPACE@[23; 24) | ||
24 | BIND_PAT@[24; 25) | ||
25 | NAME@[24; 25) | ||
26 | IDENT@[24; 25) "b" | ||
27 | COMMA@[25; 26) | ||
28 | WHITESPACE@[26; 27) | ||
29 | DOTDOT@[27; 29) | ||
30 | R_BRACK@[29; 30) | ||
31 | WHITESPACE@[30; 31) | ||
32 | EQ@[31; 32) | ||
33 | WHITESPACE@[32; 33) | ||
34 | ARRAY_EXPR@[33; 35) | ||
35 | L_BRACK@[33; 34) | ||
36 | R_BRACK@[34; 35) | ||
37 | SEMI@[35; 36) | ||
38 | WHITESPACE@[36; 37) | ||
39 | R_CURLY@[37; 38) | ||
40 | WHITESPACE@[38; 39) | ||