MCPcopy Create free account
hub / github.com/emscripten-core/emscripten / parentheses_match

Function parentheses_match

tools/emscripten.py:272–283  ·  view source on GitHub ↗
(body, openIdx, closeIdx)

Source from the content-addressed store, hash-verified

270# Test if the parentheses at body[openIdx] and body[closeIdx] are a match to
271# each other.
272def 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
286def trim_asm_const_body(body):

Callers 1

trim_asm_const_bodyFunction · 0.85

Calls 1

rangeFunction · 0.50

Tested by

no test coverage detected