1.1 --- a/micropython/common.py Sun Jul 11 02:05:41 2010 +0200
1.2 +++ b/micropython/common.py Sat Aug 07 02:06:15 2010 +0200
1.3 @@ -47,6 +47,15 @@
1.4 exc.unit_name = self.full_name()
1.5 raise
1.6
1.7 +def used_by_unit(node):
1.8 +
1.9 + """
1.10 + Return whether the definition made by a 'node' is actually employed by the
1.11 + program unit within which it is found.
1.12 + """
1.13 +
1.14 + return node.unit.parent.has_key(node.unit.name)
1.15 +
1.16 # Errors.
1.17
1.18 class ProcessingError(Exception):