1.1 --- a/simplify/simplified/program.py Mon May 28 00:51:46 2007 +0200
1.2 +++ b/simplify/simplified/program.py Mon May 28 02:18:09 2007 +0200
1.3 @@ -25,6 +25,7 @@
1.4
1.5 from simplify.simplified.utils import Structure, WithName, name
1.6 import sys
1.7 +import operator
1.8
1.9 # Simplified program nodes.
1.10
1.11 @@ -92,6 +93,7 @@
1.12 # Annotations.
1.13
1.14 self.types = set()
1.15 + self.annotated = 0
1.16
1.17 def __repr__(self):
1.18
1.19 @@ -212,6 +214,15 @@
1.20
1.21 return self.copies.values() or [self]
1.22
1.23 + def is_annotated(self):
1.24 +
1.25 + """
1.26 + Return whether active copies of this node (or this node itself) is
1.27 + annotated.
1.28 + """
1.29 +
1.30 + return reduce(operator.or_, [n.annotated for n in self.active()])
1.31 +
1.32 # Node manipulation functions.
1.33
1.34 def copy(self, instance=None, new_name=None):