(self, actions, arg_strings_pattern)
| 2492 | return len(match.group(1)) |
| 2493 | |
| 2494 | def _match_arguments_partial(self, actions, arg_strings_pattern): |
| 2495 | # progressively shorten the actions list by slicing off the |
| 2496 | # final actions until we find a match |
| 2497 | for i in range(len(actions), 0, -1): |
| 2498 | actions_slice = actions[:i] |
| 2499 | pattern = ''.join([self._get_nargs_pattern(action) |
| 2500 | for action in actions_slice]) |
| 2501 | match = _re.match(pattern, arg_strings_pattern) |
| 2502 | if match is not None: |
| 2503 | result = [len(string) for string in match.groups()] |
| 2504 | if (match.end() < len(arg_strings_pattern) |
| 2505 | and arg_strings_pattern[match.end()] == 'O'): |
| 2506 | while result and not result[-1]: |
| 2507 | del result[-1] |
| 2508 | return result |
| 2509 | return [] |
| 2510 | |
| 2511 | def _parse_optional(self, arg_string): |
| 2512 | # if it's an empty string, it was meant to be a positional |
nothing calls this directly
no test coverage detected