Commit 3a0d133
committed
[flang] Better recovery from errors in a loop control
When there's an error in a DO statement loop control, error recovery
isn't great. A bare "DO" is a valid statement, so a failure to parse
its loop control doesn't fail on the whole statement. Its partial
parse ends after the keyword, and as some other statement parsers can
get further into the input before failing, errors in the loop control
can lead to confusing error messages about bad pointer assignment statements
and others. So just check that a bare "DO" is followed by the end of the
statement.1 parent 6e48214 commit 3a0d133
File tree
4 files changed
+30
-5
lines changed- flang
- docs
- lib/Parser
- test/Parser
4 files changed
+30
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
178 | 178 | | |
179 | 179 | | |
180 | 180 | | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| |||
282 | 281 | | |
283 | 282 | | |
284 | 283 | | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
285 | 292 | | |
286 | 293 | | |
287 | 294 | | |
288 | 295 | | |
289 | | - | |
| 296 | + | |
290 | 297 | | |
291 | 298 | | |
292 | 299 | | |
293 | 300 | | |
294 | | - | |
| 301 | + | |
295 | 302 | | |
296 | | - | |
| 303 | + | |
297 | 304 | | |
298 | 305 | | |
299 | 306 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
106 | 105 | | |
107 | 106 | | |
108 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments