summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-07-26 07:47:50 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-07-26 07:47:50 +0000
commit52ecaae5b68384132da88f798c9282e64eca4e77 (patch)
tree0e2d1142ff980fb67af8168a54e1ecb10d97832d /sample
parentd365d1f568af2a0651959a9eb928435d3a733acb (diff)
* sample/mkproto.rb: ditto and fix bug.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2658 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'sample')
-rw-r--r--sample/mkproto.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/sample/mkproto.rb b/sample/mkproto.rb
index e1d49be3..754ca2d 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