Commit 6bf8eae
authored
Allow observing an indent after conditional (#22611)
Normally do not infer NEWLINE within parens,
but special case old syntax for conditionals,
so that it can observe indented syntax.
The mechanism is to inject an Indented region
when parsing a parenthesized condition which is
within an InParens region, such as an arg list.
The effect is not to advance past EOL after `(true)`.
Fixes #22608File tree
2 files changed
+60
-9
lines changed- compiler/src/dotty/tools/dotc/parsing
- tests/pos
2 files changed
+60
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
108 | 111 | | |
109 | 112 | | |
110 | 113 | | |
| |||
2325 | 2328 | | |
2326 | 2329 | | |
2327 | 2330 | | |
2328 | | - | |
2329 | | - | |
2330 | | - | |
2331 | | - | |
2332 | | - | |
| 2331 | + | |
| 2332 | + | |
| 2333 | + | |
| 2334 | + | |
| 2335 | + | |
| 2336 | + | |
| 2337 | + | |
2333 | 2338 | | |
2334 | 2339 | | |
2335 | 2340 | | |
2336 | 2341 | | |
2337 | 2342 | | |
2338 | | - | |
2339 | 2343 | | |
2340 | 2344 | | |
2341 | | - | |
| 2345 | + | |
2342 | 2346 | | |
2343 | 2347 | | |
2344 | | - | |
2345 | 2348 | | |
2346 | | - | |
| 2349 | + | |
2347 | 2350 | | |
2348 | 2351 | | |
2349 | 2352 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
0 commit comments