From 6800f459f5f2161c6e7528fa12565efd19a4d49c Mon Sep 17 00:00:00 2001 From: jj Date: Fri, 27 Apr 2012 17:24:15 +0200 Subject: [PATCH] ruby: fix bitfield looking for enum value --- plugins/ruby/codegen.pl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/ruby/codegen.pl b/plugins/ruby/codegen.pl index 7165e57bb..4add74ddd 100755 --- a/plugins/ruby/codegen.pl +++ b/plugins/ruby/codegen.pl @@ -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]/);