[cfe-commits] r49816 - in /cfe/trunk: include/clang/Lex/Lexer.h lib/Rewrite/HTMLRewrite.cpp

Chris Lattner sabre at nondot.org
Wed Apr 16 13:54:51 PDT 2008


Author: lattner
Date: Wed Apr 16 15:54:51 2008
New Revision: 49816

URL: http://llvm.org/viewvc/llvm-project?rev=49816&view=rev
Log:
reenable highlighting of (the first line of) comments

Modified:
    cfe/trunk/include/clang/Lex/Lexer.h
    cfe/trunk/lib/Rewrite/HTMLRewrite.cpp

Modified: cfe/trunk/include/clang/Lex/Lexer.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Lex/Lexer.h?rev=49816&r1=49815&r2=49816&view=diff

==============================================================================
--- cfe/trunk/include/clang/Lex/Lexer.h (original)
+++ cfe/trunk/include/clang/Lex/Lexer.h Wed Apr 16 15:54:51 2008
@@ -154,6 +154,13 @@
     return BufferPtr == BufferEnd; 
   }
   
+  /// SetCommentRetentionMode - Change the comment retention mode of the lexer
+  /// to the specified mode.  This is really only useful when lexing in raw
+  /// mode, because otherwise the lexer needs to manage this.
+  void SetCommentRetentionState(bool Mode) { 
+    KeepCommentMode = Mode;
+  }
+  
   /// ReadToEndOfLine - Read the rest of the current preprocessor line as an
   /// uninterpreted string.  This switches the lexer out of directive mode.
   std::string ReadToEndOfLine();

Modified: cfe/trunk/lib/Rewrite/HTMLRewrite.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/HTMLRewrite.cpp?rev=49816&r1=49815&r2=49816&view=diff

==============================================================================
--- cfe/trunk/lib/Rewrite/HTMLRewrite.cpp (original)
+++ cfe/trunk/lib/Rewrite/HTMLRewrite.cpp Wed Apr 16 15:54:51 2008
@@ -237,7 +237,7 @@
   
   // Inform the preprocessor that we want to retain comments as tokens, so we 
   // can highlight them.
-  //PP.SetCommentRetentionState(true, false);
+  L.SetCommentRetentionState(true);
  
   // Lex all the tokens in raw mode, to avoid entering #includes or expanding
   // macros.





More information about the cfe-commits mailing list