From 82f1f744f89025b0fc1f2260035829ac0a45906b Mon Sep 17 00:00:00 2001 From: Cary Clark Date: Thu, 28 Jun 2018 08:50:35 -0400 Subject: fix doc catalog The doc catalog (the thing that allows graphical example searches) got broken because bookmaker generated json names with linefeeds in them. Fix that and add an incremental update towards documenting SkRRect. R=caryclark@google.com Docs-Preview: https://skia.org/?cl=138020 Bug: skia:6898 Change-Id: I8e033d2d59fc9693f377be8c202bbf8ac9253b20 Reviewed-on: https://skia-review.googlesource.com/138020 Reviewed-by: Cary Clark Commit-Queue: Cary Clark Auto-Submit: Cary Clark --- tools/bookmaker/bookmaker.cpp | 4 ++++ tools/bookmaker/includeParser.cpp | 4 ++++ tools/bookmaker/includeWriter.cpp | 4 ++++ 3 files changed, 12 insertions(+) (limited to 'tools/bookmaker') diff --git a/tools/bookmaker/bookmaker.cpp b/tools/bookmaker/bookmaker.cpp index 58c73e663f..15598be95f 100644 --- a/tools/bookmaker/bookmaker.cpp +++ b/tools/bookmaker/bookmaker.cpp @@ -318,6 +318,7 @@ bool BmhParser::addDefinition(const char* defStart, bool hasEnd, MarkType markTy // fRoot->fChildren.push_back(definition); } } + SkASSERT(string::npos == name.find('\n')); definition->fName = name; if (MarkType::kMethod == markType) { if (string::npos != name.find(':', 0)) { @@ -1837,6 +1838,9 @@ string BmhParser::methodName() { saveState.restore(); } // this->next(); + if (string::npos != builder.find('\n')) { + builder.erase(std::remove(builder.begin(), builder.end(), '\n'), builder.end()); + } return uniqueRootName(builder, MarkType::kMethod); } diff --git a/tools/bookmaker/includeParser.cpp b/tools/bookmaker/includeParser.cpp index fdaf0ccfe2..716d90afeb 100644 --- a/tools/bookmaker/includeParser.cpp +++ b/tools/bookmaker/includeParser.cpp @@ -278,6 +278,10 @@ bool IncludeParser::crossCheck(BmhParser& bmhParser) { string paramName = className + "::"; paramName += string(token.fContentStart, token.fContentEnd - token.fContentStart); + if (string::npos != paramName.find('\n')) { + paramName.erase(std::remove(paramName.begin(), paramName.end(), '\n'), + paramName.end()); + } def = root->find(paramName, RootDefinition::AllowParens::kYes); if (!def && 0 == token.fName.find("operator")) { string operatorName = className + "::"; diff --git a/tools/bookmaker/includeWriter.cpp b/tools/bookmaker/includeWriter.cpp index cd67be0f5d..18beff4809 100644 --- a/tools/bookmaker/includeWriter.cpp +++ b/tools/bookmaker/includeWriter.cpp @@ -1465,6 +1465,10 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti --continueEnd; } methodName += string(fContinuation, continueEnd - fContinuation); + if (string::npos != methodName.find('\n')) { + methodName.erase(std::remove(methodName.begin(), methodName.end(), '\n'), + methodName.end()); + } method = this->findMethod(methodName, root); if (!method) { if (fBmhStructDef && fBmhStructDef->fDeprecated) { -- cgit v1.2.3