MCPcopy Create free account
hub / github.com/scottrogowski/code2flow / Variable

Class Variable

code2flow/model.py:147–175  ·  view source on GitHub ↗

Variables represent named tokens that are accessible to their scope. They may either point to a string or, once resolved, a Group/Node. Not all variables can be resolved

Source from the content-addressed store, hash-verified

145
146
147class Variable():
148 """
149 Variables represent named tokens that are accessible to their scope.
150 They may either point to a string or, once resolved, a Group/Node.
151 Not all variables can be resolved
152 """
153 def __init__(self, token, points_to, line_number=None):
154 """
155 :param str token:
156 :param str|Call|Node|Group points_to: (str/Call is eventually resolved to Nodes|Groups)
157 :param int|None line_number:
158 """
159 assert token
160 assert points_to
161 self.token = token
162 self.points_to = points_to
163 self.line_number = line_number
164
165 def __repr__(self):
166 return f"<Variable token={self.token} points_to={repr(self.points_to)}"
167
168 def to_string(self):
169 """
170 For logging
171 :rtype: str
172 """
173 if self.points_to and isinstance(self.points_to, (Group, Node)):
174 return f'{self.token}->{self.points_to.token}'
175 return f'{self.token}->{self.points_to}'
176
177
178class Call():

Callers 13

process_assignFunction · 0.85
make_local_variablesFunction · 0.85
make_class_groupMethod · 0.85
process_assignFunction · 0.85
process_importFunction · 0.85
make_local_variablesFunction · 0.85
process_assignFunction · 0.85
make_local_variablesFunction · 0.85
process_assignFunction · 0.85
make_local_variablesFunction · 0.85
make_class_groupMethod · 0.85
map_itFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected