1.1 --- a/modules.py Tue Dec 13 19:19:23 2016 +0100
1.2 +++ b/modules.py Tue Dec 13 22:46:52 2016 +0100
1.3 @@ -611,14 +611,15 @@
1.4 last_path = None
1.5 n = None
1.6 while line:
1.7 - path, constant = self._get_fields(line)
1.8 + path, value_type, value = self._get_fields(line, 3)
1.9 if path != last_path:
1.10 n = 0
1.11 last_path = path
1.12 else:
1.13 n += 1
1.14 init_item(self.constants, path, dict)
1.15 - self.constants[path][eval(constant)] = n
1.16 + value = eval(value)
1.17 + self.constants[path][(value, value_type)] = n
1.18 line = f.readline().rstrip()
1.19
1.20 def _get_constant_values(self, f):
1.21 @@ -756,7 +757,7 @@
1.22 "attribute access modifiers:"
1.23 zero or more: qualified function name " " local/global variable name " " attribute name " " access modifiers
1.24 "constant literals:"
1.25 - zero or more: qualified scope name " " constant literal
1.26 + zero or more: qualified scope name " " value type " " constant literal
1.27 "constant values:"
1.28 zero or more: qualified name " " value type " " constant literal
1.29
1.30 @@ -973,10 +974,12 @@
1.31 paths = self.constants.keys()
1.32 paths.sort()
1.33 for path in paths:
1.34 - constants = [(v, k) for (k, v) in self.constants[path].items()]
1.35 + constants = []
1.36 + for (value, value_type), n in self.constants[path].items():
1.37 + constants.append((n, value_type, value))
1.38 constants.sort()
1.39 - for n, constant in constants:
1.40 - print >>f, path, repr(constant)
1.41 + for n, value_type, value in constants:
1.42 + print >>f, path, value_type, repr(value)
1.43
1.44 print >>f
1.45 print >>f, "constant values:"