std::string Paragraph;
bool InFirstParagraph = true;
bool InBrief = false;
- bool BriefDone = false;
while (Tok.isNot(tok::eof)) {
if (Tok.is(tok::text)) {
continue;
}
- if (!BriefDone && Tok.is(tok::command) && Tok.getCommandName() == "brief") {
- Paragraph.clear();
- InBrief = true;
- ConsumeToken();
- continue;
+ if (Tok.is(tok::command)) {
+ StringRef Name = Tok.getCommandName();
+ if (Name == "brief") {
+ Paragraph.clear();
+ InBrief = true;
+ ConsumeToken();
+ continue;
+ }
+ // Check if this command implicitly starts a new paragraph.
+ if (Name == "param" || Name == "result" || Name == "return" ||
+ Name == "returns") {
+ // We found an implicit paragraph end.
+ InFirstParagraph = false;
+ if (InBrief) {
+ InBrief = false;
+ break;
+ }
+ }
}
if (Tok.is(tok::newline)) {
InFirstParagraph = false;
if (InBrief) {
InBrief = false;
- BriefDone = true;
+ break;
}
}
continue;
#define FOO
void notdoxy46(void);
+/// IS_DOXYGEN_START Aaa bbb
+/// \param ccc
+/// \returns ddd IS_DOXYGEN_END
+void isdoxy47(int);
+
#endif
// RUN: rm -rf %t
// CHECK: annotate-comments.cpp:185:6: FunctionDecl=isdoxy44:{{.*}} BriefComment=[ IS_DOXYGEN_START Aaa bbb\n ccc.\n]
// CHECK: annotate-comments.cpp:195:6: FunctionDecl=isdoxy45:{{.*}} BriefComment=[\n Ddd eee.\n Fff.\n]
+// CHECK: annotate-comments.cpp:204:6: FunctionDecl=isdoxy47:{{.*}} BriefComment=[ IS_DOXYGEN_START Aaa bbb\n ]