diff options
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 |