diff options
Diffstat (limited to 'tools/bookmaker/bookmaker.cpp')
-rw-r--r-- | tools/bookmaker/bookmaker.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/tools/bookmaker/bookmaker.cpp b/tools/bookmaker/bookmaker.cpp index 4d0c2d9171..33feda5a35 100644 --- a/tools/bookmaker/bookmaker.cpp +++ b/tools/bookmaker/bookmaker.cpp @@ -67,7 +67,7 @@ static size_t count_indent(const string& text, size_t test, size_t end) { return test - result; } -static void add_code(const string& text, int pos, int end, +static void add_code(const string& text, int pos, int end, size_t outIndent, size_t textIndent, string& example) { do { // fix this to move whole paragraph in, out, but preserve doc indent @@ -86,7 +86,7 @@ static void add_code(const string& text, int pos, int end, pos += nextIndent; while ((size_t) pos < len) { example += '"' == text[pos] ? "\\\"" : - '\\' == text[pos] ? "\\\\" : + '\\' == text[pos] ? "\\\\" : text.substr(pos, 1); ++pos; } @@ -121,14 +121,14 @@ void Definition::setCanonicalFiddle() { opPos += sizeof(operatorStr) - 1; if ('!' == fName[opPos]) { SkASSERT('=' == fName[opPos + 1]); - result += "not_equal_operator"; + result += "not_equal_operator"; } else if ('=' == fName[opPos]) { if ('(' == fName[opPos + 1]) { - result += isMove ? "move_" : "copy_"; - result += "assignment_operator"; + result += isMove ? "move_" : "copy_"; + result += "assignment_operator"; } else { SkASSERT('=' == fName[opPos + 1]); - result += "equal_operator"; + result += "equal_operator"; } } else if ('[' == fName[opPos]) { result += "subscript_operator"; @@ -160,7 +160,7 @@ void Definition::setCanonicalFiddle() { } while (true); if (base == methodName) { fMethodType = Definition::MethodType::kConstructor; - result += "empty_constructor"; + result += "empty_constructor"; } else { result += fName.substr(doubleColons, fName.length() - doubleColons - 2); } @@ -171,7 +171,7 @@ void Definition::setCanonicalFiddle() { } else { size_t comma = fName.find(',', doubleColons); if (string::npos == comma) { - result += isMove ? "move_" : "copy_"; + result += isMove ? "move_" : "copy_"; } fMethodType = Definition::MethodType::kConstructor; // name them by their param types, @@ -413,7 +413,7 @@ bool Definition::checkMethod() const { return methodParser.reportError<bool>("multiple #Param with same name"); } foundParam = true; - + } if (!foundParam && !foundException) { return methodParser.reportError<bool>("no #Param found"); @@ -688,7 +688,7 @@ string Definition::methodName() const { return fName.substr(start, end - start); } -bool Definition::nextMethodParam(TextParser* methodParser, const char** nextEndPtr, +bool Definition::nextMethodParam(TextParser* methodParser, const char** nextEndPtr, string* paramName) const { int parenCount = 0; TextParser::Save saveState(methodParser); @@ -804,7 +804,7 @@ bool Definition::paramsMatch(const string& match, const string& name) const { } def.skipWhiteSpace(); m.skipWhiteSpace(); - } + } return !def.eof() && ')' == def.peek() && !m.eof() && ')' == m.peek(); } @@ -866,7 +866,7 @@ const Definition* RootDefinition::find(const string& ref, AllowParens allowParen return result; } -/* +/* class contains named struct, enum, enum-member, method, topic, subtopic everything contained by class is uniquely named contained names may be reused by other classes @@ -948,8 +948,8 @@ bool BmhParser::addDefinition(const char* defStart, bool hasEnd, MarkType markTy && fMaps[(int) markType].fExemplary != Exemplary::kOptional) { if (string::npos == fFileName.find("undocumented") && !hasExcluder) { - hasExample == Exemplary::kNo ? - this->reportWarning("missing example") : + hasExample == Exemplary::kNo ? + this->reportWarning("missing example") : this->reportWarning("unexpected example"); } @@ -1005,7 +1005,7 @@ bool BmhParser::addDefinition(const char* defStart, bool hasEnd, MarkType markTy definition->fContentStart = fChar; definition->fName = typeNameBuilder[0]; Definition* parent = fParent; - while (parent && MarkType::kTopic != parent->fMarkType + while (parent && MarkType::kTopic != parent->fMarkType && MarkType::kSubtopic != parent->fMarkType) { parent = parent->fParent; } @@ -1158,7 +1158,7 @@ bool BmhParser::addDefinition(const char* defStart, bool hasEnd, MarkType markTy break; // always treated as one-liners (can't detect misuse easily) case MarkType::kAlias: - case MarkType::kAnchor: + case MarkType::kAnchor: case MarkType::kDefine: case MarkType::kError: case MarkType::kFile: @@ -1207,7 +1207,7 @@ bool BmhParser::addDefinition(const char* defStart, bool hasEnd, MarkType markTy return this->reportError<bool>("duplicate alias"); } fAliasMap[alias] = definition; - } + } break; case MarkType::kExternal: (void) this->collectExternals(); // FIXME: detect errors in external defs? @@ -1459,7 +1459,7 @@ bool BmhParser::endTableColumn(const char* end, const char* terminator) { return true; } -// FIXME: some examples may produce different output on different platforms +// FIXME: some examples may produce different output on different platforms // if the text output can be different, think of how to author that bool BmhParser::findDefinitions() { @@ -1772,7 +1772,7 @@ string BmhParser::methodName() { isConstructor = true; } builder = parent->fName + "::"; - } + } if (isConstructor || expectOperator) { paren = this->strnchr(')', end) + 1; } @@ -1838,7 +1838,7 @@ bool BmhParser::popParentStack(Definition* definition) { } TextParser::TextParser(const Definition* definition) : - TextParser(definition->fFileName, definition->fContentStart, definition->fContentEnd, + TextParser(definition->fFileName, definition->fContentStart, definition->fContentEnd, definition->fLineCount) { } @@ -1997,7 +1997,7 @@ vector<string> BmhParser::typeName(MarkType markType, bool* checkEnd) { this->skipNoName(); break; case MarkType::kAlias: - case MarkType::kAnchor: + case MarkType::kAnchor: case MarkType::kBug: // fixme: expect number case MarkType::kDefine: case MarkType::kDefinedBy: @@ -2365,7 +2365,7 @@ int main(int argc, char** const argv) { topics += count_children(*topic.second, MarkType::kSubtopic); topics += count_children(*topic.second, MarkType::kTopic); } - SkDebugf("topics=%d classes=%d methods=%d examples=%d\n", + SkDebugf("topics=%d classes=%d methods=%d examples=%d\n", bmhParser.fTopicMap.size(), bmhParser.fClassMap.size(), methods, examples); } |