Not that it really matters, but you can use StringSwitch's Cases to make this a 
little clearer.

At some point you probably also want to switch to generating these case tables 
at compile-time.


On Jul 17, 2012, at 11:35 , Dmitri Gribenko <[email protected]> wrote:

> Author: gribozavr
> Date: Tue Jul 17 13:35:14 2012
> New Revision: 160383
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=160383&view=rev
> Log:
> CommentBriefParser: make \short should equivalent to \brief, per Doxygen 
> manual.
> 
> Modified:
>    cfe/trunk/lib/AST/CommentBriefParser.cpp
>    cfe/trunk/test/Index/annotate-comments.cpp
> 
> Modified: cfe/trunk/lib/AST/CommentBriefParser.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/CommentBriefParser.cpp?rev=160383&r1=160382&r2=160383&view=diff
> ==============================================================================
> --- cfe/trunk/lib/AST/CommentBriefParser.cpp (original)
> +++ cfe/trunk/lib/AST/CommentBriefParser.cpp Tue Jul 17 13:35:14 2012
> @@ -43,6 +43,7 @@
> bool isBlockCommand(StringRef Name) {
>   return llvm::StringSwitch<bool>(Name)
>       .Case("brief", true)
> +      .Case("short", true)
>       .Case("result", true)
>       .Case("return", true)
>       .Case("returns", true)
> @@ -71,7 +72,7 @@
> 
>     if (Tok.is(tok::command)) {
>       StringRef Name = Tok.getCommandName();
> -      if (Name == "brief") {
> +      if (Name == "brief" || Name == "short") {
>         Paragraph.clear();
>         InBrief = true;
>         ConsumeToken();
> 
> Modified: cfe/trunk/test/Index/annotate-comments.cpp
> URL: 
> http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Index/annotate-comments.cpp?rev=160383&r1=160382&r2=160383&view=diff
> ==============================================================================
> --- cfe/trunk/test/Index/annotate-comments.cpp (original)
> +++ cfe/trunk/test/Index/annotate-comments.cpp Tue Jul 17 13:35:14 2012
> @@ -194,14 +194,24 @@
> /// 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 @@
> 
> // 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]
> 
> 
> 
> _______________________________________________
> cfe-commits mailing list
> [email protected]
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to