[pypy-svn] r28849 - pypy/dist/pypy/translator/cli
antocuni at codespeak.net
antocuni at codespeak.net
Thu Jun 15 23:45:17 CEST 2006
Author: antocuni
Date: Thu Jun 15 23:45:11 2006
New Revision: 28849
Modified:
pypy/dist/pypy/translator/cli/record.py
Log:
bugfix
Modified: pypy/dist/pypy/translator/cli/record.py
==============================================================================
--- pypy/dist/pypy/translator/cli/record.py (original)
+++ pypy/dist/pypy/translator/cli/record.py Thu Jun 15 23:45:11 2006
@@ -11,9 +11,12 @@
trans = string.maketrans('<>(), :', '_______')
name = ['Record']
+ # XXX: refactor this: we need a proper way to ensure unique names
for f_name, (FIELD_TYPE, f_default) in record._fields.iteritems():
type_name = FIELD_TYPE._short_name().translate(trans)
+ name.append(f_name)
name.append(type_name)
+
self.name = '__'.join(name)
assert ':' not in self.name
record._name = self.name
@@ -38,6 +41,7 @@
ilasm.begin_class(self.name, self.get_base_class())
for f_name, (FIELD_TYPE, f_default) in self.record._fields.iteritems():
+ f_name = self.cts.escape_name(f_name)
cts_type = self.cts.lltype_to_cts(FIELD_TYPE)
if cts_type != 'void':
ilasm.field(f_name, cts_type)
More information about the Pypy-commit
mailing list