On Saturday, March 2, 2013, Jordan Rose  wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>For the record, Doxygen comments can also start with '@', probably for javadoc compatibility. Maybe HasAt?</div>
</div></blockquote><div><br></div><div>I agree -- headerdoc is not special here.</div><div><br></div><div>I think I used the term "command marker" in lexer somewhere.  No need to rush with the change, tomorrow I'll review the terms I used.</div>
<div><br></div><div>By the way, this is a nice change<span></span>.  I think there's a PR in the bugzilla about this.</div><div><br></div><div>Dmitri</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word"><div><br></div><br><div><div>On Mar 1, 2013, at 14:51 , Fariborz Jahanian <<a>fjahanian@apple.com</a>> wrote:</div><br><blockquote type="cite"><div style="letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px">
Author: fjahanian<br>Date: Fri Mar  1 16:51:30 2013<br>New Revision: 176387<br><br>URL:<span> </span><a href="http://llvm.org/viewvc/llvm-project?rev=176387&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=176387&view=rev</a><br>
Log:<br>comment parsing. Keep the original command format<span> </span><br>in AST for source fidelity and use it in diagnostics<span> </span><br>to refer to the original format. //<span> </span><a>rdar://13066276</a><br><br>
Modified:<br>   cfe/trunk/include/clang/AST/Comment.h<br>   cfe/trunk/include/clang/AST/CommentLexer.h<br>   cfe/trunk/include/clang/Basic/DiagnosticCommentKinds.td<br>   cfe/trunk/lib/AST/CommentLexer.cpp<br>   cfe/trunk/lib/AST/CommentParser.cpp<br>
   cfe/trunk/lib/AST/CommentSema.cpp<br>   cfe/trunk/test/Sema/warn-documentation.cpp<br><br>Modified: cfe/trunk/include/clang/AST/Comment.h<br>URL:<span> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Comment.h?rev=176387&r1=176386&r2=176387&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Comment.h?rev=176387&r1=176386&r2=176387&view=diff</a><br>
==============================================================================<br>--- cfe/trunk/include/clang/AST/Comment.h (original)<br>+++ cfe/trunk/include/clang/AST/Comment.h Fri Mar  1 16:51:30 2013<br>@@ -570,13 +570,16 @@ protected:<br>
<br>  /// Paragraph argument.<br>  ParagraphComment *Paragraph;<br>-<br>+  <br>+  /// Header Doc command, if true<br>+  bool HDCommand;<br>+  <br>  BlockCommandComment(CommentKind K,<br>                      SourceLocation LocBegin,<br>
                      SourceLocation LocEnd,<br>                      unsigned CommandID) :<br>      BlockContentComment(K, LocBegin, LocEnd),<br>-      Paragraph(NULL) {<br>+      Paragraph(NULL), HDCommand(false) {<br>    setLocation(getCommandNameBeginLoc());<br>
    BlockCommandCommentBits.CommandID = CommandID;<br>  }<br>@@ -586,7 +589,7 @@ public:<br>                      SourceLocation LocEnd,<br>                      unsigned CommandID) :<br>      BlockContentComment(BlockCommandCommentKind, LocBegin, LocEnd),<br>
-      Paragraph(NULL) {<br>+      Paragraph(NULL), HDCommand(false) {<br>    setLocation(getCommandNameBeginLoc());<br>    BlockCommandCommentBits.CommandID = CommandID;<br>  }<br>@@ -657,6 +660,14 @@ public:<br>    if (NewLocEnd.isValid())<br>
      setSourceRange(SourceRange(getLocStart(), NewLocEnd));<br>  }<br>+  <br>+  bool getHDCommand() const LLVM_READONLY {<br>+    return HDCommand;<br>+  }<br>+  <br>+  void setHDCommand(bool HDC) {<br>+    HDCommand = HDC;<br>
+  }<br>};<br><br>/// Doxygen<span> </span><a>\\param</a><span> </span>command.<br><br>Modified: cfe/trunk/include/clang/AST/CommentLexer.h<br>URL:<span> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/CommentLexer.h?rev=176387&r1=176386&r2=176387&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/CommentLexer.h?rev=176387&r1=176386&r2=176387&view=diff</a><br>
==============================================================================<br>--- cfe/trunk/include/clang/AST/CommentLexer.h (original)<br>+++ cfe/trunk/include/clang/AST/CommentLexer.h Fri Mar  1 16:51:30 2013<br>@@ -75,6 +75,9 @@ class Token {<br>
  /// unused (command spelling can be found with CommandTraits).  Otherwise,<br>  /// contains the length of the string that starts at TextPtr.<br>  unsigned IntVal;<br>+  <br>+  /// This command is a Header Doc command (command starts with '@').<br>
+  bool     HDCommand;<br><br>public:<br>  SourceLocation getLocation() const LLVM_READONLY { return Loc; }<br>@@ -122,6 +125,10 @@ public:<br>    return IntVal;<br>  }<br><br>+  bool getHDCommand() const LLVM_READONLY {<br>
+    return HDCommand;<br>+  }<br>+  <br>  void setCommandID(unsigned ID) {<br>    assert(is(tok::command));<br>    IntVal = ID;<br><br>Modified: cfe/trunk/include/clang/Basic/DiagnosticCommentKinds.td<br>URL:<span> </span><a href="http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticCommentKinds.td?rev=176387&r1=176386&r2=176387&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticCommentKinds.td?rev=176387&r1=176386&r2=176387&view=diff</a><br>
==============================================================================<br>--- cfe/trunk/include/clang/Basic/DiagnosticC</div></blockquote></div></div></blockquote><br><br>-- <br>main(i,j){for(i=2;;i++){for(j=2;j<i;j++){if(!(i%j)){j=0;break;}}if<br>
(j){printf("%d\n",i);}}} /*Dmitri Gribenko <<a href="mailto:gribozavr@gmail.com" target="_blank">gribozavr@gmail.com</a>>*/<br>