diff options
author | Dmitri Gribenko <gribozavr@gmail.com> | 2012-08-09 18:20:29 +0000 |
---|---|---|
committer | Dmitri Gribenko <gribozavr@gmail.com> | 2012-08-09 18:20:29 +0000 |
commit | 62290ae569016345b79d4e11dd93abc300e5a681 (patch) | |
tree | 40a7a61eb963f4be2c9ecd46898148d160cb7239 /lib/AST/CommentCommandTraits.cpp | |
parent | 42ee64be35cfa9f2418033df8f80beda61da6caf (diff) |
Comment to HTML and XML conversion: ignore commands that contain a declaration
as their argument. For example, \fn, \function, \typedef, \method, \class etc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@161601 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/CommentCommandTraits.cpp')
-rw-r--r-- | lib/AST/CommentCommandTraits.cpp | 40 |
1 files changed, 32 insertions, 8 deletions
diff --git a/lib/AST/CommentCommandTraits.cpp b/lib/AST/CommentCommandTraits.cpp index 804f2ae612..d8ce1f3fe7 100644 --- a/lib/AST/CommentCommandTraits.cpp +++ b/lib/AST/CommentCommandTraits.cpp @@ -53,14 +53,7 @@ bool CommandTraits::isVerbatimBlockCommand(StringRef BeginName, } bool CommandTraits::isVerbatimLineCommand(StringRef Name) const { - bool Result = llvm::StringSwitch<bool>(Name) - .Case("fn", true) - .Case("var", true) - .Case("property", true) - .Case("typedef", true) - - .Case("overload", true) - + bool Result = isDeclarationCommand(Name) || llvm::StringSwitch<bool>(Name) .Case("defgroup", true) .Case("ingroup", true) .Case("addtogroup", true) @@ -91,6 +84,37 @@ bool CommandTraits::isVerbatimLineCommand(StringRef Name) const { return false; } +bool CommandTraits::isDeclarationCommand(StringRef Name) const { + return llvm::StringSwitch<bool>(Name) + // Doxygen commands. + .Case("fn", true) + .Case("var", true) + .Case("property", true) + .Case("typedef", true) + + .Case("overload", true) + + // HeaderDoc commands. + .Case("class", true) + .Case("interface", true) + .Case("protocol", true) + .Case("category", true) + .Case("template", true) + .Case("function", true) + .Case("method", true) + .Case("callback", true) + .Case("var", true) + .Case("const", true) + .Case("constant", true) + .Case("property", true) + .Case("struct", true) + .Case("union", true) + .Case("typedef", true) + .Case("enum", true) + + .Default(false); +} + void CommandTraits::addVerbatimBlockCommand(StringRef BeginName, StringRef EndName) { VerbatimBlockCommand VBC; |