diff options
author | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-12-19 21:22:00 +0000 |
---|---|---|
committer | bors[bot] <bors[bot]@users.noreply.github.com> | 2018-12-19 21:22:00 +0000 |
commit | ef1e107df147a82b74089ab9797ce35effe24e5e (patch) | |
tree | e54a25733ffc2c3b19385b299779d763615cb81e /crates/ra_syntax/tests/data/parser/ok | |
parent | 0e1c01cdb8e6b346edd5d68d9cc72cbce1ce9793 (diff) | |
parent | a3b842fb8b7b5503b1c4fc49355edd4f2fe0d28d (diff) |
Merge #273
273: Add a test to ensure that we can parse each file r=matklad a=DJMcNab
Note that this has a non-spurious failure in ra_analysis/src/mock_analysis.
Probably fixes #195.
If my understanding is correct, fixes #214 and fixes #225.
Co-authored-by: DJMcNab <[email protected]>
Diffstat (limited to 'crates/ra_syntax/tests/data/parser/ok')
-rw-r--r-- | crates/ra_syntax/tests/data/parser/ok/0029_range_forms.rs | 5 | ||||
-rw-r--r-- | crates/ra_syntax/tests/data/parser/ok/0029_range_forms.txt | 86 |
2 files changed, 85 insertions, 6 deletions
diff --git a/crates/ra_syntax/tests/data/parser/ok/0029_range_forms.rs b/crates/ra_syntax/tests/data/parser/ok/0029_range_forms.rs index 03f4ae7b2..f9ff444d4 100644 --- a/crates/ra_syntax/tests/data/parser/ok/0029_range_forms.rs +++ b/crates/ra_syntax/tests/data/parser/ok/0029_range_forms.rs | |||
@@ -3,4 +3,9 @@ fn foo() { | |||
3 | ..z = 2; | 3 | ..z = 2; |
4 | x = false..1 == 1; | 4 | x = false..1 == 1; |
5 | let x = 1..; | 5 | let x = 1..; |
6 | |||
7 | ..=1 + 1; | ||
8 | ..=z = 2; | ||
9 | x = false..=1 == 1; | ||
10 | let x = 1..; | ||
6 | } | 11 | } |
diff --git a/crates/ra_syntax/tests/data/parser/ok/0029_range_forms.txt b/crates/ra_syntax/tests/data/parser/ok/0029_range_forms.txt index 2e7703c21..e3706bfbd 100644 --- a/crates/ra_syntax/tests/data/parser/ok/0029_range_forms.txt +++ b/crates/ra_syntax/tests/data/parser/ok/0029_range_forms.txt | |||
@@ -1,5 +1,5 @@ | |||
1 | SOURCE_FILE@[0; 79) | 1 | SOURCE_FILE@[0; 153) |
2 | FN_DEF@[0; 78) | 2 | FN_DEF@[0; 152) |
3 | FN_KW@[0; 2) | 3 | FN_KW@[0; 2) |
4 | WHITESPACE@[2; 3) | 4 | WHITESPACE@[2; 3) |
5 | NAME@[3; 6) | 5 | NAME@[3; 6) |
@@ -8,7 +8,7 @@ SOURCE_FILE@[0; 79) | |||
8 | L_PAREN@[6; 7) | 8 | L_PAREN@[6; 7) |
9 | R_PAREN@[7; 8) | 9 | R_PAREN@[7; 8) |
10 | WHITESPACE@[8; 9) | 10 | WHITESPACE@[8; 9) |
11 | BLOCK@[9; 78) | 11 | BLOCK@[9; 152) |
12 | L_CURLY@[9; 10) | 12 | L_CURLY@[9; 10) |
13 | WHITESPACE@[10; 15) | 13 | WHITESPACE@[10; 15) |
14 | EXPR_STMT@[15; 23) | 14 | EXPR_STMT@[15; 23) |
@@ -78,6 +78,80 @@ SOURCE_FILE@[0; 79) | |||
78 | INT_NUMBER@[72; 73) "1" | 78 | INT_NUMBER@[72; 73) "1" |
79 | DOTDOT@[73; 75) | 79 | DOTDOT@[73; 75) |
80 | SEMI@[75; 76) | 80 | SEMI@[75; 76) |
81 | WHITESPACE@[76; 77) | 81 | WHITESPACE@[76; 86) |
82 | R_CURLY@[77; 78) | 82 | err: `expected expression` |
83 | WHITESPACE@[78; 79) | 83 | EXPR_STMT@[86; 89) |
84 | ERROR@[86; 89) | ||
85 | DOTDOTEQ@[86; 89) | ||
86 | err: `expected SEMI` | ||
87 | EXPR_STMT@[89; 95) | ||
88 | BIN_EXPR@[89; 94) | ||
89 | LITERAL@[89; 90) | ||
90 | INT_NUMBER@[89; 90) "1" | ||
91 | WHITESPACE@[90; 91) | ||
92 | PLUS@[91; 92) | ||
93 | WHITESPACE@[92; 93) | ||
94 | LITERAL@[93; 94) | ||
95 | INT_NUMBER@[93; 94) "1" | ||
96 | SEMI@[94; 95) | ||
97 | WHITESPACE@[95; 100) | ||
98 | err: `expected expression` | ||
99 | EXPR_STMT@[100; 103) | ||
100 | ERROR@[100; 103) | ||
101 | DOTDOTEQ@[100; 103) | ||
102 | err: `expected SEMI` | ||
103 | EXPR_STMT@[103; 109) | ||
104 | BIN_EXPR@[103; 108) | ||
105 | PATH_EXPR@[103; 104) | ||
106 | PATH@[103; 104) | ||
107 | PATH_SEGMENT@[103; 104) | ||
108 | NAME_REF@[103; 104) | ||
109 | IDENT@[103; 104) "z" | ||
110 | WHITESPACE@[104; 105) | ||
111 | EQ@[105; 106) | ||
112 | WHITESPACE@[106; 107) | ||
113 | LITERAL@[107; 108) | ||
114 | INT_NUMBER@[107; 108) "2" | ||
115 | SEMI@[108; 109) | ||
116 | WHITESPACE@[109; 114) | ||
117 | EXPR_STMT@[114; 133) | ||
118 | BIN_EXPR@[114; 132) | ||
119 | PATH_EXPR@[114; 115) | ||
120 | PATH@[114; 115) | ||
121 | PATH_SEGMENT@[114; 115) | ||
122 | NAME_REF@[114; 115) | ||
123 | IDENT@[114; 115) "x" | ||
124 | WHITESPACE@[115; 116) | ||
125 | EQ@[116; 117) | ||
126 | WHITESPACE@[117; 118) | ||
127 | RANGE_EXPR@[118; 132) | ||
128 | LITERAL@[118; 123) | ||
129 | FALSE_KW@[118; 123) | ||
130 | DOTDOTEQ@[123; 126) | ||
131 | BIN_EXPR@[126; 132) | ||
132 | LITERAL@[126; 127) | ||
133 | INT_NUMBER@[126; 127) "1" | ||
134 | WHITESPACE@[127; 128) | ||
135 | EQEQ@[128; 130) | ||
136 | WHITESPACE@[130; 131) | ||
137 | LITERAL@[131; 132) | ||
138 | INT_NUMBER@[131; 132) "1" | ||
139 | SEMI@[132; 133) | ||
140 | WHITESPACE@[133; 138) | ||
141 | LET_STMT@[138; 150) | ||
142 | LET_KW@[138; 141) | ||
143 | WHITESPACE@[141; 142) | ||
144 | BIND_PAT@[142; 143) | ||
145 | NAME@[142; 143) | ||
146 | IDENT@[142; 143) "x" | ||
147 | WHITESPACE@[143; 144) | ||
148 | EQ@[144; 145) | ||
149 | WHITESPACE@[145; 146) | ||
150 | RANGE_EXPR@[146; 149) | ||
151 | LITERAL@[146; 147) | ||
152 | INT_NUMBER@[146; 147) "1" | ||
153 | DOTDOT@[147; 149) | ||
154 | SEMI@[149; 150) | ||
155 | WHITESPACE@[150; 151) | ||
156 | R_CURLY@[151; 152) | ||
157 | WHITESPACE@[152; 153) | ||