diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/bookmaker/includeWriter.cpp | 4 | ||||
-rw-r--r-- | tools/bookmaker/mdOut.cpp | 4 | ||||
-rw-r--r-- | tools/bookmaker/spellCheck.cpp | 38 |
3 files changed, 18 insertions, 28 deletions
diff --git a/tools/bookmaker/includeWriter.cpp b/tools/bookmaker/includeWriter.cpp index 38cd2232ef..c029421a8c 100644 --- a/tools/bookmaker/includeWriter.cpp +++ b/tools/bookmaker/includeWriter.cpp @@ -1170,7 +1170,6 @@ bool IncludeWriter::defineOut(const Definition& def) { } const Definition& bmhDef = defIter->second; this->constOut(&def, &bmhDef); - SkDebugf(""); return true; } @@ -1346,9 +1345,6 @@ bool IncludeWriter::populate(Definition* def, ParentPair* prevPair, RootDefiniti const Definition* requireDense = nullptr; const Definition* startDef = nullptr; for (auto& child : def->fTokens) { - if (39 == child.fLineCount) { - SkDebugf(""); - } if (KeyWord::kInline == child.fKeyWord) { continue; } diff --git a/tools/bookmaker/mdOut.cpp b/tools/bookmaker/mdOut.cpp index 0d28f9db01..76df5daca0 100644 --- a/tools/bookmaker/mdOut.cpp +++ b/tools/bookmaker/mdOut.cpp @@ -420,8 +420,8 @@ string MdOut::addReferences(const char* refStart, const char* refEnd, // see if this should have been a findable reference // look for Sk / sk / SK .. - if (!ref.compare(0, 2, "Sk") && ref != "Skew" && ref != "Skews" && - ref != "Skip" && ref != "Skips") { + if (!ref.compare(0, 2, "Sk") && ref != "Skew" && ref != "Skews" && ref != "Skewing" + && ref != "Skip" && ref != "Skips") { if (BmhParser::Resolvable::kOut != resolvable && BmhParser::Resolvable::kFormula != resolvable) { t.reportError("missed Sk prefixed"); diff --git a/tools/bookmaker/spellCheck.cpp b/tools/bookmaker/spellCheck.cpp index acf9e242a3..cd02178b56 100644 --- a/tools/bookmaker/spellCheck.cpp +++ b/tools/bookmaker/spellCheck.cpp @@ -25,6 +25,7 @@ struct CheckEntry { string fFile; int fLine; int fCount; + bool fOverride; }; class SpellCheck : public ParserCommon { @@ -63,6 +64,7 @@ private: fInFormula = false; fInDescription = false; fInStdOut = false; + fOverride = false; } void wordCheck(string str); @@ -84,6 +86,7 @@ private: bool fInDescription; bool fInFormula; bool fInStdOut; + bool fOverride; typedef ParserCommon INHERITED; }; @@ -121,7 +124,10 @@ bool SpellCheck::check(const char* match) { if (string::npos == fRoot->fFileName.rfind(match)) { continue; } - this->check(topicDef); + fOverride = string::npos != fRoot->fFileName.rfind("undocumented.bmh") + || string::npos != fRoot->fFileName.rfind("markup.bmh") + || string::npos != fRoot->fFileName.rfind("usingBookmaker.bmh"); + this->check(topicDef); } return true; } @@ -493,13 +499,7 @@ void SpellCheck::report(SkCommandLineFlags::StringArray report) { std::sort(elems.begin(), elems.end(), stringCompare); if (report.contains("once")) { for (auto iter : elems) { - if (string::npos != iter.second.fFile.find("undocumented.bmh")) { - continue; - } - if (string::npos != iter.second.fFile.find("markup.bmh")) { - continue; - } - if (string::npos != iter.second.fFile.find("usingBookmaker.bmh")) { + if (iter.second.fOverride) { continue; } if (iter.second.fCount == 1) { @@ -516,13 +516,7 @@ void SpellCheck::report(SkCommandLineFlags::StringArray report) { char lastInitial = 'a'; int count = 0; for (auto iter : elems) { - if (string::npos != iter.second.fFile.find("undocumented.bmh")) { - continue; - } - if (string::npos != iter.second.fFile.find("markup.bmh")) { - continue; - } - if (string::npos != iter.second.fFile.find("usingBookmaker.bmh")) { + if (iter.second.fOverride) { continue; } string check = iter.first.c_str(); @@ -554,13 +548,7 @@ void SpellCheck::report(SkCommandLineFlags::StringArray report) { int index = 0; const char* mispelled = report[0]; for (auto iter : elems) { - if (string::npos != iter.second.fFile.find("undocumented.bmh")) { - continue; - } - if (string::npos != iter.second.fFile.find("markup.bmh")) { - continue; - } - if (string::npos != iter.second.fFile.find("usingBookmaker.bmh")) { + if (iter.second.fOverride) { continue; } string check = iter.first.c_str(); @@ -662,12 +650,18 @@ void SpellCheck::wordCheck(string str) { sawDigit ? fDigits : fWords; auto iter = mappy.find(str); if (mappy.end() != iter) { + if (iter->second.fOverride && !fOverride) { + iter->second.fFile = fFileName; + iter->second.fLine = fLineCount + fLocalLine; + iter->second.fOverride = false; + } iter->second.fCount += 1; } else { CheckEntry* entry = &mappy[str]; entry->fFile = fFileName; entry->fLine = fLineCount + fLocalLine; entry->fCount = 1; + entry->fOverride = fOverride; } } |