diff options
author | Aleksey Kladov <[email protected]> | 2018-08-05 16:07:06 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-08-05 16:07:06 +0100 |
commit | b0291cd8c2ec1d6d164caaa743f7484416e9b3f5 (patch) | |
tree | 57a2b21085bf0996d37c3f8d757f0332c5055a5a /tests | |
parent | 80fa861cd688c8e7c92e27feaf6623ecfaa4901e (diff) |
Range expr
Diffstat (limited to 'tests')
4 files changed, 108 insertions, 0 deletions
diff --git a/tests/data/parser/inline/0082_range_binding_power.rs b/tests/data/parser/inline/0082_range_binding_power.rs new file mode 100644 index 000000000..259ec31e2 --- /dev/null +++ b/tests/data/parser/inline/0082_range_binding_power.rs | |||
@@ -0,0 +1,5 @@ | |||
1 | fn foo() { | ||
2 | .. 1 + 1; | ||
3 | .. z = 2; | ||
4 | x = false .. 1 == 1; | ||
5 | } | ||
diff --git a/tests/data/parser/inline/0082_range_binding_power.txt b/tests/data/parser/inline/0082_range_binding_power.txt new file mode 100644 index 000000000..0b7bfd56a --- /dev/null +++ b/tests/data/parser/inline/0082_range_binding_power.txt | |||
@@ -0,0 +1,72 @@ | |||
1 | FILE@[0; 66) | ||
2 | FN_ITEM@[0; 66) | ||
3 | FN_KW@[0; 2) | ||
4 | NAME@[2; 6) | ||
5 | WHITESPACE@[2; 3) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 9) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 66) | ||
12 | L_CURLY@[9; 10) | ||
13 | EXPR_STMT@[10; 29) | ||
14 | RANGE_EXPR@[10; 23) | ||
15 | WHITESPACE@[10; 15) | ||
16 | DOTDOT@[15; 17) | ||
17 | BIN_EXPR@[17; 23) | ||
18 | LITERAL@[17; 20) | ||
19 | WHITESPACE@[17; 18) | ||
20 | INT_NUMBER@[18; 19) "1" | ||
21 | WHITESPACE@[19; 20) | ||
22 | PLUS@[20; 21) | ||
23 | LITERAL@[21; 23) | ||
24 | WHITESPACE@[21; 22) | ||
25 | INT_NUMBER@[22; 23) "1" | ||
26 | SEMI@[23; 24) | ||
27 | WHITESPACE@[24; 29) | ||
28 | EXPR_STMT@[29; 43) | ||
29 | BIN_EXPR@[29; 37) | ||
30 | RANGE_EXPR@[29; 34) | ||
31 | DOTDOT@[29; 31) | ||
32 | PATH_EXPR@[31; 34) | ||
33 | PATH@[31; 34) | ||
34 | PATH_SEGMENT@[31; 34) | ||
35 | NAME_REF@[31; 34) | ||
36 | WHITESPACE@[31; 32) | ||
37 | IDENT@[32; 33) "z" | ||
38 | WHITESPACE@[33; 34) | ||
39 | EQ@[34; 35) | ||
40 | LITERAL@[35; 37) | ||
41 | WHITESPACE@[35; 36) | ||
42 | INT_NUMBER@[36; 37) "2" | ||
43 | SEMI@[37; 38) | ||
44 | WHITESPACE@[38; 43) | ||
45 | EXPR_STMT@[43; 64) | ||
46 | BIN_EXPR@[43; 62) | ||
47 | PATH_EXPR@[43; 45) | ||
48 | PATH@[43; 45) | ||
49 | PATH_SEGMENT@[43; 45) | ||
50 | NAME_REF@[43; 45) | ||
51 | IDENT@[43; 44) "x" | ||
52 | WHITESPACE@[44; 45) | ||
53 | EQ@[45; 46) | ||
54 | BIN_EXPR@[46; 62) | ||
55 | LITERAL@[46; 53) | ||
56 | WHITESPACE@[46; 47) | ||
57 | FALSE_KW@[47; 52) | ||
58 | WHITESPACE@[52; 53) | ||
59 | DOTDOT@[53; 55) | ||
60 | BIN_EXPR@[55; 62) | ||
61 | LITERAL@[55; 58) | ||
62 | WHITESPACE@[55; 56) | ||
63 | INT_NUMBER@[56; 57) "1" | ||
64 | WHITESPACE@[57; 58) | ||
65 | EQEQ@[58; 60) | ||
66 | LITERAL@[60; 62) | ||
67 | WHITESPACE@[60; 61) | ||
68 | INT_NUMBER@[61; 62) "1" | ||
69 | SEMI@[62; 63) | ||
70 | WHITESPACE@[63; 64) | ||
71 | R_CURLY@[64; 65) | ||
72 | WHITESPACE@[65; 66) | ||
diff --git a/tests/data/parser/inline/0083_postfix_range.rs b/tests/data/parser/inline/0083_postfix_range.rs new file mode 100644 index 000000000..c39fe8e68 --- /dev/null +++ b/tests/data/parser/inline/0083_postfix_range.rs | |||
@@ -0,0 +1 @@ | |||
fn foo() { let x = 1..; } | |||
diff --git a/tests/data/parser/inline/0083_postfix_range.txt b/tests/data/parser/inline/0083_postfix_range.txt new file mode 100644 index 000000000..6a77e3a71 --- /dev/null +++ b/tests/data/parser/inline/0083_postfix_range.txt | |||
@@ -0,0 +1,30 @@ | |||
1 | FILE@[0; 26) | ||
2 | FN_ITEM@[0; 26) | ||
3 | FN_KW@[0; 2) | ||
4 | NAME@[2; 6) | ||
5 | WHITESPACE@[2; 3) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 9) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | BLOCK_EXPR@[9; 26) | ||
12 | L_CURLY@[9; 10) | ||
13 | LET_STMT@[10; 24) | ||
14 | WHITESPACE@[10; 11) | ||
15 | LET_KW@[11; 14) | ||
16 | BIND_PAT@[14; 17) | ||
17 | NAME@[14; 17) | ||
18 | WHITESPACE@[14; 15) | ||
19 | IDENT@[15; 16) "x" | ||
20 | WHITESPACE@[16; 17) | ||
21 | EQ@[17; 18) | ||
22 | RANGE_EXPR@[18; 22) | ||
23 | LITERAL@[18; 20) | ||
24 | WHITESPACE@[18; 19) | ||
25 | INT_NUMBER@[19; 20) "1" | ||
26 | DOTDOT@[20; 22) | ||
27 | SEMI@[22; 23) | ||
28 | WHITESPACE@[23; 24) | ||
29 | R_CURLY@[24; 25) | ||
30 | WHITESPACE@[25; 26) | ||