vhdlpp: Distinguish character and an array of bits during emission.

This commit is contained in:
Maciej Suminski 2015-12-07 16:14:22 +01:00
parent 1c4b1c12e4
commit 9886b8cb36
1 changed files with 5 additions and 6 deletions

View File

@ -453,17 +453,16 @@ int ExpCharacter::emit_primitive_bit_(ostream&out, Entity*, ScopeBase*,
int ExpCharacter::emit(ostream&out, Entity*ent, ScopeBase*scope)
{
const VType*etype = peek_type();
const VTypeArray*array;
if (etype != &primitive_CHARACTER && (array = dynamic_cast<const VTypeArray*>(etype))) {
etype = array->element_type();
}
if (const VTypePrimitive*use_type = dynamic_cast<const VTypePrimitive*>(etype)) {
return emit_primitive_bit_(out, ent, scope, use_type);
}
if (const VTypeArray*array = dynamic_cast<const VTypeArray*>(etype)) {
if (const VTypePrimitive*use_type = dynamic_cast<const VTypePrimitive*>(array->element_type())) {
return emit_primitive_bit_(out, ent, scope, use_type);
}
}
out << "\"" << value_ << "\"";
return 0;
}