(string, start_pos, end_pos)
| 1032 | |
| 1033 | |
| 1034 | def isolate_expression(string, start_pos, end_pos): |
| 1035 | srow, scol = start_pos |
| 1036 | srow -= 1 |
| 1037 | erow, ecol = end_pos |
| 1038 | erow -= 1 |
| 1039 | lines = string.splitlines(True) |
| 1040 | if srow == erow: |
| 1041 | return lines[srow][scol:ecol] |
| 1042 | parts = [lines[srow][scol:]] |
| 1043 | parts.extend(lines[srow + 1:erow]) |
| 1044 | if erow < len(lines): |
| 1045 | # It'll sometimes give (end_row_past_finish, 0) |
| 1046 | parts.append(lines[erow][:ecol]) |
| 1047 | return "".join(parts) |
| 1048 | |
| 1049 | |
| 1050 | _fill_command_usage = """\ |
no test coverage detected
searching dependent graphs…