ref: refs/heads/master
commit 15292287c7bdb44266d0f7b3775295fe9f601d95
Author: Klaus Kämpf
Date: Mon Mar 30 15:31:24 2009 +0200
Be more liberal when scanning %extend
The name behind %extend can be the original struct name or the
typedef'd name, let the rdoc parser allow both.
---
bindings/ruby/parse_swig.rb | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/bindings/ruby/parse_swig.rb b/bindings/ruby/parse_swig.rb
index 8633c88..3ecc344 100644
--- a/bindings/ruby/parse_swig.rb
+++ b/bindings/ruby/parse_swig.rb
@@ -243,21 +243,21 @@ module RDoc
# puts "extend #{extend_name}, class #{class_name}, struct #{struct_name}"
# find the corresponding '%extend' directive
- @body.scan(/^%extend\s+#{extend_name}\s*\{(.*)\}/mx) do |content|
+ @body.scan(/^%extend\s+(#{extend_name}|#{struct_name})\s*\{(.*)\}/mx) do |name,content|
# now check if we have multiple %extend, the regexp above is greedy and will match all of them
while content.to_s =~ /^%extend/
content = $` # discard %extend and everything behind
end
- extends[extend_name] = true
+ extends[name] = true
cn = class_name.to_s
cn.capitalize! unless cn[0,1] =~ /[A-Z_]/
- swig_class = handle_class_module("class", cn, :parent => "rb_cObject", :content => content.to_s, :extend_name => extend_name)
+ swig_class = handle_class_module("class", cn, :parent => "rb_cObject", :content => content.to_s, :extend_name => name)
end
end
@body.scan(/^%extend\s*(\w+)\s*\{(.*)\}/mx) do |class_name,content|
cn = class_name.to_s
unless extends[cn]
- puts "Class #{cn}"
+# puts "Class #{cn}"
cn.capitalize! unless cn[0,1] =~ /[A-Z_]/
swig_class = handle_class_module("class", cn, :parent => "rb_cObject", :content => content)
extends[cn] = true
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org