MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / _cpp_plain_template_parameters

Function _cpp_plain_template_parameters

graphify/extractors/engine.py:5319–5332  ·  view source on GitHub ↗
(node, source: bytes)

Source from the content-addressed store, hash-verified

5317
5318
5319def _cpp_plain_template_parameters(node, source: bytes) -> list[str]:
5320 if node is None or node.type != "template_declaration":
5321 return []
5322 if len([c for c in node.named_children if c.type != "comment"]) != 2:
5323 return []
5324 parameters = node.child_by_field_name("parameters")
5325 names = []
5326 for parameter in parameters.named_children if parameters is not None else ():
5327 if (parameter.type != "type_parameter_declaration"
5328 or len(parameter.named_children) != 1
5329 or parameter.named_children[0].type != "type_identifier"):
5330 return []
5331 names.append(_read_text(parameter.named_children[0], source))
5332 return names if len(set(names)) == len(names) else []
5333
5334
5335def _cpp_zero_arg_member_signature(node, source: bytes) -> tuple | None:

Callers 1

Calls 1

_read_textFunction · 0.90

Tested by

no test coverage detected