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

Function literal

graphify/extract.py:13979–13989  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

13977 return False
13978
13979 def literal(node) -> str | None:
13980 # Token-level filter: rejects names containing shell metacharacters.
13981 # Combined with `is_inside_expansion` for parent-context rejection.
13982 raw = text(node).strip()
13983 if not raw:
13984 return None
13985 if raw[0:1] in {"'", '"'} and raw[-1:] == raw[0]:
13986 raw = raw[1:-1]
13987 if any(token in raw for token in ("$", "`", "$(", "<(", ">", "|", ";", "&")):
13988 return None
13989 return raw
13990
13991 def _bash_func_name(node) -> str | None:
13992 """Get the name from a function_definition node."""

Callers 3

_bash_func_nameFunction · 0.85
walk_callsFunction · 0.85
walkFunction · 0.85

Calls 1

textFunction · 0.85

Tested by

no test coverage detected