fix bugs exposed by documenting SkImageInfo

- More rigorous symbol identification creates additional
links, and finds spurious errors like unnecessary
parentheses.

- Fixed code to allow preprocessor directives in
#Code blocks (still more to do).

- Fixed examples waiting on fiddle updates.

- Make SkImageInfo officially documented (update in status.json).

- Fixed enum indentation.



Docs-Preview: https://skia.org/?cl=115656
Bug: skia:6898
Change-Id: Ifcf5cfd3f6c03b3b83155c898b2b035a2f3d443c
Reviewed-on: https://skia-review.googlesource.com/115656
Commit-Queue: Cary Clark <caryclark@skia.org>
Reviewed-by: Cary Clark <caryclark@skia.org>
diff --git a/tools/bookmaker/includeParser.cpp b/tools/bookmaker/includeParser.cpp
index 8365a82..4040fb6 100644
--- a/tools/bookmaker/includeParser.cpp
+++ b/tools/bookmaker/includeParser.cpp
@@ -1363,9 +1363,6 @@
         markupChild->fName = markupDef->fName + "::" +
                 string(nameStart, (size_t) (enumName.fChar - nameStart));
     }
-    if (string::npos != markupChild->fName.find("SkColorType")) {
-        SkDebugf("");
-    }
     if (!this->findComments(*child, markupChild)) {
         return false;
     }
@@ -1433,7 +1430,7 @@
         if ('/' == parser.next()) {
             char slashStar = parser.next();
             if ('/' == slashStar || '*' == slashStar) {
-                TextParser::Save save(&parser);
+                TextParserSave save(&parser);
                 char doxCheck = parser.next();
                 if ((slashStar != doxCheck && '!' != doxCheck) || '<' != parser.next()) {
                     save.restore();
@@ -1954,7 +1951,7 @@
                     return reportError<bool>("malformed closing comment");
                 }
                 if (Bracket::kSlashStar == this->topBracket()) {
-                    TextParser::Save save(this);
+                    TextParserSave save(this);
                     this->next();  // include close in bracket
                     this->popBracket();
                     save.restore(); // put things back so nothing is skipped
@@ -2316,6 +2313,27 @@
     IncludeParser::ValidateKeyWords();
 }
 
+bool IncludeParser::references(const SkString& file) const {
+    // if includes weren't passed one at a time, assume all references are valid
+    if (fIncludeMap.empty()) {
+        return true;
+    }
+    SkASSERT(file.endsWith(".bmh") );
+    string root(file.c_str(), file.size() - 4);
+    string kReference("_Reference");
+    if (string::npos != root.find(kReference)) {
+        root = root.substr(0, root.length() - kReference.length());
+    }
+    if (fIClassMap.end() != fIClassMap.find(root)) {
+        return true;
+    }
+    if (fIStructMap.end() != fIStructMap.find(root)) {
+        return true;
+    }
+    // TODO incomplete: probably need to look in other places for class-less includes like SkColor.h
+    return false;
+}
+
 void IncludeParser::RemoveFile(const char* docs, const char* includes) {
     if (!sk_isdir(includes)) {
         IncludeParser::RemoveOneFile(docs, includes);