X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=utils%2Fja_filter.rb;h=1ddb6bcb6ca00629ee14198f51c1ec4d5834ef01;hb=583ade0ba211aac29e11d712f6c2f9f1e813efc4;hp=342894967d31739d77b95ae1c52c7b85ca1bf0e5;hpb=dfec347c2d2c2a2bed2a8f008cc42137e5e90d2f;p=m17n%2Fm17n-docs.git diff --git a/utils/ja_filter.rb b/utils/ja_filter.rb index 3428949..1ddb6bc 100755 --- a/utils/ja_filter.rb +++ b/utils/ja_filter.rb @@ -27,13 +27,18 @@ 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 + end + + when /\/\*\s.*\*\// # code + /* comment */ type comment + if doxy == 1 + buf.push($_.gsub!(/\*\//, " ").gsub!(/\/\*/, "//")) # should be included in the example code else if doxy == 0 commentblock(buf) @@ -41,10 +46,11 @@ while gets print $_.gsub!(/\/\*\s.*\*\//," ") # should be omiited in code end end + when /\/\*{2,3}en.*\*\// #english one liner is omitted when /\/\*\*ja.*\*\// #one liner when /\/\*\*\*ja.*\*\// #one liner - buf.push($_.gsub!(/\/\*+ja/, " ").gsub!(/\*\//, " ")) + buf.push($_.gsub!(/\/\*+ja/, " ").gsub!(/\*\//, " ")).push("\n") when /\/\*\*\s.*\*\// #one liner when /\/\*\*\*\s.*\*\// #one liner buf.push($_.gsub!(/\/\*+/, " ").gsub!(/\*\//, " ")).push("\n") @@ -93,4 +99,4 @@ commentblock(buf) # Local Variables: # coding: euc-jp -# End: \ No newline at end of file +# End: