(self, args_text: str)
| 421 | return -1 |
| 422 | |
| 423 | def _split_args(self, args_text: str) -> list: |
| 424 | args = [] |
| 425 | current = [] |
| 426 | depth = 0 |
| 427 | in_string = False |
| 428 | escape = False |
| 429 | for c in args_text: |
| 430 | if escape: |
| 431 | current.append(c) |
| 432 | escape = False |
| 433 | continue |
| 434 | if c == '\\': |
| 435 | current.append(c) |
| 436 | escape = True |
| 437 | continue |
| 438 | if c == '"': |
| 439 | in_string = not in_string |
| 440 | current.append(c) |
| 441 | continue |
| 442 | if not in_string: |
| 443 | if c in '(<': |
| 444 | depth += 1 |
| 445 | elif c in ')>': |
| 446 | depth -= 1 |
| 447 | elif c == ',' and depth == 0: |
| 448 | args.append("".join(current).strip()) |
| 449 | current = [] |
| 450 | continue |
| 451 | current.append(c) |
| 452 | if current: |
| 453 | args.append("".join(current).strip()) |
| 454 | return args |
| 455 | |
| 456 | def _extract_class_name(self, args_text: str) -> Optional[str]: |
| 457 | args = self._split_args(args_text) |
no test coverage detected