reenable highlighting of (the first line of) comments
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@49816 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/include/clang/Lex/Lexer.h b/include/clang/Lex/Lexer.h
index 2e8267d..0ba51a6 100644
--- a/include/clang/Lex/Lexer.h
+++ b/include/clang/Lex/Lexer.h
@@ -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();
diff --git a/lib/Rewrite/HTMLRewrite.cpp b/lib/Rewrite/HTMLRewrite.cpp
index 682fffd..fc50eb1 100644
--- a/lib/Rewrite/HTMLRewrite.cpp
+++ b/lib/Rewrite/HTMLRewrite.cpp
@@ -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.