]> granicus.if.org Git - clang/commitdiff
reenable highlighting of (the first line of) comments
authorChris Lattner <sabre@nondot.org>
Wed, 16 Apr 2008 20:54:51 +0000 (20:54 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 16 Apr 2008 20:54:51 +0000 (20:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49816 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Lex/Lexer.h
lib/Rewrite/HTMLRewrite.cpp

index 2e8267d794b4a065006e938c9c7cb899dd189a8f..0ba51a60378493da737800ce7fdb500aade60487 100644 (file)
@@ -154,6 +154,13 @@ public:
     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();
index 682fffd82aebfad9231c9fc790feb49ec2e483ee..fc50eb1151c7a144acbacf502a9327aa468b9ced 100644 (file)
@@ -237,7 +237,7 @@ void html::SyntaxHighlight(Rewriter &R, unsigned FileID, Preprocessor &PP) {
   
   // 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.