[cfe-commits] r55589 - /cfe/trunk/lib/Rewrite/HTMLRewrite.cpp

Ted Kremenek kremenek at apple.com
Sun Aug 31 09:38:00 PDT 2008


Author: kremenek
Date: Sun Aug 31 11:37:56 2008
New Revision: 55589

URL: http://llvm.org/viewvc/llvm-project?rev=55589&view=rev
Log:
Patch by Kovarththanan Rajaratnam!

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

Modified:
    cfe/trunk/lib/Rewrite/HTMLRewrite.cpp

Modified: cfe/trunk/lib/Rewrite/HTMLRewrite.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Rewrite/HTMLRewrite.cpp?rev=55589&r1=55588&r2=55589&view=diff

==============================================================================
--- cfe/trunk/lib/Rewrite/HTMLRewrite.cpp (original)
+++ cfe/trunk/lib/Rewrite/HTMLRewrite.cpp Sun Aug 31 11:37:56 2008
@@ -288,6 +288,7 @@
       " .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 @@
       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())





More information about the cfe-commits mailing list