aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/bookmaker/includeWriter.cpp
diff options
context:
space:
mode:
authorGravatar Cary Clark <caryclark@skia.org>2018-02-06 09:41:53 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-02-06 15:20:25 +0000
commit4855f78dd16ad50003ec537c98062e24a831cd45 (patch)
tree9566730a4f8416078131a0dc8255aecdeb9e3bf3 /tools/bookmaker/includeWriter.cpp
parent2aa5bab573cff2d9bfb40f7af6014a93bf2d4fda (diff)
fix bookmaker nightly
- mark the interfaces that use SkMask as deprecated - add more autogenerated subtopics - make subtopic names singular, avoiding collision with Skia names - simplify #Deprecated and #Bug tags - add "#Deprecated soon" to note things to be deprecated - fix some spelling errors - refresh web docs - add self-check functionality to find methods outside subtopics TBR=caryclark@google.com Docs-Preview: https://skia.org/?cl=102150 Bug: skia:6898 Change-Id: I0e742a56d49dccd4409bb68eed9167c8ad7611ce Reviewed-on: https://skia-review.googlesource.com/102150 Commit-Queue: Cary Clark <caryclark@skia.org> Reviewed-by: Cary Clark <caryclark@skia.org>
Diffstat (limited to 'tools/bookmaker/includeWriter.cpp')
-rw-r--r--tools/bookmaker/includeWriter.cpp38
1 files changed, 30 insertions, 8 deletions
diff --git a/tools/bookmaker/includeWriter.cpp b/tools/bookmaker/includeWriter.cpp
index ba93d3e615..77baca0016 100644
--- a/tools/bookmaker/includeWriter.cpp
+++ b/tools/bookmaker/includeWriter.cpp
@@ -53,6 +53,13 @@ void IncludeWriter::descriptionOut(const Definition* def) {
commentStart = prop->fTerminator;
break;
case MarkType::kDeprecated:
+ SkASSERT(def->fDeprecated);
+ if (def->fToBeDeprecated) {
+ this->writeString("To be deprecated soon.");
+ } else {
+ this->writeString("Deprecated.");
+ }
+ this->lfcr();
case MarkType::kPrivate:
commentLen = (int) (prop->fStart - commentStart);
if (commentLen > 0) {
@@ -62,6 +69,9 @@ void IncludeWriter::descriptionOut(const Definition* def) {
}
}
commentStart = prop->fContentStart;
+ if (def->fToBeDeprecated) {
+ commentStart += 4; // skip over "soon" // FIXME: this is awkward
+ }
commentLen = (int) (prop->fContentEnd - commentStart);
if (commentLen > 0) {
this->writeBlockIndent(commentLen, commentStart);
@@ -159,7 +169,7 @@ void IncludeWriter::descriptionOut(const Definition* def) {
break;
}
}
- SkASSERT(wroteCode || (commentLen > 0 && commentLen < 1500));
+ SkASSERT(wroteCode || (commentLen > 0 && commentLen < 1500) || def->fDeprecated);
if (commentLen > 0) {
this->rewriteBlock(commentLen, commentStart, Phrase::kNo);
}
@@ -440,23 +450,35 @@ void IncludeWriter::enumMembersOut(const RootDefinition* root, Definition& child
commentEnd = currentEnumItem->fContentEnd;
}
TextParser enumComment(fFileName, commentStart, commentEnd, currentEnumItem->fLineCount);
+ bool isDeprecated = false;
if (enumComment.skipToLineStart()) { // skip const value
commentStart = enumComment.fChar;
commentLen = (int) (commentEnd - commentStart);
} else {
- const Definition* privateDef = currentEnumItem->fChildren[0];
- SkASSERT(MarkType::kPrivate == privateDef->fMarkType);
- commentStart = privateDef->fContentStart;
- commentLen = (int) (privateDef->fContentEnd - privateDef->fContentStart);
+ const Definition* childDef = currentEnumItem->fChildren[0];
+ isDeprecated = MarkType::kDeprecated == childDef->fMarkType;
+ if (MarkType::kPrivate == childDef->fMarkType || isDeprecated) {
+ commentStart = childDef->fContentStart;
+ if (currentEnumItem->fToBeDeprecated) {
+ SkASSERT(isDeprecated);
+ commentStart += 4; // skip over "soon" // FIXME: this is awkward
+ }
+ commentLen = (int) (childDef->fContentEnd - commentStart);
+ }
}
// FIXME: may assert here if there's no const value
// should have detected and errored on that earlier when enum fContentStart was set
- SkASSERT(commentLen > 0 && commentLen < 1000);
+ SkASSERT((commentLen > 0 && commentLen < 1000) || isDeprecated);
if (!currentEnumItem->fShort) {
this->writeCommentHeader();
fIndent += 4;
- bool wroteLineFeed = Wrote::kLF ==
- this->rewriteBlock(commentLen, commentStart, Phrase::kNo);
+ bool wroteLineFeed = false;
+ if (isDeprecated) {
+ this->writeString(currentEnumItem->fToBeDeprecated
+ ? "To be deprecated soon." : "Deprecated.");
+ }
+ wroteLineFeed = Wrote::kLF ==
+ this->rewriteBlock(commentLen, commentStart, Phrase::kNo);
fIndent -= 4;
if (wroteLineFeed || fColumn > 100 - 3 /* space * / */ ) {
this->lfcr();