diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-06 03:01:52 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2010-04-06 03:01:52 +0000 |
commit | e41936441bf9fcab9fb4d8ceb70cc73d2a38c9c0 (patch) | |
tree | 079b00fe5c87f81371b67a62a59dadf5258229c9 /sample | |
parent | 2ff26f22209c5b260585fcac2383ae6c91aef766 (diff) | |
download | ruby-e41936441bf9fcab9fb4d8ceb70cc73d2a38c9c0.tar.gz |
Surpress warnings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@27235 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample')
-rw-r--r-- | sample/mkproto.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sample/mkproto.rb b/sample/mkproto.rb index 754ca2dff2..6e7fc0f788 100644 --- a/sample/mkproto.rb +++ b/sample/mkproto.rb @@ -1,20 +1,20 @@ $/ = nil while line = gets() - if /^((void|VALUE|int|char *\*|ID|struct [\w_]+ *\*|st_table *\*) *)?\n([\w\d_]+)\(.*\)\n\s*((.+;\n)*)\{/ =~ line + if /^((void|VALUE|int|char *\*|ID|struct \w+ *\*|st_table *\*) *)?\n(\w+)\(.*\)\n\s*((.+;\n)*)\{/ =~ line line = $' printf "%s %s(", $2, $3 args = [] for arg in $4.split(/;\n\s*/) arg.gsub!(/ +/, ' ') if arg =~ /,/ - if arg =~ /(([^*]+) *\** *[\w\d_]+),/ + if arg =~ /(([^*]+) *\** *\w+),/ type = $2.strip args.push $1.strip arg = $' else type = "" end - while arg.sub!(/(\** *[\w\d_]+)(,|$)/, "") && $~ + while arg.sub!(/(\** *\w+)(,|$)/, "") && $~ args.push type + " " + $1.strip end else |