1.1 --- a/micropython/data.py Mon Jun 01 21:10:47 2009 +0200
1.2 +++ b/micropython/data.py Mon Jun 01 23:06:55 2009 +0200
1.3 @@ -274,11 +274,14 @@
1.4 # Number of assignments per name.
1.5
1.6 self.assignments = None
1.7 + self.referenced = 0
1.8
1.9 def set_referenced(self):
1.10
1.11 "Indicate that the contents are referenced via a namespace."
1.12
1.13 + self.referenced = 1
1.14 +
1.15 for value in self.get_values():
1.16 if value is not None:
1.17 value.set_referenced()
1.18 @@ -317,6 +320,13 @@
1.19 else:
1.20 self.assignments += AtLeast(1)
1.21
1.22 + # Communicate referencing information.
1.23 +
1.24 + if self.referenced:
1.25 + for context, value in context_values:
1.26 + if value is not None:
1.27 + value.set_referenced()
1.28 +
1.29 self.context_values.update(context_values)
1.30
1.31 def is_class_attribute(self):
1.32 @@ -787,6 +797,8 @@
1.33
1.34 if instattr.has_key(name):
1.35 instattr[name].add(attr.position)
1.36 + else:
1.37 + instattr[name] = set([attr.position])
1.38
1.39 # Build the dictionary of attributes using the existing positions known
1.40 # for each name.