1.1 --- a/micropython/branch.py Fri Oct 25 19:41:48 2013 +0200
1.2 +++ b/micropython/branch.py Sat Oct 26 01:04:48 2013 +0200
1.3 @@ -1,7 +1,7 @@
1.4 #!/usr/bin/env python
1.5
1.6 """
1.7 -Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012 Paul Boddie <paul@boddie.org.uk>
1.8 +Copyright (C) 2007, 2008, 2009, 2010, 2011, 2012, 2013 Paul Boddie <paul@boddie.org.uk>
1.9
1.10 This program is free software; you can redistribute it and/or modify it under
1.11 the terms of the GNU General Public License as published by the Free Software
1.12 @@ -328,7 +328,7 @@
1.13
1.14 return users[name]
1.15
1.16 - def _define_attribute_user(self, node):
1.17 + def _define_attribute_user(self, node, value):
1.18
1.19 """
1.20 Define 'node' as the user of attributes, indicating the point where the
1.21 @@ -336,11 +336,14 @@
1.22 """
1.23
1.24 name = node.name
1.25 - self._define_attribute_user_for_name(node, name)
1.26 + self._define_attribute_user_for_name(node, name, value)
1.27 +
1.28 + def _define_attribute_user_for_name(self, node, name, value=None):
1.29
1.30 - def _define_attribute_user_for_name(self, node, name):
1.31 -
1.32 - "Define 'node' as the user of attributes for the given 'name'."
1.33 + """
1.34 + Define 'node' as the user of attributes for the given 'name', having the
1.35 + specified 'value'.
1.36 + """
1.37
1.38 users = self.attribute_users[-1]
1.39
1.40 @@ -350,19 +353,26 @@
1.41
1.42 # Record the attribute combinations for the name.
1.43
1.44 - self._init_attribute_user_for_name(node, name)
1.45 + self._init_attribute_user_for_name(node, name, value)
1.46
1.47 # Remember this user.
1.48
1.49 self.all_attribute_users.add(node)
1.50
1.51 - def _init_attribute_user_for_name(self, node, name):
1.52 + def _init_attribute_user_for_name(self, node, name, value=None):
1.53
1.54 "Make sure that 'node' is initialised for 'name'."
1.55
1.56 self._init_attribute_user(node)
1.57 node._attrnames[name] = None
1.58
1.59 + # Assigned values for names.
1.60 +
1.61 + if value:
1.62 + if node._values is None:
1.63 + node._values = {}
1.64 + node._values[name] = value
1.65 +
1.66 def _init_attribute_user(self, node):
1.67
1.68 # Attribute usage for names.