summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-04-16 20:54:51 +0000
committerChris Lattner <sabre@nondot.org>2008-04-16 20:54:51 +0000
commite9786c31996333716b6eff411cad4c915eba5b45 (patch)
tree061ced77b98a8156a3c77e31dd1445e1745d3931 /clang
parent0bb0e7ee8a100cb036c248c3b1335d9046cbecb8 (diff)
downloadbcm5719-llvm-e9786c31996333716b6eff411cad4c915eba5b45.tar.gz
bcm5719-llvm-e9786c31996333716b6eff411cad4c915eba5b45.zip
reenable highlighting of (the first line of) comments
llvm-svn: 49816
Diffstat (limited to 'clang')
-rw-r--r--clang/include/clang/Lex/Lexer.h7
-rw-r--r--clang/lib/Rewrite/HTMLRewrite.cpp2
2 files changed, 8 insertions, 1 deletions
diff --git a/clang/include/clang/Lex/Lexer.h b/clang/include/clang/Lex/Lexer.h
index 2e8267d794b..0ba51a60378 100644
--- a/clang/include/clang/Lex/Lexer.h
+++ b/clang/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/clang/lib/Rewrite/HTMLRewrite.cpp b/clang/lib/Rewrite/HTMLRewrite.cpp
index 682fffd82ae..fc50eb1151c 100644
--- a/clang/lib/Rewrite/HTMLRewrite.cpp
+++ b/clang/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.
OpenPOWER on IntegriCloud