Rename Name.get_parent_stmt to Name.get_definition, because it's not always a statement. Also start using it in the NameFinder.

This commit is contained in:
Dave Halter
2014-09-06 10:43:26 +02:00
parent 99116cdcb7
commit f57d9ef675
5 changed files with 26 additions and 9 deletions
+2 -2
View File
@@ -85,7 +85,7 @@ class NameFinder(object):
if unicode(self.name_str) != name.get_code():
continue
stmt = name.parent
stmt = name.get_definition()
scope = stmt.parent
if scope in break_scopes:
continue
@@ -219,7 +219,7 @@ class NameFinder(object):
flow_scope = flow_scope.parent
for name in names:
typ = name.parent
typ = name.get_definition()
if typ.isinstance(pr.ForFlow):
types += self._handle_for_loops(typ)
elif isinstance(typ, pr.Param):