2008-12-22 16:19:08 +03:00
|
|
|
#!ruby
|
|
|
|
|
2013-12-05 17:02:48 +04:00
|
|
|
ARGF.binmode
|
2008-12-22 16:19:08 +03:00
|
|
|
source = ARGF.read
|
2011-05-15 15:55:52 +04:00
|
|
|
source = source.gsub(%r{/\*([!*])((?!\*/).+?)\*/}m) do |comment|
|
2009-06-29 20:39:14 +04:00
|
|
|
marker, comment = $1, $2
|
2008-12-22 16:19:08 +03: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 20:39:14 +04:00
|
|
|
"/*#{marker}#{doxybody}*/"
|
2008-12-22 16:19:08 +03:00
|
|
|
end
|
|
|
|
print source
|