Fixed C++ support in Kate syntax highlighting code. This resolves bug 2455.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/1/head
Michele Calgaro 10 years ago
parent ce9d4765cc
commit 4e55a1cfaa

@ -30,7 +30,7 @@ install( FILES
asm-dsp56k.xml asm-m68k.xml asn1.xml asp.xml asterisk.xml awk.xml bash.xml
bibtex.xml bmethod.xml ccss.xml cgis.xml cg.xml changelog.xml chicken.xml
cisco.xml clipper.xml clojure.xml cmake.xml coffee.xml coldfusion.xml
commonlisp.xml component-pascal.xml context.xml crk.xml css.xml
commonlisp.xml component-pascal.xml context.xml cpp.xml crk.xml css.xml
cs.xml cue.xml curry.xml c.xml ddoc.xml debianchangelog.xml debiancontrol.xml
desktop.xml diff.xml djangotemplate.xml dockerfile.xml dosbat.xml dot.xml
doxygenlua.xml doxygen.xml dtd.xml d.xml eiffel.xml email.xml erlang.xml

@ -18,8 +18,8 @@ syntaxkate_DATA = language.dtd syntax.template \
fsharp.xml fstab.xml ftl.xml gap.xml gcc.xml gdb.xml gdl.xml gettext.xml git-ignore.xml \
git-rebase.xml gitolite.xml glosstex.xml glsl.xml gnuassembler.xml gnuplot.xml go.xml \
grammar.xml hamlet.xml haml.xml haskell.xml haxe.xml html.xml html-php.xml hunspell-aff.xml \
hunspell-dat.xml hunspell-dic.xml hunspell-idx.xml idconsole.xml idl.xml ilerpg.xml \
inform.xml ini.xml jam.xml javadoc.xml javascript.xml javascript-php.xml java.xml json.xml \
hunspell-dat.xml hunspell-dic.xml hunspell-idx.xml idconsole.xml idl.xml ilerpg.xml inform.xml \
ini.xml isocpp.xml jam.xml javadoc.xml javascript.xml javascript-php.xml java.xml json.xml \
jsp.xml julia.xml j.xml kbasic.xml latex.xml ldif.xml ld.xml less.xml lex.xml lilypond.xml \
literate-curry.xml literate-haskell.xml logtalk.xml lpc.xml lsl.xml lua.xml m3u.xml \
m4.xml mab.xml makefile.xml mako.xml mandoc.xml mason.xml mathematica.xml matlab.xml \

@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"
[
<!ENTITY space " ">
<!ENTITY separators ",&#59;">
<!ENTITY ns_punctuators "!&#37;&space;&amp;()+-/.*&lt;=&gt;?[]{|}~^&separators;">
]>
<language
name="C++" section="Sources" version="1.0" kateversion="2.4" indenter="cstyle" style="C++"
mimetype="text/x-c++src;text/x-c++hdr;text/x-chdr"
extensions="*.c++;*.cxx;*.cpp;*.cc;*.C;*.h;*.hh;*.H;*.h++;*.hxx;*.hpp;*.hcc"
license="LGPL" priority="1" >
<!--
This file is a wrapper from C++ to ISO C++. Its purpose is to provide C++ rules
inclusion to existing files that already include the text
<IncludeRules context="##C++" />
-->
<highlighting>
<contexts>
<context attribute="Normal Text" lineEndContext="#stay" name="Normal">
<IncludeRules context="##ISO C++" />
</context>
</contexts>
</highlighting>
</language>
<!-- kate: indent-width 2; tab-width 2; -->

@ -38,6 +38,7 @@
<Definition name="Common Lisp" url="http://git.trinitydesktop.org/cgit/tdelibs/plain/kate/data/commonlisp.xml" version="1.05-1"/>
<Definition name="Component-Pascal" url="http://git.trinitydesktop.org/cgit/tdelibs/plain/kate/data/component-pascal.xml" version="1.05"/>
<Definition name="ConTeXt" url="http://git.trinitydesktop.org/cgit/tdelibs/plain/kate/data/context.xml" version="1.1"/>
<Definition name="C++" url="http://git.trinitydesktop.org/cgit/tdelibs/plain/kate/data/cpp.xml" version="1.0"/>
<Definition name="Crack" url="http://git.trinitydesktop.org/cgit/tdelibs/plain/kate/data/crk.xml" version="1.1"/>
<Definition name="CSS/PHP" url="http://git.trinitydesktop.org/cgit/tdelibs/plain/kate/data/css-php.xml" version="2.09"/>
<Definition name="CSS" url="http://git.trinitydesktop.org/cgit/tdelibs/plain/kate/data/css.xml" version="2.09"/>

@ -2439,8 +2439,13 @@ void KateHighlighting::makeContextList()
// of the highlighting definitions they belong to
if (identifierToUse.isEmpty())
{
kdDebug(13010)<<"OHOH, unknown highlighting description referenced"<<endl;
kdDebug(13010)<<"Highlighting for ("<<it.key()<<") can not be loaded"<<endl;
}
else
{
// Only do this if we have a non-empty identifier
kdDebug(13010)<<"setting ("<<it.key()<<") to loaded"<<endl;
//mark hl as loaded
@ -2456,10 +2461,10 @@ void KateHighlighting::makeContextList()
something_changed=true; // something has been loaded
}
}
}
} while (something_changed); // as long as there has been another file parsed
// repeat everything, there could be newly added embedded hls.
// at this point all needed highlighing (sub)definitions are loaded. It's time
// to resolve cross file references (if there are any)
kdDebug(13010)<<"Unresolved contexts, which need attention: "<<unresolvedContextReferences.count()<<endl;

Loading…
Cancel
Save