Fix up the broken vtypes conversion by translating between the names.

This commit is contained in:
Mike Auty
2016-10-26 01:16:07 +01:00
parent 0b447b6958
commit 5f0ceff4d2
+9 -1
View File
@@ -67,7 +67,7 @@ class VTypeSymbolTable(interfaces.symbols.SymbolTableInterface):
if not dictionary:
raise exceptions.SymbolSpaceError("Invalid vtype dictionary: " + repr(dictionary))
type_name = dictionary[0]
type_name = self._translate_vtype_to_intermed(dictionary[0])
if type_name in self.natives.types:
# The symbol is a native type
@@ -95,6 +95,14 @@ class VTypeSymbolTable(interfaces.symbols.SymbolTableInterface):
return objects.templates.ReferenceTemplate(type_name = self.name + constants.BANG + type_name)
def _translate_vtype_to_intermed(self, name):
"""Allows backwards compatibility by converting vtype identifiers to intermediate format identifiers"""
if name == 'Enumeration':
return 'enum'
elif name in ['BitField', 'String', 'Bytes']:
return name.lower()
return name
@property
def types(self):
"""Returns an iterator of the symbol names"""