(self)
| 90 | yield self.rhs |
| 91 | |
| 92 | def flatten(self) -> Rhs: |
| 93 | # If it's a single parenthesized group, flatten it. |
| 94 | rhs = self.rhs |
| 95 | if ( |
| 96 | not self.is_loop() |
| 97 | and len(rhs.alts) == 1 |
| 98 | and len(rhs.alts[0].items) == 1 |
| 99 | and isinstance(rhs.alts[0].items[0].item, Group) |
| 100 | ): |
| 101 | rhs = rhs.alts[0].items[0].item.rhs |
| 102 | return rhs |
| 103 | |
| 104 | |
| 105 | class Leaf: |
no test coverage detected