X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=utils%2Fusr_filter.rb;h=05e3fe87cb4c7422bd4acede33e2c40e5b0837b6;hb=b78b03921ee05eeb6b68c0daaf5d3af45c03cea9;hp=b09f7fb397afab7d5a8cb18f5f253f2c54126ebb;hpb=498e1235ee98882fc70c54cde00840ea22117d13;p=m17n%2Fm17n-docs.git diff --git a/utils/usr_filter.rb b/utils/usr_filter.rb index b09f7fb..05e3fe8 100755 --- a/utils/usr_filter.rb +++ b/utils/usr_filter.rb @@ -23,17 +23,22 @@ while gets gsub!(/\$[A-Z_]+/) {|m| m.delete!("$").reverse.downcase!.concat(" b@").reverse} case $_ - when /^$/ + when /^\s*$/ 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,6 +46,7 @@ while gets 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 @@ -49,7 +55,7 @@ while gets when /\/\*\*\*\s.*\*\// #one liner buf.push($_.gsub!(/\/\*+/, " ").gsub!(/\*\//, " ")).push("\n") - when /\/\*{1,2}\s|\/\*{2,3}ja|\/\*\*en/ + when /\/\*{1,2}\s|\/\*{2,3}ja|\/\*\*en/ #this is not for En nor users doxy = -1 when /\/\*\*\*en/ buf.push($_.gsub!(/\/\*+en/, " ")) @@ -59,7 +65,7 @@ while gets doxy = 1 when /EXAMPLE_CODE/ - buf.push($_.gsub!(/#if EXAMPLE_CODE/, "@code \n")) + buf.push($_.gsub!(/#if EXAMPLE_CODE/, "\n \n @par Example:\n @code")) doxy = 1 when /#endif/ @@ -88,3 +94,5 @@ while gets end end end + +commentblock(buf)