Pre-conditions: * @leaves[@string_idx].type == token.STRING Returns: The index directly after the last leaf which is a part of the string trailer, if a "trailer" exists. OR @string_idx + 1, if no string "trailer" exists.
(self, leaves: list[Leaf], string_idx: int)
| 2421 | self._unmatched_lpars = 0 |
| 2422 | |
| 2423 | def parse(self, leaves: list[Leaf], string_idx: int) -> int: |
| 2424 | """ |
| 2425 | Pre-conditions: |
| 2426 | * @leaves[@string_idx].type == token.STRING |
| 2427 | |
| 2428 | Returns: |
| 2429 | The index directly after the last leaf which is a part of the string |
| 2430 | trailer, if a "trailer" exists. |
| 2431 | OR |
| 2432 | @string_idx + 1, if no string "trailer" exists. |
| 2433 | """ |
| 2434 | assert leaves[string_idx].type == token.STRING |
| 2435 | |
| 2436 | idx = string_idx + 1 |
| 2437 | while idx < len(leaves) and self._next_state(leaves[idx]): |
| 2438 | idx += 1 |
| 2439 | return idx |
| 2440 | |
| 2441 | def _next_state(self, leaf: Leaf) -> bool: |
| 2442 | """ |
no test coverage detected