2008-12-22 08:19:08 -05:00
|
|
|
#!ruby
|
|
|
|
|
2013-12-05 08:02:48 -05:00
|
|
|
ARGF.binmode
|
2008-12-22 08:19:08 -05:00
|
|
|
source = ARGF.read
|
2011-05-15 07:55:52 -04:00
|
|
|
source = source.gsub(%r{/\*([!*])((?!\*/).+?)\*/}m) do |comment|
|
2009-06-29 12:39:14 -04:00
|
|
|
marker, comment = $1, $2
|
2008-12-22 08:19:08 -05:00
|
|
|
next "/**#{comment}*/" unless /^\s*\*\s?\-\-\s*$/ =~ comment
|
|
|
|
doxybody = nil
|
|
|
|
comment.each_line do |line|
|
|
|
|
if doxybody
|
|
|
|
if /^\s*\*\s?\+\+\s*$/ =~ line
|
|
|
|
break
|
|
|
|
end
|
|
|
|
doxybody << line
|
|
|
|
else
|
|
|
|
if /^\s*\*\s?--\s*$/ =~ line
|
|
|
|
doxybody = "\n"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
2009-06-29 12:39:14 -04:00
|
|
|
"/*#{marker}#{doxybody}*/"
|
2008-12-22 08:19:08 -05:00
|
|
|
end
|
|
|
|
print source
|