ruby: fix bitfield looking for enum value

develop
jj 2012-04-27 17:24:15 +02:00
parent fcfd7062eb
commit 6800f459f5
1 changed files with 3 additions and 1 deletions

@ -282,10 +282,12 @@ sub render_item_number {
my ($item, $pns) = @_;
my $subtype = $item->getAttribute('ld:subtype');
my $meta = $item->getAttribute('ld:meta');
my $initvalue = $item->getAttribute('init-value');
my $typename = $item->getAttribute('type-name');
undef $typename if ($meta and $meta eq 'bitfield-type');
$typename = rb_ucase($typename) if $typename;
$typename = $pns if (!$typename and $subtype eq 'enum'); # compound enum
$typename = $pns if (!$typename and $subtype and $subtype eq 'enum'); # compound enum
$initvalue = 1 if ($initvalue and $initvalue eq 'true');
$initvalue = ":$initvalue" if ($initvalue and $typename and $initvalue =~ /[a-zA-Z]/);