Ted Kremenek | 6a34083 | 2008-03-18 21:19:49 +0000 | [diff] [blame] | 1 | //== HTMLRewrite.cpp - Translate source code into prettified HTML --*- C++ -*-// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file defines the HTMLRewriter clas, which is used to translate the |
| 11 | // text of a source file into prettified HTML. |
| 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
Ted Kremenek | 339b9c2 | 2008-04-17 22:31:54 +0000 | [diff] [blame] | 15 | #include "clang/Lex/Preprocessor.h" |
Ted Kremenek | 6a34083 | 2008-03-18 21:19:49 +0000 | [diff] [blame] | 16 | #include "clang/Rewrite/Rewriter.h" |
| 17 | #include "clang/Rewrite/HTMLRewrite.h" |
Chris Lattner | 867924d | 2009-02-13 00:51:30 +0000 | [diff] [blame] | 18 | #include "clang/Lex/TokenConcatenation.h" |
Chris Lattner | 3245a0a | 2008-04-16 06:11:58 +0000 | [diff] [blame] | 19 | #include "clang/Lex/Preprocessor.h" |
Ted Kremenek | 6a34083 | 2008-03-18 21:19:49 +0000 | [diff] [blame] | 20 | #include "clang/Basic/SourceManager.h" |
Chris Lattner | 57df3b9 | 2008-04-16 04:11:35 +0000 | [diff] [blame] | 21 | #include "llvm/ADT/SmallString.h" |
Ted Kremenek | 339b9c2 | 2008-04-17 22:31:54 +0000 | [diff] [blame] | 22 | #include "llvm/ADT/OwningPtr.h" |
Ted Kremenek | 6a34083 | 2008-03-18 21:19:49 +0000 | [diff] [blame] | 23 | #include "llvm/Support/MemoryBuffer.h" |
Ted Kremenek | a95d375 | 2008-09-13 05:16:45 +0000 | [diff] [blame] | 24 | #include "llvm/Support/raw_ostream.h" |
Ted Kremenek | 6a34083 | 2008-03-18 21:19:49 +0000 | [diff] [blame] | 25 | using namespace clang; |
| 26 | |
Chris Lattner | 9402b57 | 2008-04-16 23:06:45 +0000 | [diff] [blame] | 27 | |
Chris Lattner | 5ef3e2c | 2008-04-16 22:45:51 +0000 | [diff] [blame] | 28 | /// HighlightRange - Highlight a range in the source code with the specified |
| 29 | /// start/end tags. B/E must be in the same file. This ensures that |
| 30 | /// start/end tags are placed at the start/end of each line if the range is |
| 31 | /// multiline. |
| 32 | void html::HighlightRange(Rewriter &R, SourceLocation B, SourceLocation E, |
| 33 | const char *StartTag, const char *EndTag) { |
| 34 | SourceManager &SM = R.getSourceMgr(); |
Chris Lattner | f7cf85b | 2009-01-16 07:36:28 +0000 | [diff] [blame] | 35 | B = SM.getInstantiationLoc(B); |
| 36 | E = SM.getInstantiationLoc(E); |
Chris Lattner | a11d617 | 2009-01-19 07:46:45 +0000 | [diff] [blame] | 37 | FileID FID = SM.getFileID(B); |
| 38 | assert(SM.getFileID(E) == FID && "B/E not in the same file!"); |
Chris Lattner | 5ef3e2c | 2008-04-16 22:45:51 +0000 | [diff] [blame] | 39 | |
Chris Lattner | 52c2908 | 2009-01-27 06:27:13 +0000 | [diff] [blame] | 40 | unsigned BOffset = SM.getFileOffset(B); |
| 41 | unsigned EOffset = SM.getFileOffset(E); |
Chris Lattner | 5ef3e2c | 2008-04-16 22:45:51 +0000 | [diff] [blame] | 42 | |
| 43 | // Include the whole end token in the range. |
| 44 | EOffset += Lexer::MeasureTokenLength(E, R.getSourceMgr()); |
| 45 | |
Chris Lattner | 2b2453a | 2009-01-17 06:22:33 +0000 | [diff] [blame] | 46 | HighlightRange(R.getEditBuffer(FID), BOffset, EOffset, |
| 47 | SM.getBufferData(FID).first, StartTag, EndTag); |
Chris Lattner | 5ef3e2c | 2008-04-16 22:45:51 +0000 | [diff] [blame] | 48 | } |
| 49 | |
| 50 | /// HighlightRange - This is the same as the above method, but takes |
| 51 | /// decomposed file locations. |
| 52 | void html::HighlightRange(RewriteBuffer &RB, unsigned B, unsigned E, |
| 53 | const char *BufferStart, |
| 54 | const char *StartTag, const char *EndTag) { |
Chris Lattner | 9402b57 | 2008-04-16 23:06:45 +0000 | [diff] [blame] | 55 | // Insert the tag at the absolute start/end of the range. |
Chris Lattner | 5ef3e2c | 2008-04-16 22:45:51 +0000 | [diff] [blame] | 56 | RB.InsertTextAfter(B, StartTag, strlen(StartTag)); |
| 57 | RB.InsertTextBefore(E, EndTag, strlen(EndTag)); |
| 58 | |
Chris Lattner | 9402b57 | 2008-04-16 23:06:45 +0000 | [diff] [blame] | 59 | // Scan the range to see if there is a \r or \n. If so, and if the line is |
| 60 | // not blank, insert tags on that line as well. |
| 61 | bool HadOpenTag = true; |
| 62 | |
| 63 | unsigned LastNonWhiteSpace = B; |
| 64 | for (unsigned i = B; i != E; ++i) { |
| 65 | switch (BufferStart[i]) { |
| 66 | case '\r': |
| 67 | case '\n': |
| 68 | // Okay, we found a newline in the range. If we have an open tag, we need |
| 69 | // to insert a close tag at the first non-whitespace before the newline. |
| 70 | if (HadOpenTag) |
| 71 | RB.InsertTextBefore(LastNonWhiteSpace+1, EndTag, strlen(EndTag)); |
| 72 | |
| 73 | // Instead of inserting an open tag immediately after the newline, we |
| 74 | // wait until we see a non-whitespace character. This prevents us from |
| 75 | // inserting tags around blank lines, and also allows the open tag to |
| 76 | // be put *after* whitespace on a non-blank line. |
| 77 | HadOpenTag = false; |
| 78 | break; |
| 79 | case '\0': |
| 80 | case ' ': |
| 81 | case '\t': |
| 82 | case '\f': |
| 83 | case '\v': |
| 84 | // Ignore whitespace. |
| 85 | break; |
| 86 | |
| 87 | default: |
| 88 | // If there is no tag open, do it now. |
| 89 | if (!HadOpenTag) { |
| 90 | RB.InsertTextAfter(i, StartTag, strlen(StartTag)); |
| 91 | HadOpenTag = true; |
| 92 | } |
| 93 | |
| 94 | // Remember this character. |
| 95 | LastNonWhiteSpace = i; |
| 96 | break; |
| 97 | } |
| 98 | } |
Chris Lattner | 5ef3e2c | 2008-04-16 22:45:51 +0000 | [diff] [blame] | 99 | } |
| 100 | |
Chris Lattner | 2b2453a | 2009-01-17 06:22:33 +0000 | [diff] [blame] | 101 | void html::EscapeText(Rewriter &R, FileID FID, |
Ted Kremenek | fa5be36 | 2008-04-08 22:37:58 +0000 | [diff] [blame] | 102 | bool EscapeSpaces, bool ReplaceTabs) { |
Ted Kremenek | 6a34083 | 2008-03-18 21:19:49 +0000 | [diff] [blame] | 103 | |
Chris Lattner | 2b2453a | 2009-01-17 06:22:33 +0000 | [diff] [blame] | 104 | const llvm::MemoryBuffer *Buf = R.getSourceMgr().getBuffer(FID); |
Ted Kremenek | 6a34083 | 2008-03-18 21:19:49 +0000 | [diff] [blame] | 105 | const char* C = Buf->getBufferStart(); |
| 106 | const char* FileEnd = Buf->getBufferEnd(); |
| 107 | |
| 108 | assert (C <= FileEnd); |
| 109 | |
Chris Lattner | 2b2453a | 2009-01-17 06:22:33 +0000 | [diff] [blame] | 110 | RewriteBuffer &RB = R.getEditBuffer(FID); |
Chris Lattner | 5c176f7 | 2008-04-18 04:54:20 +0000 | [diff] [blame] | 111 | |
| 112 | unsigned ColNo = 0; |
Ted Kremenek | 6a34083 | 2008-03-18 21:19:49 +0000 | [diff] [blame] | 113 | for (unsigned FilePos = 0; C != FileEnd ; ++C, ++FilePos) { |
Ted Kremenek | 6a34083 | 2008-03-18 21:19:49 +0000 | [diff] [blame] | 114 | switch (*C) { |
Chris Lattner | 5c176f7 | 2008-04-18 04:54:20 +0000 | [diff] [blame] | 115 | default: ++ColNo; break; |
| 116 | case '\n': |
| 117 | case '\r': |
| 118 | ColNo = 0; |
| 119 | break; |
Chris Lattner | 7352714 | 2008-04-16 04:33:23 +0000 | [diff] [blame] | 120 | |
| 121 | case ' ': |
| 122 | if (EscapeSpaces) |
| 123 | RB.ReplaceText(FilePos, 1, " ", 6); |
Chris Lattner | 5c176f7 | 2008-04-18 04:54:20 +0000 | [diff] [blame] | 124 | ++ColNo; |
Chris Lattner | 7352714 | 2008-04-16 04:33:23 +0000 | [diff] [blame] | 125 | break; |
Chris Lattner | f3d8d19 | 2008-04-19 23:56:30 +0000 | [diff] [blame] | 126 | case '\f': |
| 127 | RB.ReplaceText(FilePos, 1, "<hr>", 4); |
| 128 | ColNo = 0; |
| 129 | break; |
| 130 | |
Chris Lattner | 5c176f7 | 2008-04-18 04:54:20 +0000 | [diff] [blame] | 131 | case '\t': { |
Chris Lattner | 7352714 | 2008-04-16 04:33:23 +0000 | [diff] [blame] | 132 | if (!ReplaceTabs) |
Ted Kremenek | 49cd635 | 2008-04-03 07:12:29 +0000 | [diff] [blame] | 133 | break; |
Chris Lattner | 5c176f7 | 2008-04-18 04:54:20 +0000 | [diff] [blame] | 134 | unsigned NumSpaces = 8-(ColNo&7); |
Chris Lattner | 7352714 | 2008-04-16 04:33:23 +0000 | [diff] [blame] | 135 | if (EscapeSpaces) |
Chris Lattner | 8aa06ac | 2008-04-17 21:28:41 +0000 | [diff] [blame] | 136 | RB.ReplaceText(FilePos, 1, " " |
Chris Lattner | 5c176f7 | 2008-04-18 04:54:20 +0000 | [diff] [blame] | 137 | " ", 6*NumSpaces); |
Chris Lattner | 7352714 | 2008-04-16 04:33:23 +0000 | [diff] [blame] | 138 | else |
Chris Lattner | 5c176f7 | 2008-04-18 04:54:20 +0000 | [diff] [blame] | 139 | RB.ReplaceText(FilePos, 1, " ", NumSpaces); |
| 140 | ColNo += NumSpaces; |
Chris Lattner | 7352714 | 2008-04-16 04:33:23 +0000 | [diff] [blame] | 141 | break; |
Chris Lattner | 5c176f7 | 2008-04-18 04:54:20 +0000 | [diff] [blame] | 142 | } |
Chris Lattner | 7352714 | 2008-04-16 04:33:23 +0000 | [diff] [blame] | 143 | case '<': |
| 144 | RB.ReplaceText(FilePos, 1, "<", 4); |
Chris Lattner | 5c176f7 | 2008-04-18 04:54:20 +0000 | [diff] [blame] | 145 | ++ColNo; |
Chris Lattner | 7352714 | 2008-04-16 04:33:23 +0000 | [diff] [blame] | 146 | break; |
| 147 | |
| 148 | case '>': |
| 149 | RB.ReplaceText(FilePos, 1, ">", 4); |
Chris Lattner | 5c176f7 | 2008-04-18 04:54:20 +0000 | [diff] [blame] | 150 | ++ColNo; |
Chris Lattner | 7352714 | 2008-04-16 04:33:23 +0000 | [diff] [blame] | 151 | break; |
| 152 | |
| 153 | case '&': |
| 154 | RB.ReplaceText(FilePos, 1, "&", 5); |
Chris Lattner | 5c176f7 | 2008-04-18 04:54:20 +0000 | [diff] [blame] | 155 | ++ColNo; |
Chris Lattner | 7352714 | 2008-04-16 04:33:23 +0000 | [diff] [blame] | 156 | break; |
Ted Kremenek | 6a34083 | 2008-03-18 21:19:49 +0000 | [diff] [blame] | 157 | } |
| 158 | } |
| 159 | } |
| 160 | |
Ted Kremenek | fa5be36 | 2008-04-08 22:37:58 +0000 | [diff] [blame] | 161 | std::string html::EscapeText(const std::string& s, bool EscapeSpaces, |
| 162 | bool ReplaceTabs) { |
Ted Kremenek | 053ef59 | 2008-03-27 17:15:29 +0000 | [diff] [blame] | 163 | |
| 164 | unsigned len = s.size(); |
Ted Kremenek | a95d375 | 2008-09-13 05:16:45 +0000 | [diff] [blame] | 165 | std::string Str; |
| 166 | llvm::raw_string_ostream os(Str); |
Ted Kremenek | 053ef59 | 2008-03-27 17:15:29 +0000 | [diff] [blame] | 167 | |
| 168 | for (unsigned i = 0 ; i < len; ++i) { |
| 169 | |
| 170 | char c = s[i]; |
Ted Kremenek | 053ef59 | 2008-03-27 17:15:29 +0000 | [diff] [blame] | 171 | switch (c) { |
Chris Lattner | 8570f0b | 2008-04-16 04:37:29 +0000 | [diff] [blame] | 172 | default: |
| 173 | os << c; break; |
| 174 | |
| 175 | case ' ': |
| 176 | if (EscapeSpaces) os << " "; |
| 177 | else os << ' '; |
| 178 | break; |
| 179 | |
| 180 | case '\t': |
Nico Weber | 6336630 | 2008-08-16 22:24:33 +0000 | [diff] [blame] | 181 | if (ReplaceTabs) { |
| 182 | if (EscapeSpaces) |
| 183 | for (unsigned i = 0; i < 4; ++i) |
| 184 | os << " "; |
| 185 | else |
| 186 | for (unsigned i = 0; i < 4; ++i) |
| 187 | os << " "; |
| 188 | } |
Chris Lattner | 8570f0b | 2008-04-16 04:37:29 +0000 | [diff] [blame] | 189 | else |
| 190 | os << c; |
| 191 | |
Ted Kremenek | 053ef59 | 2008-03-27 17:15:29 +0000 | [diff] [blame] | 192 | break; |
Chris Lattner | 8570f0b | 2008-04-16 04:37:29 +0000 | [diff] [blame] | 193 | |
| 194 | case '<': os << "<"; break; |
| 195 | case '>': os << ">"; break; |
| 196 | case '&': os << "&"; break; |
Ted Kremenek | 053ef59 | 2008-03-27 17:15:29 +0000 | [diff] [blame] | 197 | } |
| 198 | } |
| 199 | |
| 200 | return os.str(); |
| 201 | } |
| 202 | |
Chris Lattner | 8570f0b | 2008-04-16 04:37:29 +0000 | [diff] [blame] | 203 | static void AddLineNumber(RewriteBuffer &RB, unsigned LineNo, |
| 204 | unsigned B, unsigned E) { |
Chris Lattner | 57df3b9 | 2008-04-16 04:11:35 +0000 | [diff] [blame] | 205 | llvm::SmallString<100> Str; |
| 206 | Str += "<tr><td class=\"num\" id=\"LN"; |
| 207 | Str.append_uint(LineNo); |
| 208 | Str += "\">"; |
| 209 | Str.append_uint(LineNo); |
| 210 | Str += "</td><td class=\"line\">"; |
| 211 | |
Ted Kremenek | 49cd635 | 2008-04-03 07:12:29 +0000 | [diff] [blame] | 212 | if (B == E) { // Handle empty lines. |
Chris Lattner | 57df3b9 | 2008-04-16 04:11:35 +0000 | [diff] [blame] | 213 | Str += " </td></tr>"; |
Chris Lattner | 8570f0b | 2008-04-16 04:37:29 +0000 | [diff] [blame] | 214 | RB.InsertTextBefore(B, &Str[0], Str.size()); |
Chris Lattner | 57df3b9 | 2008-04-16 04:11:35 +0000 | [diff] [blame] | 215 | } else { |
Chris Lattner | 8570f0b | 2008-04-16 04:37:29 +0000 | [diff] [blame] | 216 | RB.InsertTextBefore(B, &Str[0], Str.size()); |
| 217 | RB.InsertTextBefore(E, "</td></tr>", strlen("</td></tr>")); |
Ted Kremenek | 49cd635 | 2008-04-03 07:12:29 +0000 | [diff] [blame] | 218 | } |
Ted Kremenek | b485cd1 | 2008-03-18 23:08:51 +0000 | [diff] [blame] | 219 | } |
| 220 | |
Chris Lattner | 2b2453a | 2009-01-17 06:22:33 +0000 | [diff] [blame] | 221 | void html::AddLineNumbers(Rewriter& R, FileID FID) { |
Ted Kremenek | b485cd1 | 2008-03-18 23:08:51 +0000 | [diff] [blame] | 222 | |
Chris Lattner | 2b2453a | 2009-01-17 06:22:33 +0000 | [diff] [blame] | 223 | const llvm::MemoryBuffer *Buf = R.getSourceMgr().getBuffer(FID); |
Ted Kremenek | b485cd1 | 2008-03-18 23:08:51 +0000 | [diff] [blame] | 224 | const char* FileBeg = Buf->getBufferStart(); |
| 225 | const char* FileEnd = Buf->getBufferEnd(); |
| 226 | const char* C = FileBeg; |
Chris Lattner | 2b2453a | 2009-01-17 06:22:33 +0000 | [diff] [blame] | 227 | RewriteBuffer &RB = R.getEditBuffer(FID); |
Ted Kremenek | b485cd1 | 2008-03-18 23:08:51 +0000 | [diff] [blame] | 228 | |
| 229 | assert (C <= FileEnd); |
| 230 | |
| 231 | unsigned LineNo = 0; |
| 232 | unsigned FilePos = 0; |
| 233 | |
| 234 | while (C != FileEnd) { |
| 235 | |
| 236 | ++LineNo; |
| 237 | unsigned LineStartPos = FilePos; |
| 238 | unsigned LineEndPos = FileEnd - FileBeg; |
| 239 | |
| 240 | assert (FilePos <= LineEndPos); |
| 241 | assert (C < FileEnd); |
| 242 | |
| 243 | // Scan until the newline (or end-of-file). |
| 244 | |
Ted Kremenek | 49cd635 | 2008-04-03 07:12:29 +0000 | [diff] [blame] | 245 | while (C != FileEnd) { |
| 246 | char c = *C; |
| 247 | ++C; |
| 248 | |
| 249 | if (c == '\n') { |
| 250 | LineEndPos = FilePos++; |
Ted Kremenek | b485cd1 | 2008-03-18 23:08:51 +0000 | [diff] [blame] | 251 | break; |
| 252 | } |
Ted Kremenek | 49cd635 | 2008-04-03 07:12:29 +0000 | [diff] [blame] | 253 | |
| 254 | ++FilePos; |
| 255 | } |
Ted Kremenek | b485cd1 | 2008-03-18 23:08:51 +0000 | [diff] [blame] | 256 | |
Chris Lattner | 8570f0b | 2008-04-16 04:37:29 +0000 | [diff] [blame] | 257 | AddLineNumber(RB, LineNo, LineStartPos, LineEndPos); |
Ted Kremenek | d6c1360 | 2008-03-19 05:07:26 +0000 | [diff] [blame] | 258 | } |
| 259 | |
Chris Lattner | 8570f0b | 2008-04-16 04:37:29 +0000 | [diff] [blame] | 260 | // Add one big table tag that surrounds all of the code. |
| 261 | RB.InsertTextBefore(0, "<table class=\"code\">\n", |
| 262 | strlen("<table class=\"code\">\n")); |
Ted Kremenek | d6c1360 | 2008-03-19 05:07:26 +0000 | [diff] [blame] | 263 | |
Chris Lattner | 8570f0b | 2008-04-16 04:37:29 +0000 | [diff] [blame] | 264 | RB.InsertTextAfter(FileEnd - FileBeg, "</table>", strlen("</table>")); |
Ted Kremenek | b485cd1 | 2008-03-18 23:08:51 +0000 | [diff] [blame] | 265 | } |
Ted Kremenek | ad0a203 | 2008-03-19 06:14:37 +0000 | [diff] [blame] | 266 | |
Chris Lattner | 2b2453a | 2009-01-17 06:22:33 +0000 | [diff] [blame] | 267 | void html::AddHeaderFooterInternalBuiltinCSS(Rewriter& R, FileID FID, |
Ted Kremenek | f6f593f | 2008-07-07 18:31:05 +0000 | [diff] [blame] | 268 | const char *title) { |
Ted Kremenek | ad0a203 | 2008-03-19 06:14:37 +0000 | [diff] [blame] | 269 | |
Chris Lattner | 2b2453a | 2009-01-17 06:22:33 +0000 | [diff] [blame] | 270 | const llvm::MemoryBuffer *Buf = R.getSourceMgr().getBuffer(FID); |
Ted Kremenek | ad0a203 | 2008-03-19 06:14:37 +0000 | [diff] [blame] | 271 | const char* FileStart = Buf->getBufferStart(); |
| 272 | const char* FileEnd = Buf->getBufferEnd(); |
| 273 | |
Chris Lattner | 2b2453a | 2009-01-17 06:22:33 +0000 | [diff] [blame] | 274 | SourceLocation StartLoc = R.getSourceMgr().getLocForStartOfFile(FID); |
| 275 | SourceLocation EndLoc = StartLoc.getFileLocWithOffset(FileEnd-FileStart); |
Ted Kremenek | ad0a203 | 2008-03-19 06:14:37 +0000 | [diff] [blame] | 276 | |
Ted Kremenek | a95d375 | 2008-09-13 05:16:45 +0000 | [diff] [blame] | 277 | std::string s; |
| 278 | llvm::raw_string_ostream os(s); |
Ted Kremenek | f6f593f | 2008-07-07 18:31:05 +0000 | [diff] [blame] | 279 | os << "<!doctype html>\n" // Use HTML 5 doctype |
| 280 | "<html>\n<head>\n"; |
| 281 | |
| 282 | if (title) |
| 283 | os << "<title>" << html::EscapeText(title) << "</title>\n"; |
| 284 | |
| 285 | os << "<style type=\"text/css\">\n" |
Ted Kremenek | 70bcba6 | 2008-04-09 15:40:40 +0000 | [diff] [blame] | 286 | " body { color:#000000; background-color:#ffffff }\n" |
| 287 | " body { font-family:Helvetica, sans-serif; font-size:10pt }\n" |
Ted Kremenek | 4b0f813 | 2008-04-15 21:25:08 +0000 | [diff] [blame] | 288 | " h1 { font-size:14pt }\n" |
Ted Kremenek | f501626 | 2008-04-18 02:12:39 +0000 | [diff] [blame] | 289 | " .code { border-collapse:collapse; width:100%; }\n" |
Ted Kremenek | 70bcba6 | 2008-04-09 15:40:40 +0000 | [diff] [blame] | 290 | " .code { font-family: \"Andale Mono\", monospace; font-size:10pt }\n" |
| 291 | " .code { line-height: 1.2em }\n" |
Ted Kremenek | f501626 | 2008-04-18 02:12:39 +0000 | [diff] [blame] | 292 | " .comment { color: green; font-style: oblique }\n" |
| 293 | " .keyword { color: blue }\n" |
Ted Kremenek | cc1b853 | 2008-08-31 16:37:56 +0000 | [diff] [blame] | 294 | " .string_literal { color: red }\n" |
Ted Kremenek | f501626 | 2008-04-18 02:12:39 +0000 | [diff] [blame] | 295 | " .directive { color: darkmagenta }\n" |
Chris Lattner | 6f46be2 | 2008-04-17 00:40:45 +0000 | [diff] [blame] | 296 | // Macro expansions. |
Ted Kremenek | 07339a6 | 2008-04-17 19:57:27 +0000 | [diff] [blame] | 297 | " .expansion { display: none; }\n" |
| 298 | " .macro:hover .expansion { display: block; border: 2px solid #FF0000; " |
Chris Lattner | dc5be47 | 2008-04-17 21:32:46 +0000 | [diff] [blame] | 299 | "padding: 2px; background-color:#FFF0F0; font-weight: normal; " |
Chris Lattner | 6f46be2 | 2008-04-17 00:40:45 +0000 | [diff] [blame] | 300 | " -webkit-border-radius:5px; -webkit-box-shadow:1px 1px 7px #000; " |
Chris Lattner | 8aa06ac | 2008-04-17 21:28:41 +0000 | [diff] [blame] | 301 | "position: absolute; top: -1em; left:10em; z-index: 1 } \n" |
Ted Kremenek | f501626 | 2008-04-18 02:12:39 +0000 | [diff] [blame] | 302 | " .macro { color: darkmagenta; background-color:LemonChiffon;" |
Chris Lattner | 6f46be2 | 2008-04-17 00:40:45 +0000 | [diff] [blame] | 303 | // Macros are position: relative to provide base for expansions. |
| 304 | " position: relative }\n" |
Ted Kremenek | 70bcba6 | 2008-04-09 15:40:40 +0000 | [diff] [blame] | 305 | " .num { width:2.5em; padding-right:2ex; background-color:#eeeeee }\n" |
Ted Kremenek | 2223622 | 2009-03-10 05:14:32 +0000 | [diff] [blame] | 306 | " .num { text-align:right; font-size:8pt }\n" |
Ted Kremenek | 70bcba6 | 2008-04-09 15:40:40 +0000 | [diff] [blame] | 307 | " .num { color:#444444 }\n" |
| 308 | " .line { padding-left: 1ex; border-left: 3px solid #ccc }\n" |
| 309 | " .line { white-space: pre }\n" |
Ted Kremenek | 70bcba6 | 2008-04-09 15:40:40 +0000 | [diff] [blame] | 310 | " .msg { -webkit-box-shadow:1px 1px 7px #000 }\n" |
| 311 | " .msg { -webkit-border-radius:5px }\n" |
Ted Kremenek | 2223622 | 2009-03-10 05:14:32 +0000 | [diff] [blame] | 312 | " .msg { font-family:Helvetica, sans-serif; font-size:8pt }\n" |
Ted Kremenek | 70bcba6 | 2008-04-09 15:40:40 +0000 | [diff] [blame] | 313 | " .msg { float:left }\n" |
Ted Kremenek | 3c59823 | 2009-03-03 03:00:21 +0000 | [diff] [blame] | 314 | " .msg { padding:0.25em 1ex 0.25em 1ex }\n" |
Ted Kremenek | 70bcba6 | 2008-04-09 15:40:40 +0000 | [diff] [blame] | 315 | " .msg { margin-top:10px; margin-bottom:10px }\n" |
Ted Kremenek | 2f10398 | 2009-03-02 21:42:01 +0000 | [diff] [blame] | 316 | " .msg { font-weight:bold }\n" |
Ted Kremenek | 80bae76 | 2009-03-02 23:05:40 +0000 | [diff] [blame] | 317 | " .msg { max-width:60em; word-wrap: break-word; white-space: pre-wrap }\n" |
| 318 | " .msgT { padding:0x; spacing:0x }\n" |
Ted Kremenek | 2f10398 | 2009-03-02 21:42:01 +0000 | [diff] [blame] | 319 | " .msgEvent { background-color:#fff8b4; color:#000000 }\n" |
Ted Kremenek | 80bae76 | 2009-03-02 23:05:40 +0000 | [diff] [blame] | 320 | " .msgControl { background-color:#bbbbbb; color:#000000 }\n" |
Ted Kremenek | 70bcba6 | 2008-04-09 15:40:40 +0000 | [diff] [blame] | 321 | " .mrange { background-color:#dfddf3 }\n" |
| 322 | " .mrange { border-bottom:1px solid #6F9DBE }\n" |
Ted Kremenek | 3c59823 | 2009-03-03 03:00:21 +0000 | [diff] [blame] | 323 | " .PathIndex { font-weight: bold; padding:0px 5px 0px 5px; " |
| 324 | "margin-right:5px; }\n" |
Ted Kremenek | 00f01e4 | 2009-03-02 23:39:27 +0000 | [diff] [blame] | 325 | " .PathIndex { -webkit-border-radius:8px }\n" |
| 326 | " .PathIndexEvent { background-color:#bfba87 }\n" |
| 327 | " .PathIndexControl { background-color:#8c8c8c }\n" |
Douglas Gregor | 4b2d3f7 | 2009-02-26 21:00:50 +0000 | [diff] [blame] | 328 | " .CodeInsertionHint { font-weight: bold; background-color: #10dd10 }\n" |
| 329 | " .CodeRemovalHint { background-color:#de1010 }\n" |
| 330 | " .CodeRemovalHint { border-bottom:1px solid #6F9DBE }\n" |
Ted Kremenek | 4b0f813 | 2008-04-15 21:25:08 +0000 | [diff] [blame] | 331 | " table.simpletable {\n" |
| 332 | " padding: 5px;\n" |
| 333 | " font-size:12pt;\n" |
| 334 | " margin:20px;\n" |
| 335 | " border-collapse: collapse; border-spacing: 0px;\n" |
| 336 | " }\n" |
| 337 | " td.rowname {\n" |
| 338 | " text-align:right; font-weight:bold; color:#444444;\n" |
| 339 | " padding-right:2ex; }\n" |
Ted Kremenek | f6f593f | 2008-07-07 18:31:05 +0000 | [diff] [blame] | 340 | "</style>\n</head>\n<body>"; |
Ted Kremenek | 70bcba6 | 2008-04-09 15:40:40 +0000 | [diff] [blame] | 341 | |
Ted Kremenek | f6f593f | 2008-07-07 18:31:05 +0000 | [diff] [blame] | 342 | // Generate header |
| 343 | R.InsertStrBefore(StartLoc, os.str()); |
Ted Kremenek | ad0a203 | 2008-03-19 06:14:37 +0000 | [diff] [blame] | 344 | // Generate footer |
| 345 | |
Ted Kremenek | 70bcba6 | 2008-04-09 15:40:40 +0000 | [diff] [blame] | 346 | R.InsertCStrAfter(EndLoc, "</body></html>\n"); |
Ted Kremenek | ad0a203 | 2008-03-19 06:14:37 +0000 | [diff] [blame] | 347 | } |
Chris Lattner | 3245a0a | 2008-04-16 06:11:58 +0000 | [diff] [blame] | 348 | |
| 349 | /// SyntaxHighlight - Relex the specified FileID and annotate the HTML with |
| 350 | /// information about keywords, macro expansions etc. This uses the macro |
| 351 | /// table state from the end of the file, so it won't be perfectly perfect, |
| 352 | /// but it will be reasonably close. |
Chris Lattner | 2b2453a | 2009-01-17 06:22:33 +0000 | [diff] [blame] | 353 | void html::SyntaxHighlight(Rewriter &R, FileID FID, Preprocessor &PP) { |
| 354 | RewriteBuffer &RB = R.getEditBuffer(FID); |
Chris Lattner | 3245a0a | 2008-04-16 06:11:58 +0000 | [diff] [blame] | 355 | |
Chris Lattner | 05db427 | 2009-02-13 19:33:24 +0000 | [diff] [blame] | 356 | const SourceManager &SM = PP.getSourceManager(); |
| 357 | Lexer L(FID, SM, PP.getLangOptions()); |
Chris Lattner | 025c3a6 | 2009-01-17 07:35:14 +0000 | [diff] [blame] | 358 | const char *BufferStart = L.getBufferStart(); |
Chris Lattner | a745e8c | 2008-04-16 20:51:51 +0000 | [diff] [blame] | 359 | |
Chris Lattner | 3245a0a | 2008-04-16 06:11:58 +0000 | [diff] [blame] | 360 | // Inform the preprocessor that we want to retain comments as tokens, so we |
| 361 | // can highlight them. |
Chris Lattner | 678c635 | 2008-04-16 20:54:51 +0000 | [diff] [blame] | 362 | L.SetCommentRetentionState(true); |
Chris Lattner | 3245a0a | 2008-04-16 06:11:58 +0000 | [diff] [blame] | 363 | |
Chris Lattner | c54d50a | 2008-04-16 06:32:08 +0000 | [diff] [blame] | 364 | // Lex all the tokens in raw mode, to avoid entering #includes or expanding |
| 365 | // macros. |
Chris Lattner | 3245a0a | 2008-04-16 06:11:58 +0000 | [diff] [blame] | 366 | Token Tok; |
Chris Lattner | 590f0cc | 2008-10-12 01:15:46 +0000 | [diff] [blame] | 367 | L.LexFromRawLexer(Tok); |
Chris Lattner | 74ea3e5 | 2008-04-16 06:53:09 +0000 | [diff] [blame] | 368 | |
Chris Lattner | 74ea3e5 | 2008-04-16 06:53:09 +0000 | [diff] [blame] | 369 | while (Tok.isNot(tok::eof)) { |
| 370 | // Since we are lexing unexpanded tokens, all tokens are from the main |
| 371 | // FileID. |
Chris Lattner | 05db427 | 2009-02-13 19:33:24 +0000 | [diff] [blame] | 372 | unsigned TokOffs = SM.getFileOffset(Tok.getLocation()); |
Chris Lattner | 3245a0a | 2008-04-16 06:11:58 +0000 | [diff] [blame] | 373 | unsigned TokLen = Tok.getLength(); |
| 374 | switch (Tok.getKind()) { |
Chris Lattner | a745e8c | 2008-04-16 20:51:51 +0000 | [diff] [blame] | 375 | default: break; |
| 376 | case tok::identifier: { |
| 377 | // Fill in Result.IdentifierInfo, looking up the identifier in the |
| 378 | // identifier table. |
| 379 | IdentifierInfo *II = PP.LookUpIdentifierInfo(Tok, BufferStart+TokOffs); |
| 380 | |
| 381 | // If this is a pp-identifier, for a keyword, highlight it as such. |
Chris Lattner | 5ef3e2c | 2008-04-16 22:45:51 +0000 | [diff] [blame] | 382 | if (II->getTokenID() != tok::identifier) |
| 383 | HighlightRange(RB, TokOffs, TokOffs+TokLen, BufferStart, |
| 384 | "<span class='keyword'>", "</span>"); |
Chris Lattner | c4586c2 | 2008-04-16 06:35:07 +0000 | [diff] [blame] | 385 | break; |
Chris Lattner | a745e8c | 2008-04-16 20:51:51 +0000 | [diff] [blame] | 386 | } |
Chris Lattner | 3245a0a | 2008-04-16 06:11:58 +0000 | [diff] [blame] | 387 | case tok::comment: |
Chris Lattner | 5ef3e2c | 2008-04-16 22:45:51 +0000 | [diff] [blame] | 388 | HighlightRange(RB, TokOffs, TokOffs+TokLen, BufferStart, |
| 389 | "<span class='comment'>", "</span>"); |
Chris Lattner | 3245a0a | 2008-04-16 06:11:58 +0000 | [diff] [blame] | 390 | break; |
Ted Kremenek | cc1b853 | 2008-08-31 16:37:56 +0000 | [diff] [blame] | 391 | case tok::wide_string_literal: |
| 392 | // Chop off the L prefix |
| 393 | ++TokOffs; |
| 394 | --TokLen; |
| 395 | // FALL THROUGH. |
| 396 | case tok::string_literal: |
| 397 | HighlightRange(RB, TokOffs, TokOffs+TokLen, BufferStart, |
| 398 | "<span class='string_literal'>", "</span>"); |
| 399 | break; |
Chris Lattner | 5deb96d | 2008-04-16 23:21:17 +0000 | [diff] [blame] | 400 | case tok::hash: { |
Chris Lattner | 74ea3e5 | 2008-04-16 06:53:09 +0000 | [diff] [blame] | 401 | // If this is a preprocessor directive, all tokens to end of line are too. |
Chris Lattner | 5deb96d | 2008-04-16 23:21:17 +0000 | [diff] [blame] | 402 | if (!Tok.isAtStartOfLine()) |
| 403 | break; |
| 404 | |
| 405 | // Eat all of the tokens until we get to the next one at the start of |
| 406 | // line. |
| 407 | unsigned TokEnd = TokOffs+TokLen; |
Chris Lattner | 590f0cc | 2008-10-12 01:15:46 +0000 | [diff] [blame] | 408 | L.LexFromRawLexer(Tok); |
Chris Lattner | 5deb96d | 2008-04-16 23:21:17 +0000 | [diff] [blame] | 409 | while (!Tok.isAtStartOfLine() && Tok.isNot(tok::eof)) { |
Chris Lattner | 05db427 | 2009-02-13 19:33:24 +0000 | [diff] [blame] | 410 | TokEnd = SM.getFileOffset(Tok.getLocation())+Tok.getLength(); |
Chris Lattner | 590f0cc | 2008-10-12 01:15:46 +0000 | [diff] [blame] | 411 | L.LexFromRawLexer(Tok); |
Chris Lattner | 74ea3e5 | 2008-04-16 06:53:09 +0000 | [diff] [blame] | 412 | } |
Chris Lattner | 5deb96d | 2008-04-16 23:21:17 +0000 | [diff] [blame] | 413 | |
| 414 | // Find end of line. This is a hack. |
| 415 | HighlightRange(RB, TokOffs, TokEnd, BufferStart, |
| 416 | "<span class='directive'>", "</span>"); |
| 417 | |
| 418 | // Don't skip the next token. |
| 419 | continue; |
| 420 | } |
Chris Lattner | 3245a0a | 2008-04-16 06:11:58 +0000 | [diff] [blame] | 421 | } |
| 422 | |
Chris Lattner | 590f0cc | 2008-10-12 01:15:46 +0000 | [diff] [blame] | 423 | L.LexFromRawLexer(Tok); |
Chris Lattner | 74ea3e5 | 2008-04-16 06:53:09 +0000 | [diff] [blame] | 424 | } |
Chris Lattner | 3245a0a | 2008-04-16 06:11:58 +0000 | [diff] [blame] | 425 | } |
Chris Lattner | c54d50a | 2008-04-16 06:32:08 +0000 | [diff] [blame] | 426 | |
| 427 | /// HighlightMacros - This uses the macro table state from the end of the |
Chris Lattner | 05db427 | 2009-02-13 19:33:24 +0000 | [diff] [blame] | 428 | /// file, to re-expand macros and insert (into the HTML) information about the |
Chris Lattner | c54d50a | 2008-04-16 06:32:08 +0000 | [diff] [blame] | 429 | /// macro expansions. This won't be perfectly perfect, but it will be |
| 430 | /// reasonably close. |
Chris Lattner | 2b2453a | 2009-01-17 06:22:33 +0000 | [diff] [blame] | 431 | void html::HighlightMacros(Rewriter &R, FileID FID, Preprocessor& PP) { |
Chris Lattner | 05db427 | 2009-02-13 19:33:24 +0000 | [diff] [blame] | 432 | // Re-lex the raw token stream into a token buffer. |
| 433 | const SourceManager &SM = PP.getSourceManager(); |
| 434 | std::vector<Token> TokenStream; |
| 435 | |
| 436 | Lexer L(FID, SM, PP.getLangOptions()); |
| 437 | |
| 438 | // Lex all the tokens in raw mode, to avoid entering #includes or expanding |
| 439 | // macros. |
| 440 | while (1) { |
| 441 | Token Tok; |
| 442 | L.LexFromRawLexer(Tok); |
| 443 | |
| 444 | // If this is a # at the start of a line, discard it from the token stream. |
| 445 | // We don't want the re-preprocess step to see #defines, #includes or other |
| 446 | // preprocessor directives. |
| 447 | if (Tok.is(tok::hash) && Tok.isAtStartOfLine()) |
| 448 | continue; |
Chris Lattner | f0b26b1 | 2009-02-24 05:29:33 +0000 | [diff] [blame] | 449 | |
| 450 | // If this is a ## token, change its kind to unknown so that repreprocessing |
| 451 | // it will not produce an error. |
| 452 | if (Tok.is(tok::hashhash)) |
| 453 | Tok.setKind(tok::unknown); |
Chris Lattner | 05db427 | 2009-02-13 19:33:24 +0000 | [diff] [blame] | 454 | |
| 455 | // If this raw token is an identifier, the raw lexer won't have looked up |
| 456 | // the corresponding identifier info for it. Do this now so that it will be |
| 457 | // macro expanded when we re-preprocess it. |
| 458 | if (Tok.is(tok::identifier)) { |
| 459 | // Change the kind of this identifier to the appropriate token kind, e.g. |
| 460 | // turning "for" into a keyword. |
| 461 | Tok.setKind(PP.LookUpIdentifierInfo(Tok)->getTokenID()); |
| 462 | } |
| 463 | |
| 464 | TokenStream.push_back(Tok); |
| 465 | |
| 466 | if (Tok.is(tok::eof)) break; |
| 467 | } |
| 468 | |
Chris Lattner | c54d50a | 2008-04-16 06:32:08 +0000 | [diff] [blame] | 469 | // Inform the preprocessor that we don't want comments. |
Ted Kremenek | fb58609 | 2008-04-18 05:34:33 +0000 | [diff] [blame] | 470 | PP.SetCommentRetentionState(false, false); |
Chris Lattner | 05db427 | 2009-02-13 19:33:24 +0000 | [diff] [blame] | 471 | |
| 472 | // Enter the tokens we just lexed. This will cause them to be macro expanded |
| 473 | // but won't enter sub-files (because we removed #'s). |
| 474 | PP.EnterTokenStream(&TokenStream[0], TokenStream.size(), false, false); |
Chris Lattner | c54d50a | 2008-04-16 06:32:08 +0000 | [diff] [blame] | 475 | |
Chris Lattner | 867924d | 2009-02-13 00:51:30 +0000 | [diff] [blame] | 476 | TokenConcatenation ConcatInfo(PP); |
| 477 | |
Chris Lattner | c54d50a | 2008-04-16 06:32:08 +0000 | [diff] [blame] | 478 | // Lex all the tokens. |
Chris Lattner | c54d50a | 2008-04-16 06:32:08 +0000 | [diff] [blame] | 479 | Token Tok; |
Ted Kremenek | fb58609 | 2008-04-18 05:34:33 +0000 | [diff] [blame] | 480 | PP.Lex(Tok); |
Chris Lattner | c54d50a | 2008-04-16 06:32:08 +0000 | [diff] [blame] | 481 | while (Tok.isNot(tok::eof)) { |
| 482 | // Ignore non-macro tokens. |
| 483 | if (!Tok.getLocation().isMacroID()) { |
Ted Kremenek | fb58609 | 2008-04-18 05:34:33 +0000 | [diff] [blame] | 484 | PP.Lex(Tok); |
Chris Lattner | c54d50a | 2008-04-16 06:32:08 +0000 | [diff] [blame] | 485 | continue; |
| 486 | } |
| 487 | |
Chris Lattner | b7949a9 | 2009-02-15 21:32:34 +0000 | [diff] [blame] | 488 | // Okay, we have the first token of a macro expansion: highlight the |
| 489 | // instantiation by inserting a start tag before the macro instantiation and |
| 490 | // end tag after it. |
| 491 | std::pair<SourceLocation, SourceLocation> LLoc = |
| 492 | SM.getInstantiationRange(Tok.getLocation()); |
Chris Lattner | c54d50a | 2008-04-16 06:32:08 +0000 | [diff] [blame] | 493 | |
Chris Lattner | b7949a9 | 2009-02-15 21:32:34 +0000 | [diff] [blame] | 494 | // Ignore tokens whose instantiation location was not the main file. |
| 495 | if (SM.getFileID(LLoc.first) != FID) { |
Ted Kremenek | fb58609 | 2008-04-18 05:34:33 +0000 | [diff] [blame] | 496 | PP.Lex(Tok); |
Chris Lattner | c54d50a | 2008-04-16 06:32:08 +0000 | [diff] [blame] | 497 | continue; |
| 498 | } |
Chris Lattner | b7949a9 | 2009-02-15 21:32:34 +0000 | [diff] [blame] | 499 | |
Chris Lattner | b7949a9 | 2009-02-15 21:32:34 +0000 | [diff] [blame] | 500 | assert(SM.getFileID(LLoc.second) == FID && |
| 501 | "Start and end of expansion must be in the same ultimate file!"); |
Chris Lattner | e9e6cb9 | 2009-02-17 00:51:07 +0000 | [diff] [blame] | 502 | |
Ted Kremenek | fb58609 | 2008-04-18 05:34:33 +0000 | [diff] [blame] | 503 | std::string Expansion = PP.getSpelling(Tok); |
Chris Lattner | 6f46be2 | 2008-04-17 00:40:45 +0000 | [diff] [blame] | 504 | unsigned LineLen = Expansion.size(); |
| 505 | |
Chris Lattner | 867924d | 2009-02-13 00:51:30 +0000 | [diff] [blame] | 506 | Token PrevTok = Tok; |
Chris Lattner | c54d50a | 2008-04-16 06:32:08 +0000 | [diff] [blame] | 507 | // Okay, eat this token, getting the next one. |
Ted Kremenek | fb58609 | 2008-04-18 05:34:33 +0000 | [diff] [blame] | 508 | PP.Lex(Tok); |
Chris Lattner | c54d50a | 2008-04-16 06:32:08 +0000 | [diff] [blame] | 509 | |
| 510 | // Skip all the rest of the tokens that are part of this macro |
| 511 | // instantiation. It would be really nice to pop up a window with all the |
| 512 | // spelling of the tokens or something. |
| 513 | while (!Tok.is(tok::eof) && |
Chris Lattner | b7949a9 | 2009-02-15 21:32:34 +0000 | [diff] [blame] | 514 | SM.getInstantiationLoc(Tok.getLocation()) == LLoc.first) { |
Chris Lattner | 6f46be2 | 2008-04-17 00:40:45 +0000 | [diff] [blame] | 515 | // Insert a newline if the macro expansion is getting large. |
| 516 | if (LineLen > 60) { |
| 517 | Expansion += "<br>"; |
| 518 | LineLen = 0; |
| 519 | } |
| 520 | |
| 521 | LineLen -= Expansion.size(); |
Chris Lattner | 867924d | 2009-02-13 00:51:30 +0000 | [diff] [blame] | 522 | |
| 523 | // If the tokens were already space separated, or if they must be to avoid |
| 524 | // them being implicitly pasted, add a space between them. |
| 525 | if (Tok.hasLeadingSpace() || |
| 526 | ConcatInfo.AvoidConcat(PrevTok, Tok)) |
| 527 | Expansion += ' '; |
| 528 | |
Chris Lattner | 9227c69 | 2008-04-17 23:03:14 +0000 | [diff] [blame] | 529 | // Escape any special characters in the token text. |
Chris Lattner | 867924d | 2009-02-13 00:51:30 +0000 | [diff] [blame] | 530 | Expansion += EscapeText(PP.getSpelling(Tok)); |
Chris Lattner | 6f46be2 | 2008-04-17 00:40:45 +0000 | [diff] [blame] | 531 | LineLen += Expansion.size(); |
Chris Lattner | 867924d | 2009-02-13 00:51:30 +0000 | [diff] [blame] | 532 | |
| 533 | PrevTok = Tok; |
Ted Kremenek | fb58609 | 2008-04-18 05:34:33 +0000 | [diff] [blame] | 534 | PP.Lex(Tok); |
Chris Lattner | 6f46be2 | 2008-04-17 00:40:45 +0000 | [diff] [blame] | 535 | } |
Chris Lattner | 9227c69 | 2008-04-17 23:03:14 +0000 | [diff] [blame] | 536 | |
Chris Lattner | e9e6cb9 | 2009-02-17 00:51:07 +0000 | [diff] [blame] | 537 | |
| 538 | // Insert the expansion as the end tag, so that multi-line macros all get |
| 539 | // highlighted. |
| 540 | Expansion = "<span class='expansion'>" + Expansion + "</span></span>"; |
| 541 | |
| 542 | HighlightRange(R, LLoc.first, LLoc.second, |
| 543 | "<span class='macro'>", Expansion.c_str()); |
Chris Lattner | c54d50a | 2008-04-16 06:32:08 +0000 | [diff] [blame] | 544 | } |
| 545 | } |
| 546 | |
Chris Lattner | 2b2453a | 2009-01-17 06:22:33 +0000 | [diff] [blame] | 547 | void html::HighlightMacros(Rewriter &R, FileID FID, |
Ted Kremenek | fb58609 | 2008-04-18 05:34:33 +0000 | [diff] [blame] | 548 | PreprocessorFactory &PPF) { |
| 549 | |
| 550 | llvm::OwningPtr<Preprocessor> PP(PPF.CreatePreprocessor()); |
Chris Lattner | 2b2453a | 2009-01-17 06:22:33 +0000 | [diff] [blame] | 551 | HighlightMacros(R, FID, *PP); |
Ted Kremenek | fb58609 | 2008-04-18 05:34:33 +0000 | [diff] [blame] | 552 | } |