Changeset View
Changeset View
Standalone View
Standalone View
src/indexer/katehighlightingindexer.cpp
Show First 20 Lines • Show All 168 Lines • ▼ Show 20 Line(s) | 168 | } else if (xml.name() == QLatin1String("keyword")) { | |||
---|---|---|---|---|---|
169 | const QString context = xml.attributes().value(QLatin1String("String")).toString(); | 169 | const QString context = xml.attributes().value(QLatin1String("String")).toString(); | ||
170 | if (!context.isEmpty()) | 170 | if (!context.isEmpty()) | ||
171 | m_usedNames.insert(context); | 171 | m_usedNames.insert(context); | ||
172 | } | 172 | } | ||
173 | } | 173 | } | ||
174 | 174 | | |||
175 | bool check() const | 175 | bool check() const | ||
176 | { | 176 | { | ||
177 | bool success = true; | ||||
177 | const auto invalidNames = m_usedNames - m_existingNames; | 178 | const auto invalidNames = m_usedNames - m_existingNames; | ||
178 | if (!invalidNames.isEmpty()) { | 179 | if (!invalidNames.isEmpty()) { | ||
179 | qWarning() << m_filename << "Reference of non-existing keyword list:" << invalidNames; | 180 | qWarning() << m_filename << "Reference of non-existing keyword list:" << invalidNames; | ||
180 | return false; | 181 | success = false; | ||
181 | } | 182 | } | ||
182 | 183 | | |||
183 | const auto unusedNames = m_existingNames - m_usedNames; | 184 | const auto unusedNames = m_existingNames - m_usedNames; | ||
184 | if (!unusedNames.isEmpty()) { | 185 | if (!unusedNames.isEmpty()) { | ||
185 | qWarning() << m_filename << "Unused keyword lists:" << unusedNames; | 186 | qWarning() << m_filename << "Unused keyword lists:" << unusedNames; | ||
186 | } | 187 | } | ||
187 | 188 | | |||
188 | return true; | 189 | return success; | ||
189 | } | 190 | } | ||
190 | 191 | | |||
191 | private: | 192 | private: | ||
192 | QString m_filename; | 193 | QString m_filename; | ||
193 | QSet<QString> m_usedNames; | 194 | QSet<QString> m_usedNames; | ||
194 | QSet<QString> m_existingNames; | 195 | QSet<QString> m_existingNames; | ||
195 | }; | 196 | }; | ||
196 | 197 | | |||
▲ Show 20 Lines • Show All 286 Lines • ▼ Show 20 Line(s) | 463 | while (!xml.atEnd()) { | |||
483 | // scan for bogus <item> lala </item> spaces | 484 | // scan for bogus <item> lala </item> spaces | ||
484 | if (!checkItemsTrimmed(hlFilename, xml)) { | 485 | if (!checkItemsTrimmed(hlFilename, xml)) { | ||
485 | anyError = 8; | 486 | anyError = 8; | ||
486 | continue; | 487 | continue; | ||
487 | } | 488 | } | ||
488 | 489 | | |||
489 | // check single chars in DetectChar and Detect2Chars | 490 | // check single chars in DetectChar and Detect2Chars | ||
490 | if (!checkSingleChars(hlFilename, xml)) { | 491 | if (!checkSingleChars(hlFilename, xml)) { | ||
491 | // anyError = 8; | 492 | anyError = 8; | ||
492 | continue; | 493 | continue; | ||
493 | } | 494 | } | ||
494 | 495 | | |||
495 | // scan for lookAhead="true" with context="#stay" | 496 | // scan for lookAhead="true" with context="#stay" | ||
496 | if (!checkLookAhead(hlFilename, xml)) { | 497 | if (!checkLookAhead(hlFilename, xml)) { | ||
497 | anyError = 7; | 498 | anyError = 7; | ||
498 | continue; | 499 | continue; | ||
499 | } | 500 | } | ||
500 | } | 501 | } | ||
501 | 502 | | |||
502 | if (!attributeChecker.check()) { | 503 | if (!attributeChecker.check()) { | ||
503 | //anyError = 7; | 504 | anyError = 7; | ||
504 | } | 505 | } | ||
505 | 506 | | |||
506 | if (!keywordChecker.check()) { | 507 | if (!keywordChecker.check()) { | ||
507 | //anyError = 7; | 508 | anyError = 7; | ||
508 | } | 509 | } | ||
509 | } | 510 | } | ||
510 | 511 | | |||
511 | if (!contextChecker.check()) | 512 | if (!contextChecker.check()) | ||
512 | anyError = 7; | 513 | anyError = 7; | ||
513 | 514 | | |||
514 | 515 | | |||
515 | // bail out if any problem was seen | 516 | // bail out if any problem was seen | ||
Show All 14 Lines |