Patch by Kovarththanan Rajaratnam!

"This minor patch adds markup of string literals with a red colour."

llvm-svn: 55589
This commit is contained in:
Ted Kremenek 2008-08-31 16:37:56 +00:00
parent 81d6a38434
commit afe2a9fe77
1 changed files with 10 additions and 0 deletions

View File

@ -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())