mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-17 15:50:53 +07:00
I introduced a new type of CFG instructions, similar to ConditionalInstruction, called RefutablePatternInstruction. The idea is that every pattern that can possibly fail to match is surrounded with a pair of such instructions, helping to describe how the control flow moves in each case. The PEP calls the opposite type of patterns that always match "irrefutable", hence the name. We need these synthetic instructions because otherwise some refutable patterns such as literal ones (e.g. "42") don't leave any nodes in the graph. Incorporating the information about irrefutable patterns right into the graph allows catching cases such as "wildcard/name capture makes remaining patterns unreachable", both in OR patterns and independent case clauses. GitOrigin-RevId: beebe1890a6a824b188e6954a2c92f7ec52079e0
9 lines
115 B
Python
9 lines
115 B
Python
match 1:
|
|
case 1:
|
|
match 11:
|
|
case 11:
|
|
y11
|
|
y1
|
|
case 2:
|
|
y2
|
|
z |