This patch extends the highlighting indexer by collecting a list of all used and all existing context names.
If the used context names are NOT a subset of the existing context names, then we obviously reference an invalid non-existent context.
As test, I changed a rule in abc.xml to switch to context "Barbara", which does not exist. The checker now complains like this:
katehighlightingindexer(10738)/(default) {anonymous}::ContextChecker::check: "/home/dh/kde/kf5/src/frameworks/syntax-highlighting/data/syntax/abc.xml" Reference of non-existing contexts: QSet("Barbara")
It seems all our highlighting files are consistent, which is good. So we don't directly gain anything from this patch apart from catching context errors at compile-time instead of run-time.
This idea can be extended: For instance, we could also check the itemData names with the referenced attributes.
Comments?