Changeset View
Changeset View
Standalone View
Standalone View
src/indexer/katehighlightingindexer.cpp
Show First 20 Lines • Show All 417 Lines • ▼ Show 20 Line(s) | 411 | for (auto &language : m_contextMap) { | |||
---|---|---|---|---|---|
418 | const auto unusedNames = language.existingContextNames - language.usedContextNames; | 418 | const auto unusedNames = language.existingContextNames - language.usedContextNames; | ||
419 | if (!unusedNames.isEmpty()) { | 419 | if (!unusedNames.isEmpty()) { | ||
420 | qWarning() << language.hlFilename << "Unused contexts:" << unusedNames; | 420 | qWarning() << language.hlFilename << "Unused contexts:" << unusedNames; | ||
421 | success = false; | 421 | success = false; | ||
422 | } | 422 | } | ||
423 | 423 | | |||
424 | auto requiredVersion = getRequiredVersion(m_contextMap, language); | 424 | auto requiredVersion = getRequiredVersion(m_contextMap, language); | ||
425 | if (language.version < requiredVersion) { | 425 | if (language.version < requiredVersion) { | ||
426 | qWarning().nospace() << language.hlFilename << " depends on a language in version " << requiredVersion.major << "." << requiredVersion.minor << ". Please, increase kateversion."; | 426 | qWarning().nospace() << language.hlFilename << " depends on a language in version " << requiredVersion.majorRevision << "." << requiredVersion.minorRevision << ". Please, increase kateversion."; | ||
427 | success = false; | 427 | success = false; | ||
428 | } | 428 | } | ||
429 | } | 429 | } | ||
430 | 430 | | |||
431 | return success; | 431 | return success; | ||
432 | } | 432 | } | ||
433 | 433 | | |||
434 | private: | 434 | private: | ||
Show All 33 Lines | 444 | { | |||
468 | 468 | | |||
469 | if (!context.isEmpty()) | 469 | if (!context.isEmpty()) | ||
470 | m_contextMap[language].usedContextNames.insert(context); | 470 | m_contextMap[language].usedContextNames.insert(context); | ||
471 | } | 471 | } | ||
472 | 472 | | |||
473 | private: | 473 | private: | ||
474 | struct Version | 474 | struct Version | ||
475 | { | 475 | { | ||
476 | int major; | 476 | int majorRevision; | ||
477 | int minor; | 477 | int minorRevision; | ||
478 | 478 | | |||
479 | Version(int major = 0, int minor = 0) | 479 | Version(int majorRevision = 0, int minorRevision = 0) | ||
480 | : major(major) | 480 | : majorRevision(majorRevision) | ||
481 | , minor(minor) | 481 | , minorRevision(minorRevision) | ||
482 | {} | 482 | {} | ||
483 | 483 | | |||
484 | bool operator<(const Version &version) const | 484 | bool operator<(const Version &version) const | ||
485 | { | 485 | { | ||
486 | return major < version.major || (major == version.major && minor < version.minor); | 486 | return majorRevision < version.majorRevision || (majorRevision == version.majorRevision && minorRevision < version.minorRevision); | ||
487 | } | 487 | } | ||
488 | }; | 488 | }; | ||
489 | 489 | | |||
490 | void processVersion(const QString &hlFilename, const QString &hlName, QXmlStreamReader &xml, Version const& requiredVersion, QLatin1String item) | 490 | void processVersion(const QString &hlFilename, const QString &hlName, QXmlStreamReader &xml, Version const& requiredVersion, QLatin1String item) | ||
491 | { | 491 | { | ||
492 | auto &language = m_contextMap[hlName]; | 492 | auto &language = m_contextMap[hlName]; | ||
493 | 493 | | |||
494 | if (language.version < requiredVersion) { | 494 | if (language.version < requiredVersion) { | ||
495 | qWarning().nospace() << hlFilename << " " << item << " in line " << xml.lineNumber() << " is only available since version " << requiredVersion.major << "." << requiredVersion.minor << ". Please, increase kateversion."; | 495 | qWarning().nospace() << hlFilename << " " << item << " in line " << xml.lineNumber() << " is only available since version " << requiredVersion.majorRevision << "." << requiredVersion.minorRevision << ". Please, increase kateversion."; | ||
496 | // update the version to cancel future warnings | 496 | // update the version to cancel future warnings | ||
497 | language.version = requiredVersion; | 497 | language.version = requiredVersion; | ||
498 | m_success = false; | 498 | m_success = false; | ||
499 | } | 499 | } | ||
500 | } | 500 | } | ||
501 | 501 | | |||
502 | class Language | 502 | class Language | ||
503 | { | 503 | { | ||
▲ Show 20 Lines • Show All 265 Lines • Show Last 20 Lines |