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 | 63be5c38161df4d16de1e3fb3a42a923ab67d7da (patch) | |
| tree | 0e2d1142ff980fb67af8168a54e1ecb10d97832d | |
| parent | 7ce60f5dd61a8d030c52b62b4c82eef17eb77eb4 (diff) | |
| download | ruby-63be5c38161df4d16de1e3fb3a42a923ab67d7da.tar.gz ruby-63be5c38161df4d16de1e3fb3a42a923ab67d7da.tar.xz ruby-63be5c38161df4d16de1e3fb3a42a923ab67d7da.zip | |
* sample/mkproto.rb: ditto and fix bug.
git-svn-id: http://svn.ruby-lang.org/repos/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 e1d49be3e..754ca2dff 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 |
