From: Chris Lattner Date: Wed, 16 Apr 2008 20:54:51 +0000 (+0000) Subject: reenable highlighting of (the first line of) comments X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=678c6358c8d4e368c78629099142397c63c1ee35;p=clang 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 2e8267d794..0ba51a6037 100644 --- a/include/clang/Lex/Lexer.h +++ b/include/clang/Lex/Lexer.h @@ -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(); diff --git a/lib/Rewrite/HTMLRewrite.cpp b/lib/Rewrite/HTMLRewrite.cpp index 682fffd82a..fc50eb1151 100644 --- a/lib/Rewrite/HTMLRewrite.cpp +++ b/lib/Rewrite/HTMLRewrite.cpp @@ -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.