Split line into many lines, starting with the last matching bracket pair. If the split was by optional parentheses, attempt splitting without them, too. `omit` is a collection of closing bracket IDs that shouldn't be considered for this split. Note: running this function modifies `
(
line: Line,
mode: Mode,
features: Collection[Feature] = (),
omit: Collection[LeafID] = (),
)
| 939 | |
| 940 | |
| 941 | def right_hand_split( |
| 942 | line: Line, |
| 943 | mode: Mode, |
| 944 | features: Collection[Feature] = (), |
| 945 | omit: Collection[LeafID] = (), |
| 946 | ) -> Iterator[Line]: |
| 947 | """Split line into many lines, starting with the last matching bracket pair. |
| 948 | |
| 949 | If the split was by optional parentheses, attempt splitting without them, too. |
| 950 | `omit` is a collection of closing bracket IDs that shouldn't be considered for |
| 951 | this split. |
| 952 | |
| 953 | Note: running this function modifies `bracket_depth` on the leaves of `line`. |
| 954 | """ |
| 955 | rhs_result = _first_right_hand_split(line, omit=omit) |
| 956 | yield from _maybe_split_omitting_optional_parens( |
| 957 | rhs_result, line, mode, features=features, omit=omit |
| 958 | ) |
| 959 | |
| 960 | |
| 961 | def _first_right_hand_split( |
no test coverage detected