aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/bookmaker/includeParser.cpp
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2018-04-03 08:43:27 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-04-03 16:09:56 +0000
commit186d08f621efcaf9960ffe4a1dd9e6703de8a698 (patch)
tree7087f2b1a18ef61e26103389a3aab051c9d923f3 /tools/bookmaker/includeParser.cpp
parentba31640427659ea2c096be1a26976e34348619cf (diff)
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>
Diffstat (limited to 'tools/bookmaker/includeParser.cpp')
-rw-r--r--tools/bookmaker/includeParser.cpp28
1 files changed, 23 insertions, 5 deletions
diff --git a/tools/bookmaker/includeParser.cpp b/tools/bookmaker/includeParser.cpp
index 8365a82d1c..4040fb6d15 100644
--- a/tools/bookmaker/includeParser.cpp
+++ b/tools/bookmaker/includeParser.cpp
@@ -1363,9 +1363,6 @@ bool IncludeParser::parseEnum(Definition* child, Definition* markupDef) {
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 @@ bool IncludeParser::parseEnum(Definition* child, Definition* markupDef) {
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 @@ bool IncludeParser::parseChar() {
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 @@ void IncludeParser::validate() const {
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);