(body, openIdx, closeIdx)
| 270 | # Test if the parentheses at body[openIdx] and body[closeIdx] are a match to |
| 271 | # each other. |
| 272 | def parentheses_match(body, openIdx, closeIdx): |
| 273 | if closeIdx < 0: |
| 274 | closeIdx += len(body) |
| 275 | count = 1 |
| 276 | for i in range(openIdx + 1, closeIdx + 1): |
| 277 | if body[i] == body[openIdx]: |
| 278 | count += 1 |
| 279 | elif body[i] == body[closeIdx]: |
| 280 | count -= 1 |
| 281 | if count <= 0: |
| 282 | return i == closeIdx |
| 283 | return False |
| 284 | |
| 285 | |
| 286 | def trim_asm_const_body(body): |
no test coverage detected