diff options
author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-07-26 07:47:50 +0000 |
---|---|---|
committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2002-07-26 07:47:50 +0000 |
commit | 52ecaae5b68384132da88f798c9282e64eca4e77 (patch) | |
tree | 0e2d1142ff980fb67af8168a54e1ecb10d97832d | |
parent | d365d1f568af2a0651959a9eb928435d3a733acb (diff) | |
download | ruby-52ecaae5b68384132da88f798c9282e64eca4e77.tar.gz |
* sample/mkproto.rb: ditto and fix bug.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | sample/mkproto.rb | 4 |
2 files changed, 4 insertions, 2 deletions
@@ -2,6 +2,8 @@ Fri Jul 26 16:01:16 2002 WATANABE Hirofumi <eban@ruby-lang.org> * ext/extmk.rb.in (create_makefile): use Regexp in gsub. + * sample/mkproto.rb: ditto and fix bug. + Fri Jul 26 14:31:06 2002 Yukihiro Matsumoto <matz@ruby-lang.org> * random.c: replace with Mersenne Twister RNG. diff --git a/sample/mkproto.rb b/sample/mkproto.rb index e1d49be3e3..754ca2dff2 100644 --- a/sample/mkproto.rb +++ b/sample/mkproto.rb @@ -1,11 +1,11 @@ $/ = nil while line = gets() if /^((void|VALUE|int|char *\*|ID|struct [\w_]+ *\*|st_table *\*) *)?\n([\w\d_]+)\(.*\)\n\s*((.+;\n)*)\{/ =~ line - $_ = $' + line = $' printf "%s %s(", $2, $3 args = [] for arg in $4.split(/;\n\s*/) - arg.gsub! ' +', ' ' + arg.gsub!(/ +/, ' ') if arg =~ /,/ if arg =~ /(([^*]+) *\** *[\w\d_]+),/ type = $2.strip |