General clean up on bookmaker.
Command line runs without error for
SkBitmap, SkPath, SkRect, SkIRect,
SkPixmap, SkCanvas.
Docs-Preview: https://skia.org/?cl=57112
TBR: caryclark@google.com
Bug: skia:6898
Change-Id: I73b69ae8ffdf0a1e6bc187dc8a9dfb28f7766faa
Reviewed-on: https://skia-review.googlesource.com/57112
Reviewed-by: Cary Clark <caryclark@skia.org>
Commit-Queue: Cary Clark <caryclark@skia.org>
diff --git a/tools/bookmaker/includeWriter.cpp b/tools/bookmaker/includeWriter.cpp
index 3821361..ff7c0e3 100644
--- a/tools/bookmaker/includeWriter.cpp
+++ b/tools/bookmaker/includeWriter.cpp
@@ -673,7 +673,7 @@
return valueEnd;
}
-void IncludeWriter::structSizeMembers(Definition& child) {
+void IncludeWriter::structSizeMembers(const Definition& child) {
int longestType = 0;
Definition* typeStart = nullptr;
int longestName = 0;
@@ -815,6 +815,7 @@
fContinuation = nullptr;
bool inStruct = false;
bool inConstructor = false;
+ bool inInline = false;
for (auto& child : def->fTokens) {
if (memberEnd) {
if (memberEnd != &child) {
@@ -824,8 +825,34 @@
memberEnd = nullptr;
}
if (child.fPrivate) {
+ if (MarkType::kMethod == child.fMarkType) {
+ inInline = true;
+ }
continue;
}
+ if (inInline) {
+ if (Definition::Type::kKeyWord == child.fType) {
+ SkASSERT(MarkType::kMethod != child.fMarkType);
+ continue;
+ }
+ if (Definition::Type::kPunctuation == child.fType) {
+ if (Punctuation::kLeftBrace == child.fPunctuation) {
+ inInline = false;
+ } else {
+ SkASSERT(Punctuation::kAsterisk == child.fPunctuation);
+ }
+ continue;
+ }
+ if (Definition::Type::kWord == child.fType) {
+ string name(child.fContentStart, child.fContentEnd - child.fContentStart);
+ SkASSERT(string::npos != name.find("::"));
+ continue;
+ }
+ if (Definition::Type::kBracket == child.fType) {
+ SkASSERT(Bracket::kParen == child.fBracket);
+ continue;
+ }
+ }
if (fContinuation) {
if (Definition::Type::kKeyWord == child.fType) {
if (KeyWord::kFriend == child.fKeyWord ||
@@ -1131,6 +1158,16 @@
}
if (Definition::Type::kWord == child.fType) {
if (MarkType::kMember == child.fMarkType) {
+ if (!memberStart) {
+ auto iter = def->fTokens.begin();
+ std::advance(iter, child.fParentIndex - 1);
+ memberStart = &*iter;
+ if (!fStructDef) {
+ SkASSERT(KeyWord::kStruct == def->fParent->fKeyWord);
+ fStructDef = def->fParent;
+ this->structSizeMembers(*fStructDef);
+ }
+ }
memberEnd = this->structMemberOut(memberStart, child);
fStart = child.fContentEnd + 1;
fDeferComment = nullptr;