Skip to content

[cfg] We don't visit functions in while loops #133

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
KevinHock opened this issue Jun 24, 2018 · 3 comments · Fixed by #186
Closed

[cfg] We don't visit functions in while loops #133

KevinHock opened this issue Jun 24, 2018 · 3 comments · Fixed by #186

Comments

@KevinHock
Copy link
Collaborator

You can see we do it for for loops and not while loops

pyt/pyt/cfg/stmt_visitor.py

Lines 513 to 529 in 346a2d3

if isinstance(node.iter, ast.Call) and get_call_names_as_string(node.iter.func) in self.function_names:
last_node = self.visit(node.iter)
last_node.connect(for_node)
return self.loop_node_skeleton(for_node, node)
def visit_While(self, node):
label_visitor = LabelVisitor()
label_visitor.visit(node.test)
test = self.append_node(Node(
'while ' + label_visitor.result + ':',
node,
path=self.filenames[-1]
))
return self.loop_node_skeleton(test, node)

@KevinHock
Copy link
Collaborator Author

KevinHock commented Jun 30, 2018

I think reading the cfg readme is a good start on this

@KevinHock
Copy link
Collaborator Author

Hi @omergunal, would you like to take this one?

@omergunal
Copy link
Contributor

i would 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants