-
Notifications
You must be signed in to change notification settings - Fork 17
Open
Description
require 'cast'
s = <<-EOS
struct foo {
unsigned :4;
};
EOS
ast = C.parse(s)
ast.to_syields
TypeError: can't dup NilClass
from .../ruby/gems/2.0.0/gems/cast-0.2.1/lib/cast/to_s.rb:48:in `dup'
...
proposed patch:
--- to_s.rb.orig 2037-08-09 14:29:46.000000000 +0200
+++ to_s.rb 2014-08-07 11:49:11.705897200 +0200
@@ -45,7 +45,7 @@
end
class Declarator
def to_s
- (indirect_type ? indirect_type.to_s(name) : name.dup) <<
+ (indirect_type ? indirect_type.to_s(name) : (name || '').dup) <<
(init ? " = #{init}" : '') <<
(num_bits ? " : #{num_bits}" : '')
endAnd a big "Thank you!" for cast.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels