summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-01-04 16:57:32 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2013-01-04 16:57:32 +0100
commite56d5f280463e5ef6775b4b6d1414809f0e9de36 (patch)
treeb15d5cdeb831aebabdfdc6f5a52fd8891e3fcb16
parentab0f0e47c22fd07eed0574b405a7639efa2c977d (diff)
downloadffi-efl-e56d5f280463e5ef6775b4b6d1414809f0e9de36.zip
ffi-efl-e56d5f280463e5ef6775b4b6d1414809f0e9de36.tar.gz
genruby: accept one word parameter
-rwxr-xr-xtools/genruby.rb8
1 files changed, 3 insertions, 5 deletions
diff --git a/tools/genruby.rb b/tools/genruby.rb
index eefe0d2..fe17174 100755
--- a/tools/genruby.rb
+++ b/tools/genruby.rb
@@ -42,11 +42,9 @@ def get_type_from_arg arg, l
if arg =~ /\.\.\./
return ':varargs'
end
- k = arg.gsub(/const/,'').gsub(/\s{2,}/,' ').strip
- if k=~/(.*?)(\w+)$/
- return get_type $1.strip
- end
- # try with unchanged argument string
+ k = arg.gsub(/const/,'').sub(/^\s+/,'').gsub(/\s{2,}/,' ').strip
+ k=~/(.*?)(\w+)$/ # remove var name if any
+ k = $1.strip if not $1.nil? and $1.length > 0
t = get_type k
if t.nil?
printf "\033[0;31mwrong arg >#{k}< #{arg} (#{l})\033[0m\n"