You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This patch walks up the parse tree from a Variable to find the containing
module, rather than assuming all Variables are two levels below the module,
which breaks for module-level variables.
diff -r c5b88e996b11 -r 732d6b540026 fparser/base_classes.py
--- a/fparser/base_classes.py Fri Jan 27 14:26:10 2012 +0000
+++ b/fparser/base_classes.py Fri Jan 27 14:29:58 2012 +0000
@@ -282,7 +282,11 @@
def is_private(self):
if 'PUBLIC' in self.attributes: return False
if 'PRIVATE' in self.attributes: return True
- return self.parent.parent.check_private(self.name)
+
+ mod = self.parent
+ while not hasattr(mod, 'check_private'):
+ mod = mod.parent
+ return mod.check_private(self.name)
def is_public(self): return not self.is_private()
def is_allocatable(self): return 'ALLOCATABLE' in self.attributes
Original issue reported on code.google.com by [email protected] on 27 Jan 2012 at 2:43
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 27 Jan 2012 at 2:43The text was updated successfully, but these errors were encountered: