MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / match

Function match

addons/cppcheckdata.py:1613–1628  ·  view source on GitHub ↗
(token, pattern)

Source from the content-addressed store, hash-verified

1611 return (s, None)
1612
1613def match(token, pattern):
1614 if not pattern:
1615 return MatchResult(False)
1616 end = None
1617 bindings = {}
1618 words = [bind_split(word) for word in pattern.split()]
1619 for p, b in words:
1620 t = match_atom(token, p)
1621 if b:
1622 bindings[b] = token
1623 if not t:
1624 return MatchResult(False, keys=[xx for pp, xx in words]+['end'])
1625 end = t
1626 token = t.next
1627 bindings['end'] = end
1628 return MatchResult(True, bindings=bindings)
1629
1630def get_function_call_name_args(token):
1631 """Get function name and arguments for function call

Callers

nothing calls this directly

Calls 3

bind_splitFunction · 0.85
match_atomFunction · 0.85
MatchResultClass · 0.70

Tested by

no test coverage detected