Skip to content

Commit

Permalink
Fixed grammar, no default label detection for wchar
Browse files Browse the repository at this point in the history
    * lib/ridl/node.rb:
    * lib/ridl/parser.rb:
    * lib/ridl/parser.ry:
  • Loading branch information
jwillemsen committed Jul 17, 2023
1 parent 74bd5ab commit 4a4e193
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions lib/ridl/node.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions lib/ridl/parser.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/ridl/parser.ry
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4a4e193

Please sign in to comment.