diff --git a/lib/ridl/node.rb b/lib/ridl/node.rb index 1e1f5c1..4f488a5 100644 --- a/lib/ridl/node.rb +++ b/lib/ridl/node.rb @@ -2722,6 +2722,7 @@ def has_default? def default_label swtype = @switchtype.resolved_type + return nil if IDL::Type::WChar === swtype lbls = members.collect { |m| m.labels.include?(:default) ? [] : m.labels.collect { |l| l.value } }.flatten lbls = lbls.sort unless IDL::Type::Boolean === swtype ## work around bug in Ruby 1.9.2 def_lbl = swtype.min diff --git a/lib/ridl/parser.rb b/lib/ridl/parser.rb index 1400ac7..65af372 100644 --- a/lib/ridl/parser.rb +++ b/lib/ridl/parser.rb @@ -4044,13 +4044,13 @@ def _reduce_359(val, _values) module_eval(<<'.,.,', 'parser.ry', 665) def _reduce_365(val, _values) - if @idlversion < 4 then raise "union with octect discriminator type is only supported with IDL4 or newer" end + if @idlversion < 4 then raise "union with octect discriminator type is only supported with IDL4 or newer" else ::IDL::Type::Octet.new end end .,., module_eval(<<'.,.,', 'parser.ry', 666) def _reduce_366(val, _values) - if @idlversion < 4 then raise "union with octect discriminator type is only supported with IDL4 or newer" end + if @idlversion < 4 then raise "union with octect discriminator type is only supported with IDL4 or newer" else ::IDL::Type::WChar.new end end .,., diff --git a/lib/ridl/parser.ry b/lib/ridl/parser.ry index 166f53c..602a207 100644 --- a/lib/ridl/parser.ry +++ b/lib/ridl/parser.ry @@ -663,8 +663,8 @@ rule | boolean_type | enum_type | scoped_name - | octet_type { if @idlversion < 4 then raise "union with octect discriminator type is only supported with IDL4 or newer" end } - | wide_char_type { if @idlversion < 4 then raise "union with octect discriminator type is only supported with IDL4 or newer" end } + | octet_type { if @idlversion < 4 then raise "union with octect discriminator type is only supported with IDL4 or newer" else ::IDL::Type::Octet.new end } + | wide_char_type { if @idlversion < 4 then raise "union with octect discriminator type is only supported with IDL4 or newer" else ::IDL::Type::WChar.new end } union_body : union_case | union_body union_case