X-Git-Url: http://git.chise.org/gitweb/?p=m17n%2Fm17n-docs.git;a=blobdiff_plain;f=utils%2Fusr_filter.rb;h=10d409444671e49d38360d1e691ab8b68daf267c;hp=c7762200815a339616d5e28dcd715488263d5fad;hb=89a6b4b18c3ad9e305bd42c1f121bbcff668ba40;hpb=858c5303e612cd82c6aa2b8e29f143ef9a0eea64 diff --git a/utils/usr_filter.rb b/utils/usr_filter.rb index c776220..10d4094 100755 --- a/utils/usr_filter.rb +++ b/utils/usr_filter.rb @@ -13,8 +13,6 @@ def commentblock(buf) while gets -# print "****", $_, "\n" - gsub!("@seealso", "@par See Also:") gsub!("@errors", "@par Errors:") gsub!("@returns", "@par Return value:") @@ -29,20 +27,33 @@ while gets if doxy == 1 buf.push($_) end - when /\/\/\/\// + when /\/\*=\*\// commentblock(buf) buf = [] - when /\/\*\s.*\*\// # /* comment */ type comment + when /^\/\*\s.*\*\// # /* comment */ type comment if doxy == 1 - buf.push($_.gsub!(/\*\//, " ").gsub!(/\/\*/, "//")) # should be included only in the example code + # should be included only in the example code + ## We used to do the following substituion as a workaround of + ## a Doxygen bug. + ## buf.push($_.gsub!(/\*\//, " ").gsub!(/\/\*/, "//")) + buf.push($_) + end + + when /\/\*\s.*\*\// # code + /* comment */ type comment + if doxy == 1 + # should be included in the example code + ## See the above comment. + ## buf.push($_.gsub!(/\*\//, " ").gsub!(/\/\*/, "//")) + buf.push($_) # should be included in the example code else if doxy == 0 - commentblock(buf) - buf = [] - print $_.gsub!(/\/\*\s.*\*\//," ") # should be omiited in code + commentblock(buf) + buf = [] + print $_.gsub!(/\/\*\s.*\*\//," ") # should be omiited in code end end + when /\/\*{2,3}ja.*\*\// #japanese one liner when /\/\*\*en.*\*\// #one liner when /\/\*\*\*en.*\*\// #one liner