Pre-conditions: * @leaves[@string_idx].type == token.STRING Returns: The index directly after the last leaf which is apart of the string trailer, if a "trailer" exists. OR @string_idx + 1, if no string "trailer" exists
(self, leaves: List[Leaf], string_idx: int)
| 2251 | self._unmatched_lpars = 0 |
| 2252 | |
| 2253 | def parse(self, leaves: List[Leaf], string_idx: int) -> int: |
| 2254 | """ |
| 2255 | Pre-conditions: |
| 2256 | * @leaves[@string_idx].type == token.STRING |
| 2257 | |
| 2258 | Returns: |
| 2259 | The index directly after the last leaf which is apart of the string |
| 2260 | trailer, if a "trailer" exists. |
| 2261 | OR |
| 2262 | @string_idx + 1, if no string "trailer" exists. |
| 2263 | """ |
| 2264 | assert leaves[string_idx].type == token.STRING |
| 2265 | |
| 2266 | idx = string_idx + 1 |
| 2267 | while idx < len(leaves) and self._next_state(leaves[idx]): |
| 2268 | idx += 1 |
| 2269 | return idx |
| 2270 | |
| 2271 | def _next_state(self, leaf: Leaf) -> bool: |
| 2272 | """ |
no test coverage detected