diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-08-31 16:37:56 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-08-31 16:37:56 +0000 |
commit | afe2a9fe7745d85c3522299723946d9a72b90f63 (patch) | |
tree | 31861632c3db304d6e0996b9ae15deb23912f442 /clang/lib/Rewrite | |
parent | 81d6a38434216e5a314f53509ce6f28060db3775 (diff) | |
download | bcm5719-llvm-afe2a9fe7745d85c3522299723946d9a72b90f63.tar.gz bcm5719-llvm-afe2a9fe7745d85c3522299723946d9a72b90f63.zip |
Patch by Kovarththanan Rajaratnam!
"This minor patch adds markup of string literals with a red colour."
llvm-svn: 55589
Diffstat (limited to 'clang/lib/Rewrite')
-rw-r--r-- | clang/lib/Rewrite/HTMLRewrite.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Rewrite/HTMLRewrite.cpp b/clang/lib/Rewrite/HTMLRewrite.cpp index f86f29d5b92..43c04793f08 100644 --- a/clang/lib/Rewrite/HTMLRewrite.cpp +++ b/clang/lib/Rewrite/HTMLRewrite.cpp @@ -288,6 +288,7 @@ void html::AddHeaderFooterInternalBuiltinCSS(Rewriter& R, unsigned FileID, " .code { line-height: 1.2em }\n" " .comment { color: green; font-style: oblique }\n" " .keyword { color: blue }\n" + " .string_literal { color: red }\n" " .directive { color: darkmagenta }\n" // Macro expansions. " .expansion { display: none; }\n" @@ -378,6 +379,15 @@ void html::SyntaxHighlight(Rewriter &R, unsigned FileID, Preprocessor &PP) { HighlightRange(RB, TokOffs, TokOffs+TokLen, BufferStart, "<span class='comment'>", "</span>"); break; + case tok::wide_string_literal: + // Chop off the L prefix + ++TokOffs; + --TokLen; + // FALL THROUGH. + case tok::string_literal: + HighlightRange(RB, TokOffs, TokOffs+TokLen, BufferStart, + "<span class='string_literal'>", "</span>"); + break; case tok::hash: { // If this is a preprocessor directive, all tokens to end of line are too. if (!Tok.isAtStartOfLine()) |