Commit e293b5f4 by Jim Stichnoth

Subzero: Improve the Doxygen input filter for TODO extraction.

The previous filter was too aggressive at changing "//" to "///". The new filter does that transformation more selectively, starting at a commented TODO line and ending at the next non-commented line. BUG= none Review URL: https://codereview.chromium.org/1510893004 .
parent 67574d83
...@@ -849,15 +849,16 @@ IMAGE_PATH = ...@@ -849,15 +849,16 @@ IMAGE_PATH =
# or removed, the anchors will not be placed correctly. # or removed, the anchors will not be placed correctly.
# This script transforms TODO strings into a @todo form. It also transforms # This script transforms TODO strings into a @todo form. It also transforms
# "//" into "///" (but only when there are exactly 2 '/' characters in a row). # "//" comments into doxygen "///" comments on every line, starting from a line
# The first pattern matches "//" at the beginning of the line, and the second # containing a commented TODO, and ending at the next line without a comment.
# pattern matches a mid-line "//". The third pattern matches "TODO " or
# "TODO(owner)" or "TODO:". This should cover the usual TODO patterns, while INPUT_FILTER = "awk ' \
# not falsely matching e.g. a call to a function whose name ends in "TODO". { HasComment = /\/\//; HasTripleSlash = /\/\/\//; HasTodo = / TODO[ (:]/; } \
HasComment && HasTodo { InTodoBlock = 1; } \
INPUT_FILTER = "sed -e 's?^//\([^/]\)?///\1?' \ !HasComment { InTodoBlock = 0; } \
-e 's?\([^/]\)//\([^/]\)?\1///\2?' \ InTodoBlock && !HasTripleSlash { sub(\"//\", \"///\"); } \
-e 's/ \(TODO[ (:]\)/ @todo \1/g'" InTodoBlock { $0 = gensub(/ (TODO[ (:])/, \" @todo \\1\", \"g\", $0); } \
{ print; }'"
# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
# basis. Doxygen will compare the file name with each pattern and apply the # basis. Doxygen will compare the file name with each pattern and apply the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment