aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/bookmaker/includeParser.cpp
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2018-05-30 09:21:49 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-05-30 13:46:38 +0000
commit137b87485508e3882968a10559c2cb389dcc93c5 (patch)
tree7f45aec7b2f0252830ef7d417b71e87bfcc9e299 /tools/bookmaker/includeParser.cpp
parent594b64c4851c82597b3a2045062efad42039d461 (diff)
generate include comments
- formalize how aliases and substitutions work together - add constexpr, #define, typedef support - check for correct description order - write short enum, struct members R=caryclark@google.com Docs-Preview: https://skia.org/?cl=129455 Bug: skia:6898 Change-Id: Id60fc2ed02f38a7ba4e5cad5ef493d8c674e6183 Reviewed-on: https://skia-review.googlesource.com/129455 Commit-Queue: Cary Clark <caryclark@skia.org> Reviewed-by: Cary Clark <caryclark@skia.org> Auto-Submit: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'tools/bookmaker/includeParser.cpp')
-rw-r--r--tools/bookmaker/includeParser.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/tools/bookmaker/includeParser.cpp b/tools/bookmaker/includeParser.cpp
index 12bd787eb8..56de4f6f15 100644
--- a/tools/bookmaker/includeParser.cpp
+++ b/tools/bookmaker/includeParser.cpp
@@ -1276,7 +1276,7 @@ bool IncludeParser::findComments(const Definition& includeDef, Definition* marku
return true;
}
-// caller calls reportError, so just return false here
+// caller just returns, so report error here
bool IncludeParser::parseClass(Definition* includeDef, IsStruct isStruct) {
SkASSERT(includeDef->fTokens.size() > 0);
// parse class header
@@ -1323,15 +1323,11 @@ bool IncludeParser::parseClass(Definition* includeDef, IsStruct isStruct) {
while (iter != includeDef->fTokens.end()
&& (publicLen != (size_t) (iter->fContentEnd - iter->fStart)
|| strncmp(iter->fStart, publicName, publicLen))) {
+ iter->fPrivate = true;
iter = std::next(iter);
++publicIndex;
}
}
- auto childIter = includeDef->fChildren.begin();
- while (childIter != includeDef->fChildren.end() && (*childIter)->fParentIndex < publicIndex) {
- (*childIter)->fPrivate = true;
- childIter = std::next(childIter);
- }
int keyIndex = publicIndex;
KeyWord currentKey = KeyWord::kPublic;
const char* publicName = kKeyWords[(int) KeyWord::kPublic].fName;
@@ -1340,9 +1336,12 @@ bool IncludeParser::parseClass(Definition* includeDef, IsStruct isStruct) {
size_t protectedLen = strlen(protectedName);
const char* privateName = kKeyWords[(int) KeyWord::kPrivate].fName;
size_t privateLen = strlen(privateName);
+ auto childIter = includeDef->fChildren.begin();
+ std::advance(childIter, publicIndex);
while (childIter != includeDef->fChildren.end()) {
Definition* child = *childIter;
while (child->fParentIndex > keyIndex && iter != includeDef->fTokens.end()) {
+ iter->fPrivate = KeyWord::kPublic != currentKey;
const char* testStart = iter->fStart;
size_t testLen = (size_t) (iter->fContentEnd - testStart);
iter = std::next(iter);
@@ -1365,12 +1364,14 @@ bool IncludeParser::parseClass(Definition* includeDef, IsStruct isStruct) {
if (!this->parseObject(child, markupDef)) {
return false;
}
- } else {
- child->fPrivate = true;
}
fLastObject = child;
childIter = std::next(childIter);
}
+ while (iter != includeDef->fTokens.end()) {
+ iter->fPrivate = KeyWord::kPublic != currentKey;
+ iter = std::next(iter);
+ }
SkASSERT(fParent->fParent);
fParent = fParent->fParent;
return true;