ref: refs/heads/master
commit bac1883297f088e5e274b0d5cdd9880820159252
Author: Klaus Kämpf
Date: Thu Mar 26 16:21:29 2009 +0100
remove %{...%} 'C' inserts in order to prevent picking up definitions
inside
---
bindings/ruby/parse_swig.rb | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/bindings/ruby/parse_swig.rb b/bindings/ruby/parse_swig.rb
index e6421f6..65d3c69 100644
--- a/bindings/ruby/parse_swig.rb
+++ b/bindings/ruby/parse_swig.rb
@@ -325,11 +325,11 @@ module RDoc
meth_name = renames[meth_name] || meth_name
handle_method(type, class_name||@@module_name, meth_name, nil, (args.split(",")||[]).size, orig_name)
end
- body.scan(%r{((const\s+)?\w+)([^~/\w]+)(\w+)\s*\(([^\)]*)\)\s*\{}m) do
+ body.scan(%r{((const\s+)?[^#\W]+)([^~/\w]+)(\w+)\s*\(([^\)]*)\)\s*\{}m) do
|const,type,pointer,meth_name,args|
next unless meth_name
type = "string" if type =~ /char/ && pointer =~ /\*/
- puts "-> const #{const}:type #{type}:pointer #{pointer}:name #{meth_name} (args #{args} )\n#{$&}\n\n" if meth_name == "_WsXmlDoc"
+ puts "-> const #{const}:type #{type}:pointer #{pointer}:name #{meth_name} (args #{args} )\n#{$&}\n\n" if meth_name == "if"
meth_name = orig_name = meth_name.to_s
meth_name = renames[meth_name] || meth_name
handle_method(type, class_name, meth_name, nil, (args.split(",")||[]).size, orig_name)
@@ -647,6 +647,12 @@ module RDoc
# Removes #ifdefs that would otherwise confuse us
def handle_ifdefs_in(body)
+ # remove all %{...%}
+ while body =~ /^%\{/
+ before = $` # keep whats before %{
+ $' =~ /^%\}/ # scan the rest for %} '
+ body = before + $' # keep whats after %} '
+ end
body.gsub(/^#ifdef HAVE_PROTOTYPES.*?#else.*?\n(.*?)#endif.*?\n/m) { $1 }
end
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org