MCPcopy Index your code
hub / github.com/python/cpython / FunctionCall

Class FunctionCall

Tools/peg_generator/pegen/c_generator.py:89–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

87
88@dataclass
89class FunctionCall:
90 function: str
91 arguments: list[Any] = field(default_factory=list)
92 assigned_variable: str | None = None
93 assigned_variable_type: str | None = None
94 return_type: str | None = None
95 nodetype: NodeTypes | None = None
96 force_true: bool = False
97 comment: str | None = None
98
99 def __str__(self) -> str:
100 parts = []
101 parts.append(self.function)
102 if self.arguments:
103 parts.append(f"({', '.join(map(str, self.arguments))})")
104 if self.force_true:
105 parts.append(", !p->error_indicator")
106 if self.assigned_variable:
107 if self.assigned_variable_type:
108 parts = [
109 "(",
110 self.assigned_variable,
111 " = ",
112 "(",
113 self.assigned_variable_type,
114 ")",
115 *parts,
116 ")",
117 ]
118 else:
119 parts = ["(", self.assigned_variable, " = ", *parts, ")"]
120 if self.comment:
121 parts.append(f" // {self.comment}")
122 return "".join(parts)
123
124
125class CCallMakerVisitor(GrammarVisitor):

Callers 9

keyword_helperMethod · 0.85
soft_keyword_helperMethod · 0.85
visit_NameLeafMethod · 0.85
visit_StringLeafMethod · 0.85
lookahead_call_helperMethod · 0.85
visit_ForcedMethod · 0.85
visit_OptMethod · 0.85
visit_CutMethod · 0.85

Calls 1

fieldFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…