1.1 --- a/common.py Tue Dec 13 19:19:23 2016 +0100
1.2 +++ b/common.py Tue Dec 13 22:46:52 2016 +0100
1.3 @@ -160,13 +160,16 @@
1.4
1.5 # Constant reference naming.
1.6
1.7 - def get_constant_name(self, value):
1.8 + def get_constant_name(self, value, value_type):
1.9
1.10 - "Add a new constant to the current namespace for 'value'."
1.11 + """
1.12 + Add a new constant to the current namespace for 'value' with
1.13 + 'value_type'.
1.14 + """
1.15
1.16 path = self.get_namespace_path()
1.17 init_item(self.constants, path, dict)
1.18 - return "$c%d" % add_counter_item(self.constants[path], value)
1.19 + return "$c%d" % add_counter_item(self.constants[path], (value, value_type))
1.20
1.21 # Literal reference naming.
1.22
1.23 @@ -230,7 +233,7 @@
1.24
1.25 "Return a constant reference for the given 'ref' type and 'value'."
1.26
1.27 - constant_name = self.get_constant_name(value)
1.28 + constant_name = self.get_constant_name(value, ref.get_origin())
1.29
1.30 # Return a reference for the constant.
1.31
1.32 @@ -249,7 +252,7 @@
1.33 type with the given 'origin'.
1.34 """
1.35
1.36 - constant_name = self.get_constant_name(value)
1.37 + constant_name = self.get_constant_name(value, origin)
1.38 objpath = self.get_object_path(constant_name)
1.39 self._reserve_constant(objpath, value, origin)
1.40