From 659a7124c7069b3e01dd171f7290562f58f9e97a Mon Sep 17 00:00:00 2001 From: Dmitri Gribenko Date: Tue, 17 Jul 2012 18:35:14 +0000 Subject: [PATCH] CommentBriefParser: make \short should equivalent to \brief, per Doxygen manual. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160383 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/CommentBriefParser.cpp | 3 ++- test/Index/annotate-comments.cpp | 17 ++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/AST/CommentBriefParser.cpp b/lib/AST/CommentBriefParser.cpp index bc9244a693..687ece2194 100644 --- a/lib/AST/CommentBriefParser.cpp +++ b/lib/AST/CommentBriefParser.cpp @@ -43,6 +43,7 @@ void cleanupBrief(std::string &S) { bool isBlockCommand(StringRef Name) { return llvm::StringSwitch(Name) .Case("brief", true) + .Case("short", true) .Case("result", true) .Case("return", true) .Case("returns", true) @@ -71,7 +72,7 @@ std::string BriefParser::Parse() { if (Tok.is(tok::command)) { StringRef Name = Tok.getCommandName(); - if (Name == "brief") { + if (Name == "brief" || Name == "short") { Paragraph.clear(); InBrief = true; ConsumeToken(); diff --git a/test/Index/annotate-comments.cpp b/test/Index/annotate-comments.cpp index 18dab24618..406e743f87 100644 --- a/test/Index/annotate-comments.cpp +++ b/test/Index/annotate-comments.cpp @@ -194,14 +194,24 @@ void isdoxy44(void); /// Ggg. IS_DOXYGEN_END void isdoxy45(void); +/// IS_DOXYGEN_START Aaa bbb +/// ccc. +/// +/// \short +/// Ddd eee. +/// Fff. +/// +/// Ggg. IS_DOXYGEN_END +void isdoxy46(void); + /// IS_DOXYGEN_NOT_ATTACHED #define FOO -void notdoxy46(void); +void notdoxy47(void); /// IS_DOXYGEN_START Aaa bbb /// \param ccc /// \returns ddd IS_DOXYGEN_END -void isdoxy47(int); +void isdoxy48(int); #endif @@ -267,5 +277,6 @@ void isdoxy47(int); // CHECK: annotate-comments.cpp:185:6: FunctionDecl=isdoxy44:{{.*}} BriefComment=[IS_DOXYGEN_START Aaa bbb ccc.] // CHECK: annotate-comments.cpp:195:6: FunctionDecl=isdoxy45:{{.*}} BriefComment=[Ddd eee. Fff.] -// CHECK: annotate-comments.cpp:204:6: FunctionDecl=isdoxy47:{{.*}} BriefComment=[IS_DOXYGEN_START Aaa bbb] +// CHECK: annotate-comments.cpp:205:6: FunctionDecl=isdoxy46:{{.*}} BriefComment=[Ddd eee. Fff.] +// CHECK: annotate-comments.cpp:214:6: FunctionDecl=isdoxy48:{{.*}} BriefComment=[IS_DOXYGEN_START Aaa bbb] -- 2.40.0