Commit d558371
Shared CFG: add defaulted getWhileElse/getForeachElse to AstSig
Lifts the shared-controlflow changes out of the larger Python new-CFG
PR so they can be reviewed independently. No behavioural change for
existing languages (Java, C#, Ruby, Swift, Go, ...) — both new
predicates default to `none()` and the Make0 loop-edge case
extensions only fire when a language overrides them.
Python's upcoming AstNodeImpl wiring uses these predicates to model
`while-else` and `for-else`, where the `else` block runs when the
loop condition becomes false (rather than via a `break`).
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent aaa3b36 commit d558371
2 files changed
Lines changed: 41 additions & 3 deletions
File tree
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
Lines changed: 37 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
214 | 228 | | |
215 | 229 | | |
216 | 230 | | |
| |||
1549 | 1563 | | |
1550 | 1564 | | |
1551 | 1565 | | |
1552 | | - | |
| 1566 | + | |
| 1567 | + | |
| 1568 | + | |
| 1569 | + | |
| 1570 | + | |
1553 | 1571 | | |
1554 | 1572 | | |
1555 | 1573 | | |
1556 | 1574 | | |
1557 | 1575 | | |
| 1576 | + | |
| 1577 | + | |
| 1578 | + | |
| 1579 | + | |
| 1580 | + | |
1558 | 1581 | | |
1559 | 1582 | | |
1560 | 1583 | | |
1561 | 1584 | | |
1562 | 1585 | | |
1563 | 1586 | | |
1564 | | - | |
| 1587 | + | |
| 1588 | + | |
| 1589 | + | |
| 1590 | + | |
| 1591 | + | |
1565 | 1592 | | |
1566 | 1593 | | |
1567 | 1594 | | |
| |||
1574 | 1601 | | |
1575 | 1602 | | |
1576 | 1603 | | |
1577 | | - | |
| 1604 | + | |
| 1605 | + | |
| 1606 | + | |
| 1607 | + | |
| 1608 | + | |
1578 | 1609 | | |
1579 | 1610 | | |
1580 | 1611 | | |
| 1612 | + | |
| 1613 | + | |
| 1614 | + | |
1581 | 1615 | | |
1582 | 1616 | | |
1583 | 1617 | | |
| |||
0 commit comments