From 95645d17a26ea478a202b64ec2282bec284d7729 Mon Sep 17 00:00:00 2001 From: nisikimi Date: Fri, 29 Sep 2006 06:58:27 +0000 Subject: [PATCH] *** empty log message *** --- utils/ja_filter.rb | 60 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 24 deletions(-) diff --git a/utils/ja_filter.rb b/utils/ja_filter.rb index 1ddb6bc..e2f7ac1 100755 --- a/utils/ja_filter.rb +++ b/utils/ja_filter.rb @@ -2,6 +2,7 @@ buf = [] doxy = 0 +example = 0 def commentblock(buf) unless buf == [] @@ -22,29 +23,47 @@ while gets #make variables in function descriptions shown in bold gsub!(/\$[A-Z_]+/) {|m| m.delete!("$").reverse.downcase!.concat(" b@").reverse} + if example == 1 + case $_ + when /#endif/ + buf.push($_.gsub!(/#endif/, "@endcode")) + example = 0 + else + buf.push($_) + end + + else # when example == 0 + case $_ when /^\s*$/ - if doxy == 1 + if doxy == 1 # empty line in doxygen comment buf.push($_) end - when /\/\*=\*\// + when /\/\*=\*\// #/*=*/ (flush) commentblock(buf) buf = [] - when /^\/\*\s.*\*\// # /* comment */ type comment - if doxy == 1 - buf.push($_.gsub!(/\*\//, " ").gsub!(/\/\*/, "//")) # should be included only in the example code - end + when /^\/\*\s.*\*\// # /* comment */ type comment +# if doxy == 1 +# # 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 - buf.push($_.gsub!(/\*\//, " ").gsub!(/\/\*/, "//")) # should be included in the example code - else + 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 - end + commentblock(buf) + buf = [] + print $_.gsub!(/\/\*\s.*\*\//," ") # should be omiited in code +# end end when /\/\*{2,3}en.*\*\// #english one liner is omitted @@ -65,18 +84,10 @@ while gets doxy = 1 when /EXAMPLE_CODE/ + #start example code lines buf.push($_.gsub!(/#if EXAMPLE_CODE/, "\n \n @par Î㡧 \n @code")) - doxy = 1 + example = 1 - when /#endif/ - if doxy == 1 - buf.push($_.gsub!(/#endif/, "@endcode")) - else - commentblock(buf) - buf = [] - print $_ - end - doxy = 0 when /\*\// if doxy == 1 buf.push($_.gsub!(/\*\//, " ")) @@ -92,6 +103,7 @@ while gets buf = [] print($_) end + end end end -- 1.7.10.4