Checking if your kit is complete... Looks good Writing Makefile for Syntax::Highlight::Engine::Kate cp lib/Syntax/Highlight/Engine/Kate/HTML.pm blib/lib/Syntax/Highlight/Engine/Kate/HTML.pm cp lib/Syntax/Highlight/Engine/Kate/Spice.pm blib/lib/Syntax/Highlight/Engine/Kate/Spice.pm cp lib/Syntax/Highlight/Engine/Kate/Clipper.pm blib/lib/Syntax/Highlight/Engine/Kate/Clipper.pm cp lib/Syntax/Highlight/Engine/Kate/PHP_HTML.pm blib/lib/Syntax/Highlight/Engine/Kate/PHP_HTML.pm cp lib/Syntax/Highlight/Engine/Kate/Pascal.pm blib/lib/Syntax/Highlight/Engine/Kate/Pascal.pm cp lib/Syntax/Highlight/Engine/Kate/AWK.pm blib/lib/Syntax/Highlight/Engine/Kate/AWK.pm cp lib/Syntax/Highlight/Engine/Kate/WINE_Config.pm blib/lib/Syntax/Highlight/Engine/Kate/WINE_Config.pm cp lib/Syntax/Highlight/Engine/Kate/GNU_Gettext.pm blib/lib/Syntax/Highlight/Engine/Kate/GNU_Gettext.pm cp lib/Syntax/Highlight/Engine/Kate/Common_Lisp.pm blib/lib/Syntax/Highlight/Engine/Kate/Common_Lisp.pm cp lib/Syntax/Highlight/Engine/Kate/Progress.pm blib/lib/Syntax/Highlight/Engine/Kate/Progress.pm cp lib/Syntax/Highlight/Engine/Kate/XML_Debug.pm blib/lib/Syntax/Highlight/Engine/Kate/XML_Debug.pm cp lib/Syntax/Highlight/Engine/Kate/GDL.pm blib/lib/Syntax/Highlight/Engine/Kate/GDL.pm cp lib/Syntax/Highlight/Engine/Kate/INI_Files.pm blib/lib/Syntax/Highlight/Engine/Kate/INI_Files.pm cp lib/Syntax/Highlight/Engine/Kate/LDIF.pm blib/lib/Syntax/Highlight/Engine/Kate/LDIF.pm cp lib/Syntax/Highlight/Engine/Kate/Modulaminus2.pm blib/lib/Syntax/Highlight/Engine/Kate/Modulaminus2.pm cp lib/Syntax/Highlight/Engine/Kate/D.pm blib/lib/Syntax/Highlight/Engine/Kate/D.pm cp lib/Syntax/Highlight/Engine/Kate/Cisco.pm blib/lib/Syntax/Highlight/Engine/Kate/Cisco.pm cp lib/Syntax/Highlight/Engine/Kate/Scilab.pm blib/lib/Syntax/Highlight/Engine/Kate/Scilab.pm cp lib/Syntax/Highlight/Engine/Kate/MIPS_Assembler.pm blib/lib/Syntax/Highlight/Engine/Kate/MIPS_Assembler.pm cp lib/Syntax/Highlight/Engine/Kate/Cdash.pm blib/lib/Syntax/Highlight/Engine/Kate/Cdash.pm cp lib/Syntax/Highlight/Engine/Kate.pm blib/lib/Syntax/Highlight/Engine/Kate.pm cp lib/Syntax/Highlight/Engine/Kate/Literate_Haskell.pm blib/lib/Syntax/Highlight/Engine/Kate/Literate_Haskell.pm cp lib/Syntax/Highlight/Engine/Kate/Java.pm blib/lib/Syntax/Highlight/Engine/Kate/Java.pm cp lib/Syntax/Highlight/Engine/Kate/ColdFusion.pm blib/lib/Syntax/Highlight/Engine/Kate/ColdFusion.pm cp lib/Syntax/Highlight/Engine/Kate/Debian_Changelog.pm blib/lib/Syntax/Highlight/Engine/Kate/Debian_Changelog.pm cp lib/Syntax/Highlight/Engine/Kate/CMake.pm blib/lib/Syntax/Highlight/Engine/Kate/CMake.pm cp lib/Syntax/Highlight/Engine/Kate/E_Language.pm blib/lib/Syntax/Highlight/Engine/Kate/E_Language.pm cp lib/Syntax/Highlight/Engine/Kate/Mason.pm blib/lib/Syntax/Highlight/Engine/Kate/Mason.pm cp lib/Syntax/Highlight/Engine/Kate/PureBasic.pm blib/lib/Syntax/Highlight/Engine/Kate/PureBasic.pm cp lib/Syntax/Highlight/Engine/Kate/XHarbour.pm blib/lib/Syntax/Highlight/Engine/Kate/XHarbour.pm cp lib/Syntax/Highlight/Engine/Kate/Fortran.pm blib/lib/Syntax/Highlight/Engine/Kate/Fortran.pm cp lib/Syntax/Highlight/Engine/Kate/ANSI_C89.pm blib/lib/Syntax/Highlight/Engine/Kate/ANSI_C89.pm cp lib/Syntax/Highlight/Engine/Kate/Alerts.pm blib/lib/Syntax/Highlight/Engine/Kate/Alerts.pm cp lib/Syntax/Highlight/Engine/Kate/BaseTest.pm blib/lib/Syntax/Highlight/Engine/Kate/BaseTest.pm cp lib/Syntax/Highlight/Engine/Kate/Eiffel.pm blib/lib/Syntax/Highlight/Engine/Kate/Eiffel.pm cp lib/Syntax/Highlight/Engine/Kate/Scheme.pm blib/lib/Syntax/Highlight/Engine/Kate/Scheme.pm cp lib/Syntax/Highlight/Engine/Kate/POVminusRay.pm blib/lib/Syntax/Highlight/Engine/Kate/POVminusRay.pm cp lib/Syntax/Highlight/Engine/Kate/Txt2tags.pm blib/lib/Syntax/Highlight/Engine/Kate/Txt2tags.pm cp lib/Syntax/Highlight/Engine/Kate/R_Script.pm blib/lib/Syntax/Highlight/Engine/Kate/R_Script.pm cp lib/Syntax/Highlight/Engine/Kate/PostScript.pm blib/lib/Syntax/Highlight/Engine/Kate/PostScript.pm cp lib/Syntax/Highlight/Engine/Kate/Yacas.pm blib/lib/Syntax/Highlight/Engine/Kate/Yacas.pm cp lib/Syntax/Highlight/Engine/Kate/Octave.pm blib/lib/Syntax/Highlight/Engine/Kate/Octave.pm cp lib/Syntax/Highlight/Engine/Kate/REXX.pm blib/lib/Syntax/Highlight/Engine/Kate/REXX.pm cp lib/Syntax/Highlight/Engine/Kate/Quake_Script.pm blib/lib/Syntax/Highlight/Engine/Kate/Quake_Script.pm cp lib/Syntax/Highlight/Engine/Kate/SQL_MySQL.pm blib/lib/Syntax/Highlight/Engine/Kate/SQL_MySQL.pm cp lib/Syntax/Highlight/Engine/Kate/LaTeX.pm blib/lib/Syntax/Highlight/Engine/Kate/LaTeX.pm cp lib/Syntax/Highlight/Engine/Kate/Python.pm blib/lib/Syntax/Highlight/Engine/Kate/Python.pm cp lib/Syntax/Highlight/Engine/Kate/AHDL.pm blib/lib/Syntax/Highlight/Engine/Kate/AHDL.pm cp lib/Syntax/Highlight/Engine/Kate/Velocity.pm blib/lib/Syntax/Highlight/Engine/Kate/Velocity.pm cp lib/Syntax/Highlight/Engine/Kate/UnrealScript.pm blib/lib/Syntax/Highlight/Engine/Kate/UnrealScript.pm cp lib/Syntax/Highlight/Engine/Kate.pod blib/lib/Syntax/Highlight/Engine/Kate.pod cp lib/Syntax/Highlight/Engine/Kate/Desktop.pm blib/lib/Syntax/Highlight/Engine/Kate/Desktop.pm cp lib/Syntax/Highlight/Engine/Kate/Euphoria.pm blib/lib/Syntax/Highlight/Engine/Kate/Euphoria.pm cp lib/Syntax/Highlight/Engine/Kate/BaseTestchild.pm blib/lib/Syntax/Highlight/Engine/Kate/BaseTestchild.pm cp lib/Syntax/Highlight/Engine/Kate/Intel_x86_NASM.pm blib/lib/Syntax/Highlight/Engine/Kate/Intel_x86_NASM.pm cp lib/Syntax/Highlight/Engine/Kate/XML.pm blib/lib/Syntax/Highlight/Engine/Kate/XML.pm cp lib/Syntax/Highlight/Engine/Kate/SML.pm blib/lib/Syntax/Highlight/Engine/Kate/SML.pm cp lib/Syntax/Highlight/Engine/Kate/KBasic.pm blib/lib/Syntax/Highlight/Engine/Kate/KBasic.pm cp lib/Syntax/Highlight/Engine/Kate/ASP.pm blib/lib/Syntax/Highlight/Engine/Kate/ASP.pm cp lib/Syntax/Highlight/Engine/Kate/CUE_Sheet.pm blib/lib/Syntax/Highlight/Engine/Kate/CUE_Sheet.pm cp lib/Syntax/Highlight/Engine/Kate/Verilog.pm blib/lib/Syntax/Highlight/Engine/Kate/Verilog.pm cp lib/Syntax/Highlight/Engine/Kate/GLSL.pm blib/lib/Syntax/Highlight/Engine/Kate/GLSL.pm cp lib/Syntax/Highlight/Engine/Kate/Xslt.pm blib/lib/Syntax/Highlight/Engine/Kate/Xslt.pm cp lib/Syntax/Highlight/Engine/Kate/AVR_Assembler.pm blib/lib/Syntax/Highlight/Engine/Kate/AVR_Assembler.pm cp lib/Syntax/Highlight/Engine/Kate/Tcl_Tk.pm blib/lib/Syntax/Highlight/Engine/Kate/Tcl_Tk.pm cp lib/Syntax/Highlight/Engine/Kate/Ferite.pm blib/lib/Syntax/Highlight/Engine/Kate/Ferite.pm cp lib/Syntax/Highlight/Engine/Kate/ChangeLog.pm blib/lib/Syntax/Highlight/Engine/Kate/ChangeLog.pm cp lib/Syntax/Highlight/Engine/Kate/TI_Basic.pm blib/lib/Syntax/Highlight/Engine/Kate/TI_Basic.pm cp lib/Syntax/Highlight/Engine/Kate/ComponentminusPascal.pm blib/lib/Syntax/Highlight/Engine/Kate/ComponentminusPascal.pm cp lib/Syntax/Highlight/Engine/Kate/Ruby.pm blib/lib/Syntax/Highlight/Engine/Kate/Ruby.pm cp lib/Syntax/Highlight/Engine/Kate/Cplusplus.pm blib/lib/Syntax/Highlight/Engine/Kate/Cplusplus.pm cp lib/Syntax/Highlight/Engine/Kate/Cg.pm blib/lib/Syntax/Highlight/Engine/Kate/Cg.pm cp lib/Syntax/Highlight/Engine/Kate/C.pm blib/lib/Syntax/Highlight/Engine/Kate/C.pm cp lib/Syntax/Highlight/Engine/Kate/LilyPond.pm blib/lib/Syntax/Highlight/Engine/Kate/LilyPond.pm cp lib/Syntax/Highlight/Engine/Kate/Javadoc.pm blib/lib/Syntax/Highlight/Engine/Kate/Javadoc.pm cp lib/Syntax/Highlight/Engine/Kate/Pike.pm blib/lib/Syntax/Highlight/Engine/Kate/Pike.pm cp lib/Syntax/Highlight/Engine/Kate/Inform.pm blib/lib/Syntax/Highlight/Engine/Kate/Inform.pm cp lib/Syntax/Highlight/Engine/Kate/Template.pm blib/lib/Syntax/Highlight/Engine/Kate/Template.pm cp lib/Syntax/Highlight/Engine/Kate/VRML.pm blib/lib/Syntax/Highlight/Engine/Kate/VRML.pm cp lib/Syntax/Highlight/Engine/Kate/Lua.pm blib/lib/Syntax/Highlight/Engine/Kate/Lua.pm cp lib/Syntax/Highlight/Engine/Kate/SQL.pm blib/lib/Syntax/Highlight/Engine/Kate/SQL.pm cp lib/Syntax/Highlight/Engine/Kate/IDL.pm blib/lib/Syntax/Highlight/Engine/Kate/IDL.pm cp lib/Syntax/Highlight/Engine/Kate/JSP.pm blib/lib/Syntax/Highlight/Engine/Kate/JSP.pm cp lib/Syntax/Highlight/Engine/Kate/Debian_Control.pm blib/lib/Syntax/Highlight/Engine/Kate/Debian_Control.pm cp lib/Syntax/Highlight/Engine/Kate/JavaScript.pm blib/lib/Syntax/Highlight/Engine/Kate/JavaScript.pm cp lib/Syntax/Highlight/Engine/Kate/CSS.pm blib/lib/Syntax/Highlight/Engine/Kate/CSS.pm cp lib/Syntax/Highlight/Engine/Kate/FourGL.pm blib/lib/Syntax/Highlight/Engine/Kate/FourGL.pm cp lib/Syntax/Highlight/Engine/Kate/Ada.pm blib/lib/Syntax/Highlight/Engine/Kate/Ada.pm cp lib/Syntax/Highlight/Engine/Kate/Music_Publisher.pm blib/lib/Syntax/Highlight/Engine/Kate/Music_Publisher.pm cp lib/Syntax/Highlight/Engine/Kate/PHP_PHP.pm blib/lib/Syntax/Highlight/Engine/Kate/PHP_PHP.pm cp lib/Syntax/Highlight/Engine/Kate/LPC.pm blib/lib/Syntax/Highlight/Engine/Kate/LPC.pm cp lib/Syntax/Highlight/Engine/Kate/FourGLminusPER.pm blib/lib/Syntax/Highlight/Engine/Kate/FourGLminusPER.pm cp lib/Syntax/Highlight/Engine/Kate/Asm6502.pm blib/lib/Syntax/Highlight/Engine/Kate/Asm6502.pm cp lib/Syntax/Highlight/Engine/Kate/PicAsm.pm blib/lib/Syntax/Highlight/Engine/Kate/PicAsm.pm cp lib/Syntax/Highlight/Engine/Kate/ILERPG.pm blib/lib/Syntax/Highlight/Engine/Kate/ILERPG.pm cp lib/Syntax/Highlight/Engine/Kate/Haskell.pm blib/lib/Syntax/Highlight/Engine/Kate/Haskell.pm cp lib/Syntax/Highlight/Engine/Kate/Yacc_Bison.pm blib/lib/Syntax/Highlight/Engine/Kate/Yacc_Bison.pm cp lib/Syntax/Highlight/Engine/Kate/MABminusDB.pm blib/lib/Syntax/Highlight/Engine/Kate/MABminusDB.pm cp lib/Syntax/Highlight/Engine/Kate/Diff.pm blib/lib/Syntax/Highlight/Engine/Kate/Diff.pm cp lib/Syntax/Highlight/Engine/Kate/VHDL.pm blib/lib/Syntax/Highlight/Engine/Kate/VHDL.pm cp lib/Syntax/Highlight/Engine/Kate/Lex_Flex.pm blib/lib/Syntax/Highlight/Engine/Kate/Lex_Flex.pm cp lib/Syntax/Highlight/Engine/Kate/RenderMan_RIB.pm blib/lib/Syntax/Highlight/Engine/Kate/RenderMan_RIB.pm cp lib/Syntax/Highlight/Engine/Kate/Sather.pm blib/lib/Syntax/Highlight/Engine/Kate/Sather.pm cp lib/Syntax/Highlight/Engine/Kate/Makefile.pm blib/lib/Syntax/Highlight/Engine/Kate/Makefile.pm cp lib/Syntax/Highlight/Engine/Kate/Stata.pm blib/lib/Syntax/Highlight/Engine/Kate/Stata.pm cp lib/Syntax/Highlight/Engine/Kate/Bash.pm blib/lib/Syntax/Highlight/Engine/Kate/Bash.pm cp lib/Syntax/Highlight/Engine/Kate/All.pm blib/lib/Syntax/Highlight/Engine/Kate/All.pm cp lib/Syntax/Highlight/Engine/Kate/RSI_IDL.pm blib/lib/Syntax/Highlight/Engine/Kate/RSI_IDL.pm cp lib/Syntax/Highlight/Engine/Kate/SQL_PostgreSQL.pm blib/lib/Syntax/Highlight/Engine/Kate/SQL_PostgreSQL.pm cp lib/Syntax/Highlight/Engine/Kate/CGiS.pm blib/lib/Syntax/Highlight/Engine/Kate/CGiS.pm cp lib/Syntax/Highlight/Engine/Kate/BibTeX.pm blib/lib/Syntax/Highlight/Engine/Kate/BibTeX.pm cp lib/Syntax/Highlight/Engine/Kate/Prolog.pm blib/lib/Syntax/Highlight/Engine/Kate/Prolog.pm cp lib/Syntax/Highlight/Engine/Kate/Sieve.pm blib/lib/Syntax/Highlight/Engine/Kate/Sieve.pm cp lib/Syntax/Highlight/Engine/Kate/Doxygen.pm blib/lib/Syntax/Highlight/Engine/Kate/Doxygen.pm cp lib/Syntax/Highlight/Engine/Kate/Perl.pm blib/lib/Syntax/Highlight/Engine/Kate/Perl.pm cp lib/Syntax/Highlight/Engine/Kate/RPM_Spec.pm blib/lib/Syntax/Highlight/Engine/Kate/RPM_Spec.pm cp lib/Syntax/Highlight/Engine/Kate/GNU_Assembler.pm blib/lib/Syntax/Highlight/Engine/Kate/GNU_Assembler.pm cp lib/Syntax/Highlight/Engine/Kate/Matlab.pm blib/lib/Syntax/Highlight/Engine/Kate/Matlab.pm cp lib/Syntax/Highlight/Engine/Kate/SGML.pm blib/lib/Syntax/Highlight/Engine/Kate/SGML.pm Manifying blib/man3/Syntax::Highlight::Engine::Kate::HTML.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Spice.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Clipper.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::PHP_HTML.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Pascal.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::AWK.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::GNU_Gettext.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Common_Lisp.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Progress.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::XML_Debug.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::GDL.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::INI_Files.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::LDIF.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Modulaminus2.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::D.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Cisco.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Scilab.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::MIPS_Assembler.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Cdash.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Literate_Haskell.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Java.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::ColdFusion.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Debian_Changelog.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::CMake.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::E_Language.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Mason.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::PureBasic.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::XHarbour.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Fortran.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::ANSI_C89.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Alerts.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::BaseTest.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Eiffel.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Scheme.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::POVminusRay.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Txt2tags.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::R_Script.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::PostScript.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Yacas.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Octave.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::REXX.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Quake_Script.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::SQL_MySQL.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::LaTeX.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Python.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::AHDL.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Velocity.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::UnrealScript.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Desktop.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Euphoria.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::BaseTestchild.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Intel_x86_NASM.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::XML.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::SML.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::KBasic.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::ASP.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::CUE_Sheet.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Verilog.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::GLSL.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Xslt.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::AVR_Assembler.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Tcl_Tk.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Ferite.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::ChangeLog.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::TI_Basic.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::ComponentminusPascal.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Ruby.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Cplusplus.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Cg.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::C.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::LilyPond.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Javadoc.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Pike.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Inform.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Template.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::VRML.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Lua.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::SQL.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::IDL.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::JSP.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Debian_Control.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::JavaScript.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::CSS.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::FourGL.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Ada.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Music_Publisher.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::PHP_PHP.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::LPC.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::FourGLminusPER.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Asm6502.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::PicAsm.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::ILERPG.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Haskell.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Yacc_Bison.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::MABminusDB.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Diff.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::VHDL.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Lex_Flex.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::RenderMan_RIB.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Sather.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Makefile.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Stata.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Bash.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::RSI_IDL.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::SQL_PostgreSQL.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::CGiS.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::BibTeX.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Prolog.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Sieve.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Doxygen.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Perl.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::RPM_Spec.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::GNU_Assembler.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::Matlab.3 Manifying blib/man3/Syntax::Highlight::Engine::Kate::SGML.3 PERL_DL_NONLAZY=1 /home/cpanrun/ia64/build/5.6.1/bin/perl -Iblib/arch -Iblib/lib -I/home/cpanrun/ia64/build/5.6.1/lib/5.6.1/IA64.ARCHREV_0-thread-multi -I/home/cpanrun/ia64/build/5.6.1/lib/5.6.1 -e 'use Test::Harness qw(&runtests $verbose); $verbose=1; runtests @ARGV;' t/*.t t/Kate..............1..460 ok 1 ok 2 ok 3 ok 4 ok 5 ok 6 ok 7 ok 8 testing .desktop ok 9 ok 10 testing as kate plugin ok 11 [Desktop Entry] Comment= Comment[en_US]= Encoding=UTF-8 Exec=timidity -iA -B 2,8 -EFreverb=0 -EFchorus=0 GenericName= GenericName[en_US]= Icon= MimeType= Name=Start timidity server Name[en_US]=Start timidity server Path= StartupNotify=false Terminal=true TerminalOptions=\s--noclose Type=Application X-DCOP-ServiceType=none X-KDE-SubstituteUID=true X-KDE-Username=root testing standalone ok 12 testing 4GL ok 13 ok 14 ok 15 # skip ok 16 # skip testing 4GL-PER ok 17 ok 18 ok 19 # skip ok 20 # skip testing AHDL ok 21 ok 22 testing as kate plugin ok 23 -- Test file for kate's syntax highlighting Title "Test file";  -- BEGIN region (a region marker region) :)  % multiline comment goes on here %  -- END  FUNCTION FCT (Clk, Key) RETURNS (pulse);  SUBDESIGN CDCLOCK2 ( in : INPUT; -- go in out[3..0] : OUTPUT; -- come out )  VARIABLE start : soft; usec[3..0] : node;  BEGIN  in = FCT(clock, some_key); -- senseless code  -- comment blubb = (blobb[] == H"3ff");   IF in THEN asdf -- folde me END IF;   TABLE -- missing code END TABLE   END;  -- hex, octal, binary H"0" => B"1000000"; O"01234567";testing standalone ok 24 testing ANSI C89 ok 25 ok 26 ok 27 # skip ok 28 # skip testing ASP ok 29 ok 30 testing as kate plugin ok 31 <% 'kate: hl ASP; if ( instr(request.servervariables("PATH_INFO"),"login.asp") <= 0 and instr(request.servervariables("PATH_INFO"),"inset") <= 0 and instr(request.servervariables("PATH_INFO"),"Data") <= 0 and instr(request.servervariables("PATH_INFO"),"dropDown") <= 0 ) then  Session("originalRequestedPage") = Request.ServerVariables("PATH_INFO") & "?" & Request.ServerVariables("QUERY_STRING") end if  function countRecords( rsToCount )  numRecs = 0   do until rsToCount.eof  numRecs = numRecs + 1   rsToCount.movenext  loop   rsToCount.close ' just to make sure nobody  ' tries to operate on the recordset,  ' which has already reached eof   countRecords = numRecs end function  function unique( rs, sortColumn ) ' return unique instances of text in sortColumn within rs  dim sorted()   redim sorted(1)  dim i  i = 0  do until rs.eof  if (not find( rs(sortColumn), sorted )) then  redim preserve sorted(i+1)  sorted(i) = rs(sortColumn)  i = i + 1  end if  rs.MoveNext  loop   redim preserve sorted(i-1) ' the function will add an extra blank entry to the array   rs.Close ' close the recordset - we'll be using it again - and reset i - well be using it again, too   unique = sorted end function  sub testSub( variable ) ' do nothing impressive...  dim newVar   newVar = variable   if ( variable = true )  response.end  else %>  

We are writing text.

 <%=newVar%>

 

We have written text and outputted a variable.

  <% end if end sub %>testing standalone ok 32 testing AVR Assembler ok 33 ok 34 testing as kate plugin ok 35 ; ; Decodeur de trame pulsadis EJP et préavis EJP ; (pic 12C508 ou 509) ; Alain Gibaud, 20-2-2001 ; ; ========================================================  list r=hex,p=p12c508   include "p12c508.inc" GP0 equ 0 GP1 equ 1 GP2 equ 2 GP3 equ 3 GP4 equ 4 GP5 equ 5 TO equ 4  ; masques pour acceder aux pattes GP0bit equ 1 << GP0 GP1bit equ 1 << GP1 GP2bit equ 1 << GP2 GP3bit equ 1 << GP3 GP4bit equ 1 << GP4  GP5bit equ 1 << GP5  ; ======================================================== ; affectation des pattes ;   ; sorties: (actives niv bas) NORMAL equ GP0 ; LED verte ALERTE equ GP1 ; LED orange EJP equ GP2 ; LED rouge ; entrees:( actives niv bas) SIGNAL equ GP3 ; avec pull-up, en provenance filtre 175 Hz ; GP4-5 sont utilisees par l'horloge ; ======================================================== ; variables: TICKS equ 0x7 ; compteur de ticks (1 tick = 2/100 s) SLOT equ 0x8 ; numero slot dans la trame  ; ======================================================= ; Macros pour alleger le code ... ; ; Teste si min <= (var) < max ; branche en "in" si oui, en "out" si non. ;  Lminmax macro var,min,max,outm,in,outp  movlw min  subwf var,W ; (var) - min  btfss STATUS,C  goto outm ; C=0 => resutat < 0 => var < min    movlw max  subwf var,W ; (var) - max  btfss STATUS,C  goto in  goto outp ; C=1 => resutat >= 0 => var >= min  endm ; ; Attend que le bit "bit" du registre "reg" soit a 1 ; Waitbit1 macro reg,bit  local Wait1 Wait1 btfss reg,bit  goto Wait1  endm ; ; Attend que le bit "bit" du registre "reg" soit a 0 ; Waitbit0 macro reg,bit  local Wait0 Wait0 btfsc reg,bit  goto Wait0  endm ; ; Branche en "label" si (reg) == num, sinon continue ; Beq macro label,reg,num  movlw num  subwf reg,W  btfsc STATUS,Z   goto label  endm ; ; Branche en "label" si (reg) != num, sinon continue ; Bne macro label,reg,num  movlw num  subwf reg,W  btfss STATUS,Z   goto label  endm   ; ; Branche en "label" si (reg) < num, sinon continue ; Blt macro label,reg,num  movlw num  subwf reg,W ; reg - W  btfss STATUS,C   goto label ; C=0 => reg - W < 0  endm  ; ; Branche en "label" si (reg) >= num, sinon continue ; Bge macro label,reg,num  movlw num  subwf reg,W ; reg - W  btfsc STATUS,C   goto label ; C=1 => reg - W >= 0  endm ; ========================================================  ; CONFIG word ( en FFF )  ; bits 11:5 don't care  ; bit 4 : MCLRE enabled = 1, tied to Vdd = 0  ; bit 3 : code protection off = 1, on = 0  ; bit 2 : no watchdog = 0, watchdog = 1  ; bit 1-0 ; EXTRC = 00, INTRC = 10, XT = 01, LP = 00    __CONFIG B'000000001101' ; (horloge a quartz, avec watchdog)  ; ========================================================   org 0  goto debut ;========================================================= ; sous-programmes ; ======================================================== ; regarde si le timer est passe a 0 ; si oui, le compteur de ticks est incremente ; et on attend le repassage a 1  ; Cette routine DOIT etre appelee tout les 2/100 s ou plus souvent tickcount  clrwdt  movf TMR0,W  btfss STATUS,Z  retlw 0    incf TICKS,F ; attendre que le timer ait depasse 0 waitnoZ  clrwdt  movf TMR0,W  btfsc STATUS,Z  goto waitnoZ  retlw 0 ;  ; les 2 fct qui suivent maintiennent, le compteur de ticks ; (en plus de scruter une patte) ; attente d'un signal (logique negative) waitsignal  call tickcount  btfsc GPIO,SIGNAL  goto waitsignal  retlw 0 ; attente fin signal waitnosignal  call tickcount  btfss GPIO,SIGNAL  goto waitnosignal  retlw 0 ; remet a zero le compteur de ticks et le timer et le watchdog clearticks  clrwdt  clrw  movwf TICKS  movwf TMR0  ; pour eviter un timeout immediat, le timer est charge   ; a 1, et le 1er tick ne fait que 0.019922s au lieu de 0.2s  ; (ce n'est pas grave dans la mesure ou de toute facon,  ; le temps de traitement entre les different declenchements   ; de chrono n'est pas nul)  incf TMR0,F   retlw 0  ; ; ========================================================== ;  debut   ; reset par Watchdog ?  btfsc STATUS,TO  goto notimeout  ; TO == 0 : OUI  clrwdt  goto 0x1FF ; recalibrage, 0x3FF sur 12C509    ; TO == 1 : NON notimeout   movwf OSCCAL ; recalibrer l'horloge  clrf TMR0 ; RAZ timer  ; GPWU=1 : disable wake up on pin change  ; GPPU=0 : enable pullups (a voir avec le hard ..)  ; T0CS=0 : timer connected to F/4  ; T0SE=x : dont't care  ; PSA=0 : prescaler assigned to timer  ; PS2-0= : timer prescaler 111= 1/256, 101 = 1/64, 011 = 1/16  movlw B'10010101'   option     ; config des pattes  movlw B'00001000' ; GP0-2 en sortie, GP3 entree  tris GPIO    ; se mettre en mode normal  bcf GPIO,NORMAL  bsf GPIO,ALERTE  bsf GPIO,EJP     attendre_trame  call waitnosignal ; attendre ...  call waitsignal ; ... front montant   call clearticks  call waitnosignal  ; 45 tk = 0.9s, 55 tk = 1.1s  Lminmax TICKS,D'45',D'55',attendre_trame,pulse1s,attendre_trame pulse1s   ; attendre 162,5 tk = 2.75 s + 0.5 s = 3.25 s  call clearticks again325  call tickcount  Lminmax TICKS,D'162',D'162',again325,again325,end325 end325   ; on est maintenant au centre du 1er bit  ; il suffit d'echantillonner toutes les 2.5s  movlw 1  movwf SLOT   sample btfsc GPIO,SIGNAL ; logique negative  goto slot40    ; signal detecte !!  Bne not5,SLOT,D'5' ; slot == 5 ?  ; oui - 5 = passage en alerte  bsf GPIO,NORMAL ; bit a 1 = LED eteinte  bsf GPIO,EJP ; bit a 1 = LED eteinte  bcf GPIO,ALERTE ; bit a 0 = LED allumee  goto nextslot not5  Bne not15,SLOT,D'15' ; slot == 15 ?  ; oui  btfsc GPIO,ALERTE ; deja en alerte ?  goto endejp  ; oui - 5 & 15 = debut ejp   bsf GPIO,NORMAL ; bit a 1 = LED eteinte  bsf GPIO,ALERTE ; bit a 1 = LED eteinte  bcf GPIO,EJP ; bit a 0 = LED allumee  goto nextslot endejp  ; non - 15 seul = fin ejp  bsf GPIO,EJP ; bit a 1 = LED eteinte  bsf GPIO,ALERTE ; bit a 1 = LED eteinte  bcf GPIO,NORMAL ; bit a 0 = LED allumee  goto nextslot   not15 slot40  ; slot 40 ?  Bne nextslot,SLOT,D'40' ; slot == 40 ?  ; et attendre une nouvelle trame   goto attendre_trame nextslot  incf SLOT,F    ; si le signal est a 1, on en profite pour se resynchroniser  ; sur son front descendant, au cas ou l'emetteur ne soit pas  ; bien conforme au protocole.  btfss GPIO,SIGNAL  goto resynchro  ; attendre 125 ticks = 2.5s  call clearticks again125  call tickcount  Lminmax TICKS,D'125',D'126',again125,sample,again125   resynchro   call waitnosignal  call clearticks again100 ; attente 2 s (100 ticks)   call tickcount  Lminmax TICKS,D'100',D'101',again100,sample,again100   end   testing standalone ok 36 testing AWK ok 37 ok 38 testing as kate plugin ok 39 #!/usr # AWK hl test  # BEGIN and END are also matched as patterns BEGIN {  p = 0; }  /some pattern/ {  p++; }  # / inside brackets is not considered end of expression # a loose division operator (/) is not mismatched as a pattern. $1 =~ /[^abc/]def/ || b == 3 / 5 {  gsub ( FILENAME );  }  # TODO and FIXME also work in comments in Awk.  # Also backslash in patterns works. /\/usr\/bin\/awk/ { print "This is me"; }  END {  print p; } testing standalone ok 40 testing Ada ok 41 ok 42 ok 43 # skip ok 44 # skip testing Alerts ok 45 ok 46 ok 47 # skip ok 48 # skip testing Asm6502 ok 49 ok 50 ok 51 # skip ok 52 # skip testing Bash ok 53 ok 54 testing as kate plugin ok 55 #! /bin/sh # This is a test script for the Katepart Bash Syntax Highlighting by # Wilbert Berendsen. This is not runnable !!!   # The highlighting recognizes basic types of input, and has a few special cases that # are all in FindCommands. The main objective is to create really proper nesting of # (multiline) strings, variables, expressions, etc.    # ============== Tests: ===============  # basic types: 'single quoted string' "double quoted string" $'string with esc\apes\x0din it' $"string meant to be translated"   # comments: # this is a comment #this too echo this is#nt a comment dcop kate EditInterface#1 #this is   # brace expansion mv my_file.{JPG,jpg}   # special characters are escaped: echo \(output\) \&\| \> \< \" \' \*   # variable substitution: $filename.ext $filename_ext ${filename}_ext text${array[$subscript]}.text text${array["string"]}.text ${!prefix*} ${!redir} short are $_, $$, $?, ${@}, etc. ${variable//a/d} ${1:-default}   # expression subst: $(( cd << ed + 1 ))   # command subst: $(ls -l) echo `cat myfile`   # file subst: $(<$filename) $(</path/to/myfile)  # process subst: sort <(show_labels) | sed 's/a/bg' > my_file.txt 2>&1   # All substitutions also work in strings: "subst ${in}side string" 'not $inside this ofcourse' "The result is $(( $a + $b )). Thanks!" "Your homedir contains `ls $HOME |wc -l` files."   # Escapes in strings: p="String \` with \$ escapes \" ";   # keywords are black, builtins dark purple and common commands lighter purple set exit login   # Other colorings: error() {  cat /usr/bin/lesspipe.sh  runscript >& redir.bak  exec 3>&4 }   # do - done make code blocks while [ $p -lt $q ]  do  chown 0644 $file.$p done   # braces as well run_prog | sort -u | {  echo Header  while read a b d  do  echo $a/$b/$c  done  echo Footer }   # Any constructions can be nested: echo "A long string with $(  if [ $count -gt 100 ] ; then  echo "much"  else  echo "not much"  fi ) substitutions." ;   # Even the case construct is correctly folded: test -f blaat && ( do_something  case $p in  *bak)  do_bak $p  ;;  *)  dont_bak $p  ;;  esac ) # despite the extra parentheses in the case construction.   # variable assignments: DIR=/dev p=`ls` LC_ALL="nl" dcop 'kate*' _VAR=val ARR=(this is an array) ARR2=([this]=too [and]="this too") usage="$0 -- version $VERSION Multiple lines of output can be possible."   # Some commands expect variable names, these are colored correctly: export PATH=/my/bin:$PATH BLAAT export A B D local p=3 x y='\' read x y z <<< $hallo unset B declare -a VAR1 VAR2 && exit declare less a && b   # options are recoqnized: zip -f=file.zip ./configure --destdir=/usr make destdir=/usr/   # [[ and [ correctly need spaces to be regarded as structure, # otherwise they are patterns (currently treated as normal text) if [ "$p" == "" ] ; then  ls /usr/bin/[a-z]* elif [[ $p == 0 ]] ; then  ls /usr/share/$p fi  # Fixed: ls a[ab]* # dont try to interprete as assignment with subscript (fixed) a[ab] a[ab]=sa   # Here documents are difficult to catch: cat > myfile << __EOF__ You're right, this is definitely no bash code But ls more $parameters should be expanded. __EOF__   # quoted: cat << "EOF" You're right, this is definitely no bash code But ls more $parameters should be expanded. EOF   # indented: if true then  cat <<- EOF  Indented text with a $dollar or \$two  EOF elif [ -d $file ]; then  cat <<- "EOF"  Indented text without a $dollar  EOF fi  # the highlighting uses EOF and _{0,2}E[ON][A-Z_]+, quoted or not, indented or not. # text is correctly substituted and escaped if the delimiter is not quoted. testing standalone ok 56 testing BibTeX ok 57 ok 58 testing as kate plugin ok 59 % test file for kate's bibtex syntax highlighting  @Article{artikel, author = {Me}, title = {Something}, journal = {JHEP}, year = {2003}, }  @Book  {  boek, author = "Someone", title = "Something", journal = "Nucl. Phys. B", year = "2003", }  This is ignored by BibTeX, no special highlighting %This is not a comment, it is just ignored (thanks to the people in #latex) :)  @string{test="lange string die ik niet vaak opnieuw wil intikken"}  @PhdThesis{thesis, author = {Me}, title = {Dunno}, school = {ITFA}, year = {2005, hopefully}, } testing standalone ok 60 testing C ok 61 ok 62 ok 63 # skip ok 64 # skip testing C# ok 65 ok 66 ok 67 # skip ok 68 # skip testing C++ ok 69 ok 70 testing as kate plugin ok 71 /* This file is part of the KDE libraries  Copyright (C) 2003, 2004 Anders Lund   Copyright (C) 2003 Hamish Rodda   Copyright (C) 2001,2002 Joseph Wenninger   Copyright (C) 2001 Christoph Cullmann   Copyright (C) 1999 Jochen Wilhelmy    This library is free software; you can redistribute it and/or  modify it under the terms of the GNU Library General Public  License version 2 as published by the Free Software Foundation.   This library is distributed in the hope that it will be useful,  but WITHOUT ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU  Library General Public License for more details.   You should have received a copy of the GNU Library General Public License  along with this library; see the file COPYING.LIB. If not, write to  the Free Software Foundation, Inc., 59 Temple Place - Suite 330,  Boston, MA 02111-1307, USA. */  //BEGIN INCLUDES #include "katehighlight.h" #include "katehighlight.moc"  #include "katetextline.h" #include "katedocument.h" #include "katesyntaxdocument.h" #include "katerenderer.h" #include "katefactory.h" #include "kateschema.h" #include "kateconfig.h"  #include  #include  #include  #include  #include  #include  #include  #include  #include  #include  #include  #include  #include   #include  #include  //END  //BEGIN defines // same as in kmimemagic, no need to feed more data #define KATE_HL_HOWMANY 1024  // min. x seconds between two dynamic contexts reset static const int KATE_DYNAMIC_CONTEXTS_RESET_DELAY = 30 * 1000;  // x is a QString. if x is "true" or "1" this expression returns "true" #define IS_TRUE(x) x.lower() == QString("true") || x.toInt() == 1 //END defines  //BEGIN Prviate HL classes  inline bool kateInsideString (const QString &str, QChar ch) {  for (uint i=0; i < str.length(); i++)  if (*(str.unicode()+i) == ch)  return true;   return false; }  class KateHlItem {  public:  KateHlItem(int attribute, int context,signed char regionId, signed char regionId2);  virtual ~KateHlItem();   public:  // caller must keep in mind: LEN > 0 is a must !!!!!!!!!!!!!!!!!!!!!1  // Now, the function returns the offset detected, or 0 if no match is found.  // bool linestart isn't needed, this is equivalent to offset == 0.  virtual int checkHgl(const QString& text, int offset, int len) = 0;   virtual bool lineContinue(){return false;}   virtual QStringList *capturedTexts() {return 0;}  virtual KateHlItem *clone(const QStringList *) {return this;}   static void dynamicSubstitute(QString& str, const QStringList *args);   QMemArray subItems;  int attr;  int ctx;  signed char region;  signed char region2;   bool lookAhead;   bool dynamic;  bool dynamicChild;  bool firstNonSpace;  bool onlyConsume;  int column;   // start enable flags, nicer than the virtual methodes  // saves function calls  bool alwaysStartEnable;  bool customStartEnable; };  class KateHlContext {  public:  KateHlContext(const QString &_hlId, int attribute, int lineEndContext,int _lineBeginContext,  bool _fallthrough, int _fallthroughContext, bool _dynamic);  virtual ~KateHlContext();  KateHlContext *clone(const QStringList *args);   QValueVector items;  QString hlId; ///< A unique highlight identifier. Used to look up correct properties.  int attr;  int ctx;  int lineBeginContext;  /** @internal anders: possible escape if no rules matches.  false unless 'fallthrough="1|true"' (insensitive)  if true, go to ftcxt w/o eating of string.  ftctx is "fallthroughContext" in xml files, valid values are int or #pop[..]  see in KateHighlighting::doHighlight */  bool fallthrough;  int ftctx; // where to go after no rules matched   bool dynamic;  bool dynamicChild; };  class KateEmbeddedHlInfo {  public:  KateEmbeddedHlInfo() {loaded=false;context0=-1;}  KateEmbeddedHlInfo(bool l, int ctx0) {loaded=l;context0=ctx0;}   public:  bool loaded;  int context0; };  class KateHlIncludeRule {  public:  KateHlIncludeRule(int ctx_=0, uint pos_=0, const QString &incCtxN_="", bool incAttrib=false)  : ctx(ctx_)  , pos( pos_)  , incCtxN( incCtxN_ )  , includeAttrib( incAttrib )  {  incCtx=-1;  }  //KateHlIncludeRule(int ctx_, uint pos_, bool incAttrib) {ctx=ctx_;pos=pos_;incCtx=-1;incCtxN="";includeAttrib=incAttrib}   public:  int ctx;  uint pos;  int incCtx;  QString incCtxN;  bool includeAttrib; };  class KateHlCharDetect : public KateHlItem {  public:  KateHlCharDetect(int attribute, int context,signed char regionId,signed char regionId2, QChar);   virtual int checkHgl(const QString& text, int offset, int len);  virtual KateHlItem *clone(const QStringList *args);   private:  QChar sChar; };  class KateHl2CharDetect : public KateHlItem {  public:  KateHl2CharDetect(int attribute, int context, signed char regionId,signed char regionId2, QChar ch1, QChar ch2);  KateHl2CharDetect(int attribute, int context,signed char regionId,signed char regionId2, const QChar *ch);   virtual int checkHgl(const QString& text, int offset, int len);  virtual KateHlItem *clone(const QStringList *args);   private:  QChar sChar1;  QChar sChar2; };  class KateHlStringDetect : public KateHlItem {  public:  KateHlStringDetect(int attribute, int context, signed char regionId,signed char regionId2, const QString &, bool inSensitive=false);   virtual int checkHgl(const QString& text, int offset, int len);  virtual KateHlItem *clone(const QStringList *args);   private:  const QString str;  const int strLen;  const bool _inSensitive; };  class KateHlRangeDetect : public KateHlItem {  public:  KateHlRangeDetect(int attribute, int context, signed char regionId,signed char regionId2, QChar ch1, QChar ch2);   virtual int checkHgl(const QString& text, int offset, int len);   private:  QChar sChar1;  QChar sChar2; };  class KateHlKeyword : public KateHlItem {  public:  KateHlKeyword(int attribute, int context,signed char regionId,signed char regionId2, bool casesensitive, const QString& delims);  virtual ~KateHlKeyword ();   void addList(const QStringList &);  virtual int checkHgl(const QString& text, int offset, int len);   private:  QMemArray< QDict<bool>* > dict;  bool _caseSensitive;  const QString& deliminators;  int minLen;  int maxLen; };  class KateHlInt : public KateHlItem {  public:  KateHlInt(int attribute, int context, signed char regionId,signed char regionId2);   virtual int checkHgl(const QString& text, int offset, int len); };  class KateHlFloat : public KateHlItem {  public:  KateHlFloat(int attribute, int context, signed char regionId,signed char regionId2);  virtual ~KateHlFloat () {}   virtual int checkHgl(const QString& text, int offset, int len); };  class KateHlCFloat : public KateHlFloat {  public:  KateHlCFloat(int attribute, int context, signed char regionId,signed char regionId2);   virtual int checkHgl(const QString& text, int offset, int len);  int checkIntHgl(const QString& text, int offset, int len); };  class KateHlCOct : public KateHlItem {  public:  KateHlCOct(int attribute, int context, signed char regionId,signed char regionId2);   virtual int checkHgl(const QString& text, int offset, int len); };  class KateHlCHex : public KateHlItem {  public:  KateHlCHex(int attribute, int context, signed char regionId,signed char regionId2);   virtual int checkHgl(const QString& text, int offset, int len); };  class KateHlLineContinue : public KateHlItem {  public:  KateHlLineContinue(int attribute, int context, signed char regionId,signed char regionId2);   virtual bool endEnable(QChar c) {return c == '\0';}  virtual int checkHgl(const QString& text, int offset, int len);  virtual bool lineContinue(){return true;} };  class KateHlCStringChar : public KateHlItem {  public:  KateHlCStringChar(int attribute, int context, signed char regionId,signed char regionId2);   virtual int checkHgl(const QString& text, int offset, int len); };  class KateHlCChar : public KateHlItem {  public:  KateHlCChar(int attribute, int context,signed char regionId,signed char regionId2);   virtual int checkHgl(const QString& text, int offset, int len); };  class KateHlAnyChar : public KateHlItem {  public:  KateHlAnyChar(int attribute, int context, signed char regionId,signed char regionId2, const QString& charList);   virtual int checkHgl(const QString& text, int offset, int len);   private:  const QString _charList; };  class KateHlRegExpr : public KateHlItem {  public:  KateHlRegExpr(int attribute, int context,signed char regionId,signed char regionId2 ,QString expr, bool insensitive, bool minimal);  ~KateHlRegExpr() { delete Expr; };   virtual int checkHgl(const QString& text, int offset, int len);  virtual QStringList *capturedTexts();  virtual KateHlItem *clone(const QStringList *args);   private:  QRegExp *Expr;  bool handlesLinestart;  QString _regexp;  bool _insensitive;  bool _minimal; };  class KateHlDetectSpaces : public KateHlItem {  public:  KateHlDetectSpaces (int attribute, int context,signed char regionId,signed char regionId2)  : KateHlItem(attribute,context,regionId,regionId2) {}   virtual int checkHgl(const QString& text, int offset, int len)  {  int len2 = offset + len;  while ((offset < len2) && text[offset].isSpace()) offset++;  return offset;  } };  class KateHlDetectIdentifier : public KateHlItem {  public:  KateHlDetectIdentifier (int attribute, int context,signed char regionId,signed char regionId2)  : KateHlItem(attribute,context,regionId,regionId2) { alwaysStartEnable = false; }   virtual int checkHgl(const QString& text, int offset, int len)  {  // first char should be a letter or underscore  if ( text[offset].isLetter() || text[offset] == QChar ('_') )  {  // memorize length  int len2 = offset+len;   // one char seen  offset++;   // now loop for all other thingies  while (  (offset < len2)  && (text[offset].isLetterOrNumber() || (text[offset] == QChar ('_')))  )  offset++;   return offset;  }   return 0;  } };  //END  //BEGIN STATICS KateHlManager *KateHlManager::s_self = 0;  static const bool trueBool = true; static const QString stdDeliminator = QString (" \t.():!+,-<=>%&*/;?[]^{|}~\\"); //END  //BEGIN NON MEMBER FUNCTIONS static KateHlItemData::ItemStyles getDefStyleNum(QString name) {  if (name=="dsNormal") return KateHlItemData::dsNormal;  else if (name=="dsKeyword") return KateHlItemData::dsKeyword;  else if (name=="dsDataType") return KateHlItemData::dsDataType;  else if (name=="dsDecVal") return KateHlItemData::dsDecVal;  else if (name=="dsBaseN") return KateHlItemData::dsBaseN;  else if (name=="dsFloat") return KateHlItemData::dsFloat;  else if (name=="dsChar") return KateHlItemData::dsChar;  else if (name=="dsString") return KateHlItemData::dsString;  else if (name=="dsComment") return KateHlItemData::dsComment;  else if (name=="dsOthers") return KateHlItemData::dsOthers;  else if (name=="dsAlert") return KateHlItemData::dsAlert;  else if (name=="dsFunction") return KateHlItemData::dsFunction;  else if (name=="dsRegionMarker") return KateHlItemData::dsRegionMarker;  else if (name=="dsError") return KateHlItemData::dsError;   return KateHlItemData::dsNormal; } //END  //BEGIN KateHlItem KateHlItem::KateHlItem(int attribute, int context,signed char regionId,signed char regionId2)  : attr(attribute),  ctx(context),  region(regionId),  region2(regionId2),  lookAhead(false),  dynamic(false),  dynamicChild(false),  firstNonSpace(false),  onlyConsume(false),  column (-1),  alwaysStartEnable (true),  customStartEnable (false) { }  KateHlItem::~KateHlItem() {  //kdDebug(13010)<<"In hlItem::~KateHlItem()"<= '0' && c <= '9')  {  if ((uint)(c - '0') < args->size())  {  str.replace(i, 2, (*args)[c - '0']);  i += ((*args)[c - '0']).length() - 1;  }  else  {  str.replace(i, 2, "");  --i;  }  }  }  } } //END  //BEGIN KateHlCharDetect KateHlCharDetect::KateHlCharDetect(int attribute, int context, signed char regionId,signed char regionId2, QChar c)  : KateHlItem(attribute,context,regionId,regionId2)  , sChar(c) { }  int KateHlCharDetect::checkHgl(const QString& text, int offset, int /*len*/) {  if (text[offset] == sChar)  return offset + 1;   return 0; }  KateHlItem *KateHlCharDetect::clone(const QStringList *args) {  char c = sChar.latin1();   if (c < '0' || c > '9' || (unsigned)(c - '0') >= args->size())  return this;   KateHlCharDetect *ret = new KateHlCharDetect(attr, ctx, region, region2, (*args)[c - '0'][0]);  ret->dynamicChild = true;  return ret; } //END  //BEGIN KateHl2CharDetect KateHl2CharDetect::KateHl2CharDetect(int attribute, int context, signed char regionId,signed char regionId2, QChar ch1, QChar ch2)  : KateHlItem(attribute,context,regionId,regionId2)  , sChar1 (ch1)  , sChar2 (ch2) { }  int KateHl2CharDetect::checkHgl(const QString& text, int offset, int len) {  if ((len >= 2) && text[offset++] == sChar1 && text[offset++] == sChar2)  return offset;   return 0; }  KateHlItem *KateHl2CharDetect::clone(const QStringList *args) {  char c1 = sChar1.latin1();  char c2 = sChar2.latin1();   if (c1 < '0' || c1 > '9' || (unsigned)(c1 - '0') >= args->size())  return this;   if (c2 < '0' || c2 > '9' || (unsigned)(c2 - '0') >= args->size())  return this;   KateHl2CharDetect *ret = new KateHl2CharDetect(attr, ctx, region, region2, (*args)[c1 - '0'][0], (*args)[c2 - '0'][0]);  ret->dynamicChild = true;  return ret; } //END  //BEGIN KateHlStringDetect KateHlStringDetect::KateHlStringDetect(int attribute, int context, signed char regionId,signed char regionId2,const QString &s, bool inSensitive)  : KateHlItem(attribute, context,regionId,regionId2)  , str(inSensitive ? s.upper() : s)  , strLen (str.length())  , _inSensitive(inSensitive) { }  int KateHlStringDetect::checkHgl(const QString& text, int offset, int len) {  if (len < strLen)  return 0;   if (_inSensitive)  {  for (int i=0; i < strLen; i++)  if (text[offset++].upper() != str[i])  return 0;   return offset;  }  else  {  for (int i=0; i < strLen; i++)  if (text[offset++] != str[i])  return 0;   return offset;  }   return 0; }  KateHlItem *KateHlStringDetect::clone(const QStringList *args) {  QString newstr = str;   dynamicSubstitute(newstr, args);   if (newstr == str)  return this;   KateHlStringDetect *ret = new KateHlStringDetect(attr, ctx, region, region2, newstr, _inSensitive);  ret->dynamicChild = true;  return ret; } //END  //BEGIN KateHlRangeDetect KateHlRangeDetect::KateHlRangeDetect(int attribute, int context, signed char regionId,signed char regionId2, QChar ch1, QChar ch2)  : KateHlItem(attribute,context,regionId,regionId2)  , sChar1 (ch1)  , sChar2 (ch2) { }  int KateHlRangeDetect::checkHgl(const QString& text, int offset, int len) {  if (text[offset] == sChar1)  {  do  {  offset++;  len--;  if (len < 1) return 0;  }  while (text[offset] != sChar2);   return offset + 1;  }  return 0; } //END  //BEGIN KateHlKeyword KateHlKeyword::KateHlKeyword (int attribute, int context, signed char regionId,signed char regionId2, bool casesensitive, const QString& delims)  : KateHlItem(attribute,context,regionId,regionId2)  , _caseSensitive(casesensitive)  , deliminators(delims)  , minLen (0xFFFFFF)  , maxLen (0) {  alwaysStartEnable = false;  customStartEnable = true; }  KateHlKeyword::~KateHlKeyword () {  for (uint i=0; i < dict.size(); ++i)  delete dict[i]; }  void KateHlKeyword::addList(const QStringList& list) {  for(uint i=0; i < list.count(); ++i)  {  int len = list[i].length();   if (minLen > len)  minLen = len;   if (maxLen < len)  maxLen = len;   if ((uint)len >= dict.size())  {  uint oldSize = dict.size();  dict.resize (len+1);   for (uint m=oldSize; m < dict.size(); ++m)  dict[m] = 0;  }   if (!dict[len])  dict[len] = new QDict<bool> (17, _caseSensitive);   dict[len]->insert(list[i], &trueBool);  } }  int KateHlKeyword::checkHgl(const QString& text, int offset, int len) {  int offset2 = offset;  int wordLen = 0;   while ((len > wordLen) && !kateInsideString (deliminators, text[offset2]))  {  offset2++;  wordLen++;   if (wordLen > maxLen) return 0;  }   if (wordLen < minLen) return 0;   if ( dict[wordLen] && dict[wordLen]->find(QConstString(text.unicode() + offset, wordLen).string()) )  return offset2;   return 0; } //END  //BEGIN KateHlInt KateHlInt::KateHlInt(int attribute, int context, signed char regionId,signed char regionId2)  : KateHlItem(attribute,context,regionId,regionId2) {  alwaysStartEnable = false; }  int KateHlInt::checkHgl(const QString& text, int offset, int len) {  int offset2 = offset;   while ((len > 0) && text[offset2].isDigit())  {  offset2++;  len--;  }   if (offset2 > offset)  {  if (len > 0)  {  for (uint i=0; i < subItems.size(); i++)  {  if ( (offset = subItems[i]->checkHgl(text, offset2, len)) )  return offset;  }  }   return offset2;  }   return 0; } //END  //BEGIN KateHlFloat KateHlFloat::KateHlFloat(int attribute, int context, signed char regionId,signed char regionId2)  : KateHlItem(attribute,context, regionId,regionId2) {  alwaysStartEnable = false; }  int KateHlFloat::checkHgl(const QString& text, int offset, int len) {  bool b = false;  bool p = false;   while ((len > 0) && text[offset].isDigit())  {  offset++;  len--;  b = true;  }   if ((len > 0) && (p = (text[offset] == '.')))  {  offset++;  len--;   while ((len > 0) && text[offset].isDigit())  {  offset++;  len--;  b = true;  }  }   if (!b)  return 0;   if ((len > 0) && ((text[offset] & 0xdf) == 'E'))  {  offset++;  len--;  }  else  {  if (!p)  return 0;  else  {  if (len > 0)  {  for (uint i=0; i < subItems.size(); i++)  {  int offset2 = subItems[i]->checkHgl(text, offset, len);   if (offset2)  return offset2;  }  }   return offset;  }  }   if ((len > 0) && (text[offset] == '-' || text[offset] =='+'))  {  offset++;  len--;  }   b = false;   while ((len > 0) && text[offset].isDigit())  {  offset++;  len--;  b = true;  }   if (b)  {  if (len > 0)  {  for (uint i=0; i < subItems.size(); i++)  {  int offset2 = subItems[i]->checkHgl(text, offset, len);   if (offset2)  return offset2;  }  }   return offset;  }   return 0; } //END  //BEGIN KateHlCOct KateHlCOct::KateHlCOct(int attribute, int context, signed char regionId,signed char regionId2)  : KateHlItem(attribute,context,regionId,regionId2) {  alwaysStartEnable = false; }  int KateHlCOct::checkHgl(const QString& text, int offset, int len) {  if (text[offset] == '0')  {  offset++;  len--;   int offset2 = offset;   while ((len > 0) && (text[offset2] >= '0' && text[offset2] <= '7'))  {  offset2++;  len--;  }   if (offset2 > offset)  {  if ((len > 0) && ((text[offset2] & 0xdf) == 'L' || (text[offset] & 0xdf) == 'U' ))  offset2++;   return offset2;  }  }   return 0; } //END  //BEGIN KateHlCHex KateHlCHex::KateHlCHex(int attribute, int context,signed char regionId,signed char regionId2)  : KateHlItem(attribute,context,regionId,regionId2) {  alwaysStartEnable = false; }  int KateHlCHex::checkHgl(const QString& text, int offset, int len) {  if ((len > 1) && (text[offset++] == '0') && ((text[offset++] & 0xdf) == 'X' ))  {  len -= 2;   int offset2 = offset;   while ((len > 0) && (text[offset2].isDigit() || ((text[offset2] & 0xdf) >= 'A' && (text[offset2] & 0xdf) <= 'F')))  {  offset2++;  len--;  }   if (offset2 > offset)  {  if ((len > 0) && ((text[offset2] & 0xdf) == 'L' || (text[offset2] & 0xdf) == 'U' ))  offset2++;   return offset2;  }  }   return 0; } //END  //BEGIN KateHlCFloat KateHlCFloat::KateHlCFloat(int attribute, int context, signed char regionId,signed char regionId2)  : KateHlFloat(attribute,context,regionId,regionId2) {  alwaysStartEnable = false; }  int KateHlCFloat::checkIntHgl(const QString& text, int offset, int len) {  int offset2 = offset;   while ((len > 0) && text[offset].isDigit()) {  offset2++;  len--;  }   if (offset2 > offset)  return offset2;   return 0; }  int KateHlCFloat::checkHgl(const QString& text, int offset, int len) {  int offset2 = KateHlFloat::checkHgl(text, offset, len);   if (offset2)  {  if ((text[offset2] & 0xdf) == 'F' )  offset2++;   return offset2;  }  else  {  offset2 = checkIntHgl(text, offset, len);   if (offset2 && ((text[offset2] & 0xdf) == 'F' ))  return ++offset2;  else  return 0;  } } //END  //BEGIN KateHlAnyChar KateHlAnyChar::KateHlAnyChar(int attribute, int context, signed char regionId,signed char regionId2, const QString& charList)  : KateHlItem(attribute, context,regionId,regionId2)  , _charList(charList) { }  int KateHlAnyChar::checkHgl(const QString& text, int offset, int) {  if (kateInsideString (_charList, text[offset]))  return ++offset;   return 0; } //END  //BEGIN KateHlRegExpr KateHlRegExpr::KateHlRegExpr( int attribute, int context, signed char regionId,signed char regionId2, QString regexp, bool insensitive, bool minimal)  : KateHlItem(attribute, context, regionId,regionId2)  , handlesLinestart (regexp.startsWith("^"))  , _regexp(regexp)  , _insensitive(insensitive)  , _minimal(minimal) {  if (!handlesLinestart)  regexp.prepend("^");   Expr = new QRegExp(regexp, !_insensitive);  Expr->setMinimal(_minimal); }  int KateHlRegExpr::checkHgl(const QString& text, int offset, int /*len*/) {  if (offset && handlesLinestart)  return 0;   int offset2 = Expr->search( text, offset, QRegExp::CaretAtOffset );   if (offset2 == -1) return 0;   return (offset + Expr->matchedLength()); }  QStringList *KateHlRegExpr::capturedTexts() {  return new QStringList(Expr->capturedTexts()); }  KateHlItem *KateHlRegExpr::clone(const QStringList *args) {  QString regexp = _regexp;  QStringList escArgs = *args;   for (QStringList::Iterator it = escArgs.begin(); it != escArgs.end(); ++it)  {  (*it).replace(QRegExp("(\\W)"), "\\\\1");  }   dynamicSubstitute(regexp, &escArgs);   if (regexp == _regexp)  return this;   // kdDebug (13010) << "clone regexp: " << regexp << endl;   KateHlRegExpr *ret = new KateHlRegExpr(attr, ctx, region, region2, regexp, _insensitive, _minimal);  ret->dynamicChild = true;  return ret; } //END  //BEGIN KateHlLineContinue KateHlLineContinue::KateHlLineContinue(int attribute, int context, signed char regionId,signed char regionId2)  : KateHlItem(attribute,context,regionId,regionId2) { }  int KateHlLineContinue::checkHgl(const QString& text, int offset, int len) {  if ((len == 1) && (text[offset] == '\\'))  return ++offset;   return 0; } //END  //BEGIN KateHlCStringChar KateHlCStringChar::KateHlCStringChar(int attribute, int context,signed char regionId,signed char regionId2)  : KateHlItem(attribute,context,regionId,regionId2) { }  // checks for C escaped chars \n and escaped hex/octal chars static int checkEscapedChar(const QString& text, int offset, int& len) {  int i;  if (text[offset] == '\\' && len > 1)  {  offset++;  len--;   switch(text[offset])  {  case 'a': // checks for control chars  case 'b': // we want to fall through  case 'e':  case 'f':   case 'n':  case 'r':  case 't':  case 'v':  case '\'':  case '\"':  case '?' : // added ? ANSI C classifies this as an escaped char  case '\\':  offset++;  len--;  break;   case 'x': // if it's like \xff  offset++; // eat the x  len--;  // these for loops can probably be  // replaced with something else but  // for right now they work  // check for hexdigits  for (i = 0; (len > 0) && (i < 2) && (text[offset] >= '0' && text[offset] <= '9' || (text[offset] & 0xdf) >= 'A' && (text[offset] & 0xdf) <= 'F'); i++)  {  offset++;  len--;  }   if (i == 0)  return 0; // takes care of case '\x'   break;   case '0': case '1': case '2': case '3' :  case '4': case '5': case '6': case '7' :  for (i = 0; (len > 0) && (i < 3) && (text[offset] >='0'&& text[offset] <='7'); i++)  {  offset++;  len--;  }  break;   default:  return 0;  }   return offset;  }   return 0; }  int KateHlCStringChar::checkHgl(const QString& text, int offset, int len) {  return checkEscapedChar(text, offset, len); } //END  //BEGIN KateHlCChar KateHlCChar::KateHlCChar(int attribute, int context,signed char regionId,signed char regionId2)  : KateHlItem(attribute,context,regionId,regionId2) { }  int KateHlCChar::checkHgl(const QString& text, int offset, int len) {  if ((len > 1) && (text[offset] == '\'') && (text[offset+1] != '\''))  {  int oldl;  oldl = len;   len--;   int offset2 = checkEscapedChar(text, offset + 1, len);   if (!offset2)  {  if (oldl > 2)  {  offset2 = offset + 2;  len = oldl - 2;  }  else  {  return 0;  }  }   if ((len > 0) && (text[offset2] == '\''))  return ++offset2;  }   return 0; } //END  //BEGIN KateHl2CharDetect KateHl2CharDetect::KateHl2CharDetect(int attribute, int context, signed char regionId,signed char regionId2, const QChar *s)  : KateHlItem(attribute,context,regionId,regionId2) {  sChar1 = s[0];  sChar2 = s[1];  } //END KateHl2CharDetect  KateHlItemData::KateHlItemData(const QString name, int defStyleNum)  : name(name), defStyleNum(defStyleNum) { }  KateHlData::KateHlData(const QString &wildcards, const QString &mimetypes, const QString &identifier, int priority)  : wildcards(wildcards), mimetypes(mimetypes), identifier(identifier), priority(priority) { }  //BEGIN KateHlContext KateHlContext::KateHlContext (const QString &_hlId, int attribute, int lineEndContext, int _lineBeginContext, bool _fallthrough, int _fallthroughContext, bool _dynamic) {  hlId = _hlId;  attr = attribute;  ctx = lineEndContext;  lineBeginContext = _lineBeginContext;  fallthrough = _fallthrough;  ftctx = _fallthroughContext;  dynamic = _dynamic;  dynamicChild = false; }  KateHlContext *KateHlContext::clone(const QStringList *args) {  KateHlContext *ret = new KateHlContext(hlId, attr, ctx, lineBeginContext, fallthrough, ftctx, false);   for (uint n=0; n < items.size(); ++n)  {  KateHlItem *item = items[n];  KateHlItem *i = (item->dynamic ? item->clone(args) : item);  ret->items.append(i);  }   ret->dynamicChild = true;   return ret; }  KateHlContext::~KateHlContext() {  if (dynamicChild)  {  for (uint n=0; n < items.size(); ++n)  {  if (items[n]->dynamicChild)  delete items[n];  }  } } //END  //BEGIN KateHighlighting KateHighlighting::KateHighlighting(const KateSyntaxModeListItem *def) : refCount(0) {  m_attributeArrays.setAutoDelete (true);   errorsAndWarnings = "";  building=false;  noHl = false;  m_foldingIndentationSensitive = false;  folding=false;  internalIDList.setAutoDelete(true);   if (def == 0)  {  noHl = true;  iName = "None"; // not translated internal name (for config and more)  iNameTranslated = i18n("None"); // user visible name  iSection = "";  m_priority = 0;  iHidden = false;  m_additionalData.insert( "none", new HighlightPropertyBag );  m_additionalData["none"]->deliminator = stdDeliminator;  m_additionalData["none"]->wordWrapDeliminator = stdDeliminator;  m_hlIndex[0] = "none";  }  else  {  iName = def->name;  iNameTranslated = def->nameTranslated;  iSection = def->section;  iHidden = def->hidden;  iWildcards = def->extension;  iMimetypes = def->mimetype;  identifier = def->identifier;  iVersion=def->version;  iAuthor=def->author;  iLicense=def->license;  m_priority=def->priority.toInt();  }   deliminator = stdDeliminator; }  KateHighlighting::~KateHighlighting() {  for (uint i=0; i < m_contexts.size(); ++i)  delete m_contexts[i]; }  void KateHighlighting::generateContextStack(int *ctxNum, int ctx, QMemArray<short>* ctxs, int *prevLine) {  //kdDebug(13010)<= 0)  {  (*ctxNum) = ctx;   ctxs->resize (ctxs->size()+1, QGArray::SpeedOptim);  (*ctxs)[ctxs->size()-1]=(*ctxNum);   return;  }  else  {  if (ctx == -1)  {  (*ctxNum)=( (ctxs->isEmpty() ) ? 0 : (*ctxs)[ctxs->size()-1]);  }  else  {  int size = ctxs->size() + ctx + 1;   if (size > 0)  {  ctxs->resize (size, QGArray::SpeedOptim);  (*ctxNum)=(*ctxs)[size-1];  }  else  {  ctxs->resize (0, QGArray::SpeedOptim);  (*ctxNum)=0;  }   ctx = 0;   if ((*prevLine) >= (int)(ctxs->size()-1))  {  *prevLine=ctxs->size()-1;   if ( ctxs->isEmpty() )  return;   KateHlContext *c = contextNum((*ctxs)[ctxs->size()-1]);  if (c && (c->ctx != -1))  {  //kdDebug(13010)<<"PrevLine > size()-1 and ctx!=-1)"<ctx;   continue;  }  }  }   return;  }  } }  /** * Creates a new dynamic context or reuse an old one if it has already been created.  */ int KateHighlighting::makeDynamicContext(KateHlContext *model, const QStringList *args) {  QPair key(model, args->front());  short value;   if (dynamicCtxs.contains(key))  value = dynamicCtxs[key];  else  {  kdDebug(13010) << "new stuff: " << startctx << endl;   KateHlContext *newctx = model->clone(args);   m_contexts.push_back (newctx);   value = startctx++;  dynamicCtxs[key] = value;  KateHlManager::self()->incDynamicCtxs();  }   // kdDebug(13010) << "Dynamic context: using context #" << value << " (for model " << model << " with args " << *args << ")" << endl;   return value; }  /** * Drop all dynamic contexts. Shall be called with extreme care, and shall be immediatly  * followed by a full HL invalidation.  */ void KateHighlighting::dropDynamicContexts() {  for (uint i=base_startctx; i < m_contexts.size(); ++i)  delete m_contexts[i];   m_contexts.resize (base_startctx);   dynamicCtxs.clear();  startctx = base_startctx; }  /** * Parse the text and fill in the context array and folding list array  *  * @param prevLine The previous line, the context array is picked up from that if present.  * @param textLine The text line to parse  * @param foldinglist will be filled  * @param ctxChanged will be set to reflect if the context changed  */ void KateHighlighting::doHighlight ( KateTextLine *prevLine,  KateTextLine *textLine,  QMemArray<uint>* foldingList,  bool *ctxChanged ) {  if (!textLine)  return;   if (noHl)  {  if (textLine->length() > 0)  memset (textLine->attributes(), 0, textLine->length());   return;  }   // duplicate the ctx stack, only once !  QMemArray<short> ctx;  ctx.duplicate (prevLine->ctxArray());   int ctxNum = 0;  int previousLine = -1;  KateHlContext *context;   if (ctx.isEmpty())  {  // If the stack is empty, we assume to be in Context 0 (Normal)  context = contextNum(ctxNum);  }  else  {  // There does an old context stack exist -> find the context at the line start  ctxNum = ctx[ctx.size()-1]; //context ID of the last character in the previous line   //kdDebug(13010) << "\t\tctxNum = " << ctxNum << " contextList[ctxNum] = " << contextList[ctxNum] << endl; // ellis   //if (lineContinue) kdDebug(13010)<hlLineContinue())  {  prevLine--;  }  else  {  generateContextStack(&ctxNum, context->ctx, &ctx, &previousLine); //get stack ID to use   if (!(context = contextNum(ctxNum)))  context = contextNum(0);  }   //kdDebug(13010)<<"test1-2-1-text4"<string();  const int len = textLine->length();   // calc at which char the first char occurs, set it to lenght of line if never  const int firstChar = textLine->firstChar();  const int startNonSpace = (firstChar == -1) ? len : firstChar;   // last found item  KateHlItem *item = 0;   // loop over the line, offset gives current offset  int offset = 0;  while (offset < len)  {  bool anItemMatched = false;  bool standardStartEnableDetermined = false;  bool customStartEnableDetermined = false;   uint index = 0;  for (item = context->items.empty() ? 0 : context->items[0]; item; item = (++index < context->items.size()) ? context->items[index] : 0 )  {  // does we only match if we are firstNonSpace?  if (item->firstNonSpace && (offset > startNonSpace))  continue;   // have we a column specified? if yes, only match at this column  if ((item->column != -1) && (item->column != offset))  continue;   if (!item->alwaysStartEnable)  {  if (item->customStartEnable)  {  if (customStartEnableDetermined || kateInsideString (m_additionalData[context->hlId]->deliminator, lastChar))  customStartEnableDetermined = true;  else  continue;  }  else  {  if (standardStartEnableDetermined || kateInsideString (stdDeliminator, lastChar))  standardStartEnableDetermined = true;  else  continue;  }  }   int offset2 = item->checkHgl(text, offset, len-offset);   if (offset2 <= offset)  continue;   if (item->region2)  {  // kdDebug(13010)<region2)<isEmpty() && ((item->region2 < 0) && (*foldingList)[foldingList->size()-2] == -item->region2 ) )  {  foldingList->resize (foldingList->size()-2, QGArray::SpeedOptim);  }  else  {  foldingList->resize (foldingList->size()+2, QGArray::SpeedOptim);  (*foldingList)[foldingList->size()-2] = (uint)item->region2;  if (item->region2<0) //check not really needed yet  (*foldingList)[foldingList->size()-1] = offset2;  else  (*foldingList)[foldingList->size()-1] = offset;  }   }   if (item->region)  {  // kdDebug(13010)<region)<isEmpty() && ((item->region < 0) && (*foldingList)[foldingList->size()-1] == -item->region ) )  {  foldingList->resize (foldingList->size()-1, QGArray::SpeedOptim);  }  else*/  {  foldingList->resize (foldingList->size()+2, QGArray::SpeedOptim);  (*foldingList)[foldingList->size()-2] = item->region;  if (item->region<0) //check not really needed yet  (*foldingList)[foldingList->size()-1] = offset2;  else  (*foldingList)[foldingList->size()-1] = offset;  }   }   // regenerate context stack if needed  if (item->ctx != -1)  {  generateContextStack (&ctxNum, item->ctx, &ctx, &previousLine);  context = contextNum(ctxNum);  }   // dynamic context: substitute the model with an 'instance'  if (context->dynamic)  {  QStringList *lst = item->capturedTexts();  if (lst != 0)  {  // Replace the top of the stack and the current context  int newctx = makeDynamicContext(context, lst);  if (ctx.size() > 0)  ctx[ctx.size() - 1] = newctx;  ctxNum = newctx;  context = contextNum(ctxNum);  }  delete lst;  }   // dominik: look ahead w/o changing offset?  if (!item->lookAhead)  {  if (offset2 > len)  offset2 = len;   // even set attributes ;)  memset ( textLine->attributes()+offset  , item->onlyConsume ? context->attr : item->attr  , len-offset);   offset = offset2;  lastChar = text[offset-1];  }   anItemMatched = true;  break;  }   // something matched, continue loop  if (anItemMatched)  continue;   // nothing found: set attribute of one char  // anders: unless this context does not want that!  if ( context->fallthrough )  {  // set context to context->ftctx.  generateContextStack(&ctxNum, context->ftctx, &ctx, &previousLine); //regenerate context stack  context=contextNum(ctxNum);  //kdDebug(13010)<<"context num after fallthrough at col "<attributes() + offset) = context->attr;  lastChar = text[offset];  offset++;  }  }   // has the context stack changed ?  if (ctx == textLine->ctxArray())  {  if (ctxChanged)  (*ctxChanged) = false;  }  else  {  if (ctxChanged)  (*ctxChanged) = true;   // assign ctx stack !  textLine->setContext(ctx);  }   // write hl continue flag  textLine->setHlLineContinue (item && item->lineContinue()); }  void KateHighlighting::loadWildcards() {  KConfig *config = KateHlManager::self()->getKConfig();  config->setGroup("Highlighting " + iName);   QString extensionString = config->readEntry("Wildcards", iWildcards);   if (extensionSource != extensionString) {  regexpExtensions.clear();  plainExtensions.clear();   extensionSource = extensionString;   static QRegExp sep("\\s*;\\s*");   QStringList l = QStringList::split( sep, extensionSource );   static QRegExp boringExpression("\\*\\.[\\d\\w]+");   for( QStringList::Iterator it = l.begin(); it != l.end(); ++it )  if (boringExpression.exactMatch(*it))  plainExtensions.append((*it).mid(1));  else  regexpExtensions.append(QRegExp((*it), true, true));  } }  QValueList& KateHighlighting::getRegexpExtensions() {  return regexpExtensions; }  QStringList& KateHighlighting::getPlainExtensions() {  return plainExtensions; }  QString KateHighlighting::getMimetypes() {  KConfig *config = KateHlManager::self()->getKConfig();  config->setGroup("Highlighting " + iName);   return config->readEntry("Mimetypes", iMimetypes); }  int KateHighlighting::priority() {  KConfig *config = KateHlManager::self()->getKConfig();  config->setGroup("Highlighting " + iName);   return config->readNumEntry("Priority", m_priority); }  KateHlData *KateHighlighting::getData() {  KConfig *config = KateHlManager::self()->getKConfig();  config->setGroup("Highlighting " + iName);   KateHlData *hlData = new KateHlData(  config->readEntry("Wildcards", iWildcards),  config->readEntry("Mimetypes", iMimetypes),  config->readEntry("Identifier", identifier),  config->readNumEntry("Priority", m_priority));   return hlData; }  void KateHighlighting::setData(KateHlData *hlData) {  KConfig *config = KateHlManager::self()->getKConfig();  config->setGroup("Highlighting " + iName);   config->writeEntry("Wildcards",hlData->wildcards);  config->writeEntry("Mimetypes",hlData->mimetypes);  config->writeEntry("Priority",hlData->priority); }  void KateHighlighting::getKateHlItemDataList (uint schema, KateHlItemDataList &list) {  KConfig *config = KateHlManager::self()->getKConfig();  config->setGroup("Highlighting " + iName + " - Schema " + KateFactory::self()->schemaManager()->name(schema));   list.clear();  createKateHlItemData(list);   for (KateHlItemData *p = list.first(); p != 0L; p = list.next())  {  QStringList s = config->readListEntry(p->name);  // kdDebug(13010)<name<0)  {   while(s.count()<9) s<<"";  p->clear();   QString tmp=s[0]; if (!tmp.isEmpty()) p->defStyleNum=tmp.toInt();   QRgb col;   tmp=s[1]; if (!tmp.isEmpty()) {  col=tmp.toUInt(0,16); p->setTextColor(col); }   tmp=s[2]; if (!tmp.isEmpty()) {  col=tmp.toUInt(0,16); p->setSelectedTextColor(col); }   tmp=s[3]; if (!tmp.isEmpty()) p->setBold(tmp!="0");   tmp=s[4]; if (!tmp.isEmpty()) p->setItalic(tmp!="0");   tmp=s[5]; if (!tmp.isEmpty()) p->setStrikeOut(tmp!="0");   tmp=s[6]; if (!tmp.isEmpty()) p->setUnderline(tmp!="0");   tmp=s[7]; if (!tmp.isEmpty()) {  col=tmp.toUInt(0,16); p->setBGColor(col); }   tmp=s[8]; if (!tmp.isEmpty()) {  col=tmp.toUInt(0,16); p->setSelectedBGColor(col); }   }  } }  /** * Saves the KateHlData attribute definitions to the config file.  *  * @param schema The id of the schema group to save  * @param list KateHlItemDataList containing the data to be used  */ void KateHighlighting::setKateHlItemDataList(uint schema, KateHlItemDataList &list) {  KConfig *config = KateHlManager::self()->getKConfig();  config->setGroup("Highlighting " + iName + " - Schema "  + KateFactory::self()->schemaManager()->name(schema));   QStringList settings;   for (KateHlItemData *p = list.first(); p != 0L; p = list.next())  {  settings.clear();  settings<defStyleNum,10);  settings<<(p->itemSet(KateAttribute::TextColor)?QString::number(p->textColor().rgb(),16):"");  settings<<(p->itemSet(KateAttribute::SelectedTextColor)?QString::number(p->selectedTextColor().rgb(),16):"");  settings<<(p->itemSet(KateAttribute::Weight)?(p->bold()?"1":"0"):"");  settings<<(p->itemSet(KateAttribute::Italic)?(p->italic()?"1":"0"):"");  settings<<(p->itemSet(KateAttribute::StrikeOut)?(p->strikeOut()?"1":"0"):"");  settings<<(p->itemSet(KateAttribute::Underline)?(p->underline()?"1":"0"):"");  settings<<(p->itemSet(KateAttribute::BGColor)?QString::number(p->bgColor().rgb(),16):"");  settings<<(p->itemSet(KateAttribute::SelectedBGColor)?QString::number(p->selectedBGColor().rgb(),16):"");  settings<<"---";  config->writeEntry(p->name,settings);  } }  /** * Increase the usage count, and trigger initialization if needed.  */ void KateHighlighting::use() {  if (refCount == 0)  init();   refCount++; }  /** * Decrease the usage count, and trigger cleanup if needed.  */ void KateHighlighting::release() {  refCount--;   if (refCount == 0)  done(); }  /** * Initialize a context for the first time.  */  void KateHighlighting::init() {  if (noHl)  return;   m_contexts.clear ();  makeContextList(); }   /** * If the there is no document using the highlighting style free the complete  * context structure.  */ void KateHighlighting::done() {  if (noHl)  return;   m_contexts.clear ();  internalIDList.clear(); }  /** * KateHighlighting - createKateHlItemData  * This function reads the itemData entries from the config file, which specifies the  * default attribute styles for matched items/contexts.  *  * @param list A reference to the internal list containing the parsed default config  */ void KateHighlighting::createKateHlItemData(KateHlItemDataList &list) {  // If no highlighting is selected we need only one default.  if (noHl)  {  list.append(new KateHlItemData(i18n("Normal Text"), KateHlItemData::dsNormal));  return;  }   // If the internal list isn't already available read the config file  if (internalIDList.isEmpty())  makeContextList();   list=internalIDList; }  /** * Adds the styles of the currently parsed highlight to the itemdata list  */ void KateHighlighting::addToKateHlItemDataList() {  //Tell the syntax document class which file we want to parse and which data group  KateHlManager::self()->syntax->setIdentifier(buildIdentifier);  KateSyntaxContextData *data = KateHlManager::self()->syntax->getGroupInfo("highlighting","itemData");   //begin with the real parsing  while (KateHlManager::self()->syntax->nextGroup(data))  {  // read all attributes  QString color = KateHlManager::self()->syntax->groupData(data,QString("color"));  QString selColor = KateHlManager::self()->syntax->groupData(data,QString("selColor"));  QString bold = KateHlManager::self()->syntax->groupData(data,QString("bold"));  QString italic = KateHlManager::self()->syntax->groupData(data,QString("italic"));  QString underline = KateHlManager::self()->syntax->groupData(data,QString("underline"));  QString strikeOut = KateHlManager::self()->syntax->groupData(data,QString("strikeOut"));  QString bgColor = KateHlManager::self()->syntax->groupData(data,QString("backgroundColor"));  QString selBgColor = KateHlManager::self()->syntax->groupData(data,QString("selBackgroundColor"));   KateHlItemData* newData = new KateHlItemData(  buildPrefix+KateHlManager::self()->syntax->groupData(data,QString("name")).simplifyWhiteSpace(),  getDefStyleNum(KateHlManager::self()->syntax->groupData(data,QString("defStyleNum"))));   /* here the custom style overrides are specified, if needed */  if (!color.isEmpty()) newData->setTextColor(QColor(color));  if (!selColor.isEmpty()) newData->setSelectedTextColor(QColor(selColor));  if (!bold.isEmpty()) newData->setBold( IS_TRUE(bold) );  if (!italic.isEmpty()) newData->setItalic( IS_TRUE(italic) );  // new attributes for the new rendering view  if (!underline.isEmpty()) newData->setUnderline( IS_TRUE(underline) );  if (!strikeOut.isEmpty()) newData->setStrikeOut( IS_TRUE(strikeOut) );  if (!bgColor.isEmpty()) newData->setBGColor(QColor(bgColor));  if (!selBgColor.isEmpty()) newData->setSelectedBGColor(QColor(selBgColor));   internalIDList.append(newData);  }   //clean up  if (data)  KateHlManager::self()->syntax->freeGroupInfo(data); }  /** * KateHighlighting - lookupAttrName  * This function is a helper for makeContextList and createKateHlItem. It looks the given  * attribute name in the itemData list up and returns it's index  *  * @param name the attribute name to lookup  * @param iDl the list containing all available attributes  *  * @return The index of the attribute, or 0 if the attribute isn't found  */ int KateHighlighting::lookupAttrName(const QString& name, KateHlItemDataList &iDl) {  for (uint i = 0; i < iDl.count(); i++)  if (iDl.at(i)->name == buildPrefix+name)  return i;   kdDebug(13010)<<"Couldn't resolve itemDataName:"<index translation  * @param RegionList list of code folding region names  * @param ContextNameList list of context names  *  * @return A pointer to the newly created item object  */ KateHlItem *KateHighlighting::createKateHlItem(KateSyntaxContextData *data,  KateHlItemDataList &iDl,  QStringList *RegionList,  QStringList *ContextNameList) {  // No highlighting -> exit  if (noHl)  return 0;   // get the (tagname) itemd type  QString dataname=KateHlManager::self()->syntax->groupItemData(data,QString(""));   // code folding region handling:  QString beginRegionStr=KateHlManager::self()->syntax->groupItemData(data,QString("beginRegion"));  QString endRegionStr=KateHlManager::self()->syntax->groupItemData(data,QString("endRegion"));   signed char regionId=0;  signed char regionId2=0;   if (!beginRegionStr.isEmpty())  {  regionId = RegionList->findIndex(beginRegionStr);   if (regionId==-1) // if the region name doesn't already exist, add it to the list  {  (*RegionList)<findIndex(beginRegionStr);  }   regionId++;   kdDebug(13010) << "########### BEG REG: " << beginRegionStr << " NUM: " << regionId << endl;  }   if (!endRegionStr.isEmpty())  {  regionId2 = RegionList->findIndex(endRegionStr);   if (regionId2==-1) // if the region name doesn't already exist, add it to the list  {  (*RegionList)<findIndex(endRegionStr);  }   regionId2 = -regionId2 - 1;   kdDebug(13010) << "########### END REG: " << endRegionStr << " NUM: " << regionId2 << endl;  }   int attr = 0;  QString tmpAttr=KateHlManager::self()->syntax->groupItemData(data,QString("attribute")).simplifyWhiteSpace();  bool onlyConsume = tmpAttr.isEmpty();   // only relevant for non consumer  if (!onlyConsume)  {  if (QString("%1").arg(tmpAttr.toInt())==tmpAttr)  {  errorsAndWarnings+=i18n(  "%1: Deprecated syntax. Attribute (%2) not addressed by symbolic name
").  arg(buildIdentifier).arg(tmpAttr);  attr=tmpAttr.toInt();  }  else  attr=lookupAttrName(tmpAttr,iDl);  }   // Info about context switch  int context = -1;  QString unresolvedContext;  QString tmpcontext=KateHlManager::self()->syntax->groupItemData(data,QString("context"));  if (!tmpcontext.isEmpty())  context=getIdFromString(ContextNameList, tmpcontext,unresolvedContext);   // Get the char parameter (eg DetectChar)  char chr;  if (! KateHlManager::self()->syntax->groupItemData(data,QString("char")).isEmpty())  chr= (KateHlManager::self()->syntax->groupItemData(data,QString("char")).latin1())[0];  else  chr=0;   // Get the String parameter (eg. StringDetect)  QString stringdata=KateHlManager::self()->syntax->groupItemData(data,QString("String"));   // Get a second char parameter (char1) (eg Detect2Chars)  char chr1;  if (! KateHlManager::self()->syntax->groupItemData(data,QString("char1")).isEmpty())  chr1= (KateHlManager::self()->syntax->groupItemData(data,QString("char1")).latin1())[0];  else  chr1=0;   // Will be removed eventuall. Atm used for StringDetect and RegExp  bool insensitive = IS_TRUE( KateHlManager::self()->syntax->groupItemData(data,QString("insensitive")) );   // for regexp only  bool minimal = IS_TRUE( KateHlManager::self()->syntax->groupItemData(data,QString("minimal")) );   // dominik: look ahead and do not change offset. so we can change contexts w/o changing offset1.  bool lookAhead = IS_TRUE( KateHlManager::self()->syntax->groupItemData(data,QString("lookAhead")) );   bool dynamic= IS_TRUE(KateHlManager::self()->syntax->groupItemData(data,QString("dynamic")) );   bool firstNonSpace = IS_TRUE(KateHlManager::self()->syntax->groupItemData(data,QString("firstNonSpace")) );   int column = -1;  QString colStr = KateHlManager::self()->syntax->groupItemData(data,QString("column"));  if (!colStr.isEmpty())  column = colStr.toInt();   //Create the item corresponding to it's type and set it's parameters  KateHlItem *tmpItem;   if (dataname=="keyword")  {  KateHlKeyword *keyword=new KateHlKeyword(attr,context,regionId,regionId2,casesensitive,  m_additionalData[ buildIdentifier ]->deliminator);   //Get the entries for the keyword lookup list  keyword->addList(KateHlManager::self()->syntax->finddata("highlighting",stringdata));  tmpItem=keyword;  }  else if (dataname=="Float") tmpItem= (new KateHlFloat(attr,context,regionId,regionId2));  else if (dataname=="Int") tmpItem=(new KateHlInt(attr,context,regionId,regionId2));  else if (dataname=="DetectChar") tmpItem=(new KateHlCharDetect(attr,context,regionId,regionId2,chr));  else if (dataname=="Detect2Chars") tmpItem=(new KateHl2CharDetect(attr,context,regionId,regionId2,chr,chr1));  else if (dataname=="RangeDetect") tmpItem=(new KateHlRangeDetect(attr,context,regionId,regionId2, chr, chr1));  else if (dataname=="LineContinue") tmpItem=(new KateHlLineContinue(attr,context,regionId,regionId2));  else if (dataname=="StringDetect") tmpItem=(new KateHlStringDetect(attr,context,regionId,regionId2,stringdata,insensitive));  else if (dataname=="AnyChar") tmpItem=(new KateHlAnyChar(attr,context,regionId,regionId2,stringdata));  else if (dataname=="RegExpr") tmpItem=(new KateHlRegExpr(attr,context,regionId,regionId2,stringdata, insensitive, minimal));  else if (dataname=="HlCChar") tmpItem= ( new KateHlCChar(attr,context,regionId,regionId2));  else if (dataname=="HlCHex") tmpItem= (new KateHlCHex(attr,context,regionId,regionId2));  else if (dataname=="HlCOct") tmpItem= (new KateHlCOct(attr,context,regionId,regionId2));  else if (dataname=="HlCFloat") tmpItem= (new KateHlCFloat(attr,context,regionId,regionId2));  else if (dataname=="HlCStringChar") tmpItem= (new KateHlCStringChar(attr,context,regionId,regionId2));  else if (dataname=="DetectSpaces") tmpItem= (new KateHlDetectSpaces(attr,context,regionId,regionId2));  else if (dataname=="DetectIdentifier") tmpItem= (new KateHlDetectIdentifier(attr,context,regionId,regionId2));  else  {  // oops, unknown type. Perhaps a spelling error in the xml file  return 0;  }   // set lookAhead & dynamic properties  tmpItem->lookAhead = lookAhead;  tmpItem->dynamic = dynamic;  tmpItem->firstNonSpace = firstNonSpace;  tmpItem->column = column;  tmpItem->onlyConsume = onlyConsume;   if (!unresolvedContext.isEmpty())  {  unresolvedContextReferences.insert(&(tmpItem->ctx),unresolvedContext);  }   return tmpItem; }  QString KateHighlighting::hlKeyForAttrib( int i ) const {  int k = 0;  QMap<int,QString>::const_iterator it = m_hlIndex.constEnd();  while ( it != m_hlIndex.constBegin() )  {  --it;  k = it.key();  if ( i >= k )  break;  }  return it.data(); }  bool KateHighlighting::isInWord( QChar c, int attrib ) const {  static const QString& sq = KGlobal::staticQString(" \"'");  return m_additionalData[ hlKeyForAttrib( attrib ) ]->deliminator.find(c) < 0 && sq.find(c) < 0; }  bool KateHighlighting::canBreakAt( QChar c, int attrib ) const {  static const QString& sq = KGlobal::staticQString("\"'");  return (m_additionalData[ hlKeyForAttrib( attrib ) ]->wordWrapDeliminator.find(c) != -1) && (sq.find(c) == -1); }  signed char KateHighlighting::commentRegion(int attr) const {  QString commentRegion=m_additionalData[ hlKeyForAttrib( attr ) ]->multiLineRegion;  return (commentRegion.isEmpty()?0:(commentRegion.toShort())); }  bool KateHighlighting::canComment( int startAttrib, int endAttrib ) const {  QString k = hlKeyForAttrib( startAttrib );  return ( k == hlKeyForAttrib( endAttrib ) &&  ( ( !m_additionalData[k]->multiLineCommentStart.isEmpty() && !m_additionalData[k]->multiLineCommentEnd.isEmpty() ) ||  ! m_additionalData[k]->singleLineCommentMarker.isEmpty() ) ); }  QString KateHighlighting::getCommentStart( int attrib ) const {  return m_additionalData[ hlKeyForAttrib( attrib) ]->multiLineCommentStart; }  QString KateHighlighting::getCommentEnd( int attrib ) const {  return m_additionalData[ hlKeyForAttrib( attrib ) ]->multiLineCommentEnd; }  QString KateHighlighting::getCommentSingleLineStart( int attrib ) const {  return m_additionalData[ hlKeyForAttrib( attrib) ]->singleLineCommentMarker; }  /** * Helper for makeContextList. It parses the xml file for  * information, how single or multi line comments are marked  */ void KateHighlighting::readCommentConfig() {  KateHlManager::self()->syntax->setIdentifier(buildIdentifier);  KateSyntaxContextData *data=KateHlManager::self()->syntax->getGroupInfo("general","comment");   QString cmlStart, cmlEnd, cmlRegion, cslStart ;   if (data)  {  while (KateHlManager::self()->syntax->nextGroup(data))  {  if (KateHlManager::self()->syntax->groupData(data,"name")=="singleLine")  cslStart=KateHlManager::self()->syntax->groupData(data,"start");   if (KateHlManager::self()->syntax->groupData(data,"name")=="multiLine")  {  cmlStart=KateHlManager::self()->syntax->groupData(data,"start");  cmlEnd=KateHlManager::self()->syntax->groupData(data,"end");  cmlRegion=KateHlManager::self()->syntax->groupData(data,"region");  }  }   KateHlManager::self()->syntax->freeGroupInfo(data);  }  else  {  cslStart = "";  cmlStart = "";  cmlEnd = "";  cmlRegion = "";  }  m_additionalData[buildIdentifier]->singleLineCommentMarker = cslStart;  m_additionalData[buildIdentifier]->multiLineCommentStart = cmlStart;  m_additionalData[buildIdentifier]->multiLineCommentEnd = cmlEnd;  m_additionalData[buildIdentifier]->multiLineRegion = cmlRegion; }  /** * Helper for makeContextList. It parses the xml file for information,  * if keywords should be treated case(in)sensitive and creates the keyword  * delimiter list. Which is the default list, without any given weak deliminiators  */ void KateHighlighting::readGlobalKeywordConfig() {  deliminator = stdDeliminator;  // Tell the syntax document class which file we want to parse  kdDebug(13010)<<"readGlobalKeywordConfig:BEGIN"<syntax->setIdentifier(buildIdentifier);  KateSyntaxContextData *data = KateHlManager::self()->syntax->getConfig("general","keywords");   if (data)  {  kdDebug(13010)<<"Found global keyword config"<syntax->groupItemData(data,QString("casesensitive"))!="0")  casesensitive=true;  else  casesensitive=false;   //get the weak deliminators  weakDeliminator=(KateHlManager::self()->syntax->groupItemData(data,QString("weakDeliminator")));   kdDebug(13010)<<"weak delimiters are: "< -1)  deliminator.remove (f, 1);  }   QString addDelim = (KateHlManager::self()->syntax->groupItemData(data,QString("additionalDeliminator")));   if (!addDelim.isEmpty())  deliminator=deliminator+addDelim;   KateHlManager::self()->syntax->freeGroupInfo(data);  }  else  {  //Default values  casesensitive=true;  weakDeliminator=QString("");  }   kdDebug(13010)<<"readGlobalKeywordConfig:END"<deliminator = deliminator; }  /** * Helper for makeContextList. It parses the xml file for any wordwrap  * deliminators, characters * at which line can be broken. In case no keyword  * tag is found in the xml file, the wordwrap deliminators list defaults to the  * standard denominators. In case a keyword tag is defined, but no  * wordWrapDeliminator attribute is specified, the deliminator list as computed  * in readGlobalKeywordConfig is used.  *  * @return the computed delimiter string.  */ void KateHighlighting::readWordWrapConfig() {  // Tell the syntax document class which file we want to parse  kdDebug(13010)<<"readWordWrapConfig:BEGIN"<syntax->setIdentifier(buildIdentifier);  KateSyntaxContextData *data = KateHlManager::self()->syntax->getConfig("general","keywords");   QString wordWrapDeliminator = stdDeliminator;  if (data)  {  kdDebug(13010)<<"Found global keyword config"<syntax->groupItemData(data,QString("wordWrapDeliminator")));  //when no wordWrapDeliminator is defined use the deliminator list  if ( wordWrapDeliminator.length() == 0 ) wordWrapDeliminator = deliminator;   kdDebug(13010) << "word wrap deliminators are " << wordWrapDeliminator << endl;   KateHlManager::self()->syntax->freeGroupInfo(data);  }   kdDebug(13010)<<"readWordWrapConfig:END"<wordWrapDeliminator = wordWrapDeliminator; }  void KateHighlighting::readIndentationConfig() {  m_indentation = "";   KateHlManager::self()->syntax->setIdentifier(buildIdentifier);  KateSyntaxContextData *data = KateHlManager::self()->syntax->getConfig("general","indentation");   if (data)  {  m_indentation = (KateHlManager::self()->syntax->groupItemData(data,QString("mode")));   KateHlManager::self()->syntax->freeGroupInfo(data);  } }  void KateHighlighting::readFoldingConfig() {  // Tell the syntax document class which file we want to parse  kdDebug(13010)<<"readfoldignConfig:BEGIN"<syntax->setIdentifier(buildIdentifier);  KateSyntaxContextData *data = KateHlManager::self()->syntax->getConfig("general","folding");   if (data)  {  kdDebug(13010)<<"Found global keyword config"<syntax->groupItemData(data,QString("indentationsensitive"))!="1")  m_foldingIndentationSensitive=false;  else  m_foldingIndentationSensitive=true;   KateHlManager::self()->syntax->freeGroupInfo(data);  }  else  {  //Default values  m_foldingIndentationSensitive = false;  }   kdDebug(13010)<<"readfoldingConfig:END"<clear();   KateHlManager::self()->syntax->setIdentifier(buildIdentifier);   KateSyntaxContextData *data=KateHlManager::self()->syntax->getGroupInfo("highlighting","context");   int id=ctx0;   if (data)  {  while (KateHlManager::self()->syntax->nextGroup(data))  {  QString tmpAttr=KateHlManager::self()->syntax->groupData(data,QString("name")).simplifyWhiteSpace();  if (tmpAttr.isEmpty())  {  tmpAttr=QString("!KATE_INTERNAL_DUMMY! %1").arg(id);  errorsAndWarnings +=i18n("%1: Deprecated syntax. Context %2 has no symbolic name
").arg(buildIdentifier).arg(id-ctx0);  }  else tmpAttr=buildPrefix+tmpAttr;  (*ContextNameList)<syntax->freeGroupInfo(data);  }  kdDebug(13010)<<"creatingContextNameList:END"<findIndex(buildPrefix+tmpLineEndContext);  if (context==-1)  {  context=tmpLineEndContext.toInt();  errorsAndWarnings+=i18n(  "%1:Deprecated syntax. Context %2 not addressed by a symbolic name"  ).arg(buildIdentifier).arg(tmpLineEndContext);  } //#warning restructure this the name list storage. // context=context+buildContext0Offset;  }  return context; }  /** * The most important initialization function for each highlighting. It's called  * each time a document gets a highlighting style assigned. parses the xml file  * and creates a corresponding internal structure  */ void KateHighlighting::makeContextList() {  if (noHl) // if this a highlighting for "normal texts" only, tere is no need for a context list creation  return;   embeddedHls.clear();  unresolvedContextReferences.clear();  RegionList.clear();  ContextNameList.clear();   // prepare list creation. To reuse as much code as possible handle this  // highlighting the same way as embedded onces  embeddedHls.insert(iName,KateEmbeddedHlInfo());   bool something_changed;  // the context "0" id is 0 for this hl, all embedded context "0"s have offsets  startctx=base_startctx=0;  // inform everybody that we are building the highlighting contexts and itemlists  building=true;   do  {  kdDebug(13010)<<"**************** Outter loop in make ContextList"<identifierForName(it.key());   kdDebug(13010)<<"Location is:"<< identifierToUse<incCtx==-1) // context unresolved ?  {   if ((*it)->incCtxN.isEmpty())  {  // no context name given, and no valid context id set, so this item is  // going to be removed  KateHlIncludeRules::iterator it1=it;  ++it1;  delete (*it);  includeRules.remove(it);  it=it1;  }  else  {  // resolve name to id  (*it)->incCtx=getIdFromString(&ContextNameList,(*it)->incCtxN,dummy);  kdDebug(13010)<<"Resolved "<<(*it)->incCtxN<< " to "<<(*it)->incCtx<<" for include rule"<1->2->3->1  while (!includeRules.isEmpty())  handleKateHlIncludeRulesRecursive(includeRules.begin(),&includeRules); }  void KateHighlighting::handleKateHlIncludeRulesRecursive(KateHlIncludeRules::iterator it, KateHlIncludeRules *list) {  if (it==list->end()) return; //invalid iterator, shouldn't happen, but better have a rule prepared ;)   KateHlIncludeRules::iterator it1=it;  int ctx=(*it1)->ctx;   // find the last entry for the given context in the KateHlIncludeRules list  // this is need if one context includes more than one. This saves us from  // updating all insert positions:  // eg: context 0:  // pos 3 - include context 2  // pos 5 - include context 3  // During the building of the includeRules list the items are inserted in  // ascending order, now we need it descending to make our life easier.  while ((it!=list->end()) && ((*it)->ctx==ctx))  {  it1=it;  ++it;  }   // iterate over each include rule for the context the function has been called for.  while ((it1!=list->end()) && ((*it1)->ctx==ctx))  {  int ctx1=(*it1)->incCtx;   //let's see, if the the included context includes other contexts  for (KateHlIncludeRules::iterator it2=list->begin();it2!=list->end();++it2)  {  if ((*it2)->ctx==ctx1)  {  //yes it does, so first handle that include rules, since we want to  // include those subincludes too  handleKateHlIncludeRulesRecursive(it2,list);  break;  }  }   // if the context we want to include had sub includes, they are already inserted there.  KateHlContext *dest=m_contexts[ctx];  KateHlContext *src=m_contexts[ctx1]; // kdDebug(3010)<<"linking included rules from "<includeAttrib )  dest->attr = src->attr;   // insert the included context's rules starting at position p  int p=(*it1)->pos;   // remember some stuff  int oldLen = dest->items.size();  uint itemsToInsert = src->items.size();   // resize target  dest->items.resize (oldLen + itemsToInsert);   // move old elements  for (int i=oldLen-1; i >= p; --i)  dest->items[i+itemsToInsert] = dest->items[i];   // insert new stuff  for (uint i=0; i < itemsToInsert; ++i )  dest->items[p+i] = src->items[i];   it=it1; //backup the iterator  --it1; //move to the next entry, which has to be take care of  delete (*it); //free the already handled data structure  list->remove(it); // remove it from the list  } }  /** * Add one highlight to the contextlist.  *  * @return the number of contexts after this is added.  */ int KateHighlighting::addToContextList(const QString &ident, int ctx0) {  kdDebug(13010)<<"=== Adding hl with ident '"<syntax->setIdentifier(ident))  {  noHl=true;  KMessageBox::information(0L,i18n(  "Since there has been an error parsing the highlighting description, "  "this highlighting will be disabled"));  return 0;  }   // only read for the own stuff  if (identifier == ident)  {  readIndentationConfig ();  }   RegionList<<"!KateInternal_TopLevel!";   m_hlIndex[internalIDList.count()] = ident;  m_additionalData.insert( ident, new HighlightPropertyBag );   // fill out the propertybag  readCommentConfig();  readGlobalKeywordConfig();  readWordWrapConfig();   readFoldingConfig ();   QString ctxName;   // This list is needed for the translation of the attribute parameter,  // if the itemData name is given instead of the index  addToKateHlItemDataList();  KateHlItemDataList iDl = internalIDList;   createContextNameList(&ContextNameList,ctx0);    kdDebug(13010)<<"Parsing Context structure"<syntax->getGroupInfo("highlighting","context");  uint i=buildContext0Offset;  if (data)  {  while (KateHlManager::self()->syntax->nextGroup(data))  {  kdDebug(13010)<<"Found a context in file, building structure now"<syntax->groupData(data,QString("attribute")).simplifyWhiteSpace();  int attr;  if (QString("%1").arg(tmpAttr.toInt())==tmpAttr)  attr=tmpAttr.toInt();  else  attr=lookupAttrName(tmpAttr,iDl);  //END - Translation of the attribute parameter   ctxName=buildPrefix+KateHlManager::self()->syntax->groupData(data,QString("lineEndContext")).simplifyWhiteSpace();   QString tmpLineEndContext=KateHlManager::self()->syntax->groupData(data,QString("lineEndContext")).simplifyWhiteSpace();  int context;   context=getIdFromString(&ContextNameList, tmpLineEndContext,dummy);   //BEGIN get fallthrough props  bool ft = false;  int ftc = 0; // fallthrough context  if ( i > 0 ) // fallthrough is not smart in context 0  {  QString tmpFt = KateHlManager::self()->syntax->groupData(data, QString("fallthrough") );  if ( IS_TRUE(tmpFt) )  ft = true;  if ( ft )  {  QString tmpFtc = KateHlManager::self()->syntax->groupData( data, QString("fallthroughContext") );   ftc=getIdFromString(&ContextNameList, tmpFtc,dummy);  if (ftc == -1) ftc =0;   kdDebug(13010)<<"Setting fall through context (context "<syntax->groupData(data, QString("dynamic") );  if ( tmpDynamic.lower() == "true" || tmpDynamic.toInt() == 1 )  dynamic = true;   KateHlContext *ctxNew = new KateHlContext (  ident,  attr,  context,  (KateHlManager::self()->syntax->groupData(data,QString("lineBeginContext"))).isEmpty()?-1:  (KateHlManager::self()->syntax->groupData(data,QString("lineBeginContext"))).toInt(),  ft, ftc, dynamic);   m_contexts.push_back (ctxNew);   kdDebug(13010) << "INDEX: " << i << " LENGTH " << m_contexts.size()-1 << endl;   //Let's create all items for the context  while (KateHlManager::self()->syntax->nextItem(data))  { // kdDebug(13010)<< "In make Contextlist: Item:"<syntax->groupItemData(data,QString(""));  if ( tag == "IncludeRules" ) //if the new item is an Include rule, we have to take special care  {  QString incCtx = KateHlManager::self()->syntax->groupItemData( data, QString("context"));  QString incAttrib = KateHlManager::self()->syntax->groupItemData( data, QString("includeAttrib"));  bool includeAttrib = ( incAttrib.lower() == "true" || incAttrib.toInt() == 1 );  // only context refernces of type NAME and ##Name are allowed  if (incCtx.startsWith("##") || (!incCtx.startsWith("#")))  {  //#stay, #pop is not interesting here  if (!incCtx.startsWith("#"))  {  // a local reference -> just initialize the include rule structure  incCtx=buildPrefix+incCtx.simplifyWhiteSpace();  includeRules.append(new KateHlIncludeRule(i,m_contexts[i]->items.count(),incCtx, includeAttrib));  }  else  {  //a cross highlighting reference  kdDebug(13010)<<"Cross highlight reference "<items.count(),"",includeAttrib);   //use the same way to determine cross hl file references as other items do  if (!embeddedHls.contains(incCtx.right(incCtx.length()-2)))  embeddedHls.insert(incCtx.right(incCtx.length()-2),KateEmbeddedHlInfo());   unresolvedContextReferences.insert(&(ir->incCtx),  incCtx.right(incCtx.length()-2));   includeRules.append(ir);  }  }   continue;  }  // TODO -- can we remove the block below?? #if 0  QString tag = KateHlManager::self()->syntax->groupKateHlItemData(data,QString(""));  if ( tag == "IncludeRules" ) {  // attrib context: the index (jowenn, i think using names here  // would be a cool feat, goes for mentioning the context in  // any item. a map or dict?)  int ctxId = getIdFromString(&ContextNameList,  KateHlManager::self()->syntax->groupKateHlItemData( data, QString("context")),dummy); // the index is *required*  if ( ctxId > -1) { // we can even reuse rules of 0 if we want to:)  kdDebug(13010)<<"makeContextList["<items.first(); c; c = m_contexts[ctxId]->items.next() )  m_contexts[i]->items.append(c);  }  else  kdDebug(13010)<<"Context "<items.append(c);   // Not supported completely atm and only one level. Subitems.(all have  // to be matched to at once)  datasub=KateHlManager::self()->syntax->getSubItems(data);  bool tmpbool;  if (tmpbool=KateHlManager::self()->syntax->nextItem(datasub))  {  for (;tmpbool;tmpbool=KateHlManager::self()->syntax->nextItem(datasub))  {  c->subItems.resize (c->subItems.size()+1);  c->subItems[c->subItems.size()-1] = createKateHlItem(datasub,iDl,&RegionList,&ContextNameList);  } }  KateHlManager::self()->syntax->freeGroupInfo(datasub);  // end of sublevel  }  }  i++;  }  }   KateHlManager::self()->syntax->freeGroupInfo(data);   if (RegionList.count()!=1)  folding=true;   folding = folding || m_foldingIndentationSensitive;   //BEGIN Resolve multiline region if possible  if (!m_additionalData[ ident ]->multiLineRegion.isEmpty()) {  long commentregionid=RegionList.findIndex( m_additionalData[ ident ]->multiLineRegion );  if (-1==commentregionid) {  errorsAndWarnings+=i18n(  "%1: Specified multiline comment region (%2) could not be resolved
"  ).arg(buildIdentifier).arg( m_additionalData[ ident ]->multiLineRegion );  m_additionalData[ ident ]->multiLineRegion = QString();  kdDebug(13010)<<"ERROR comment region attribute could not be resolved"<multiLineRegion=QString::number(commentregionid+1);  kdDebug(13010)<<"comment region resolved to:"<multiLineRegion< > it( m_attributeArrays ); it.current(); ++it )  {  // k, schema correct, let create the data  KateAttributeList defaultStyleList;  defaultStyleList.setAutoDelete(true);  KateHlManager::self()->getDefaults(it.currentKey(), defaultStyleList);   KateHlItemDataList itemDataList;  getKateHlItemDataList(it.currentKey(), itemDataList);   uint nAttribs = itemDataList.count();  QMemArray *array = it.current();  array->resize (nAttribs);   for (uint z = 0; z < nAttribs; z++)  {  KateHlItemData *itemData = itemDataList.at(z);  KateAttribute n = *defaultStyleList.at(itemData->defStyleNum);   if (itemData && itemData->isSomethingSet())  n += *itemData;   array->at(z) = n;  }  } }  QMemArray *KateHighlighting::attributes (uint schema) {  QMemArray *array;   // found it, allready floating around  if ((array = m_attributeArrays[schema]))  return array;   // ohh, not found, check if valid schema number  if (!KateFactory::self()->schemaManager()->validSchema(schema))  {  // uhh, not valid :/, stick with normal default schema, it's always there !  return attributes (0);  }   // k, schema correct, let create the data  KateAttributeList defaultStyleList;  defaultStyleList.setAutoDelete(true);  KateHlManager::self()->getDefaults(schema, defaultStyleList);   KateHlItemDataList itemDataList;  getKateHlItemDataList(schema, itemDataList);   uint nAttribs = itemDataList.count();  array = new QMemArray (nAttribs);   for (uint z = 0; z < nAttribs; z++)  {  KateHlItemData *itemData = itemDataList.at(z);  KateAttribute n = *defaultStyleList.at(itemData->defStyleNum);   if (itemData && itemData->isSomethingSet())  n += *itemData;   array->at(z) = n;  }   m_attributeArrays.insert(schema, array);   return array; }  void KateHighlighting::getKateHlItemDataListCopy (uint schema, KateHlItemDataList &outlist) {  KateHlItemDataList itemDataList;  getKateHlItemDataList(schema, itemDataList);   outlist.clear ();  outlist.setAutoDelete (true);  for (uint z=0; z < itemDataList.count(); z++)  outlist.append (new KateHlItemData (*itemDataList.at(z))); }  //END  //BEGIN KateHlManager KateHlManager::KateHlManager()  : QObject()  , m_config ("katesyntaxhighlightingrc", false, false)  , commonSuffixes (QStringList::split(";", ".orig;.new;~;.bak;.BAK"))  , syntax (new KateSyntaxDocument())  , dynamicCtxsCount(0)  , forceNoDCReset(false) {  hlList.setAutoDelete(true);  hlDict.setAutoDelete(false);   KateSyntaxModeList modeList = syntax->modeList();  for (uint i=0; i < modeList.count(); i++)  {  KateHighlighting *hl = new KateHighlighting(modeList[i]);   uint insert = 0;  for (; insert <= hlList.count(); insert++)  {  if (insert == hlList.count())  break;   if ( QString(hlList.at(insert)->section() + hlList.at(insert)->nameTranslated()).lower()  > QString(hl->section() + hl->nameTranslated()).lower() )  break;  }   hlList.insert (insert, hl);  hlDict.insert (hl->name(), hl);  }   // Normal HL  KateHighlighting *hl = new KateHighlighting(0);  hlList.prepend (hl);  hlDict.insert (hl->name(), hl);   lastCtxsReset.start(); }  KateHlManager::~KateHlManager() {  delete syntax; }  static KStaticDeleter sdHlMan;  KateHlManager *KateHlManager::self() {  if ( !s_self )  sdHlMan.setObject(s_self, new KateHlManager ());   return s_self; }  KateHighlighting *KateHlManager::getHl(int n) {  if (n < 0 || n >= (int) hlList.count())  n = 0;   return hlList.at(n); }  int KateHlManager::nameFind(const QString &name) {  int z (hlList.count() - 1);  for (; z > 0; z--)  if (hlList.at(z)->name() == name)  return z;   return z; }  int KateHlManager::detectHighlighting (KateDocument *doc) {  int hl = wildcardFind( doc->url().filename() );  if ( hl < 0 )  hl = mimeFind ( doc );   return hl; }  int KateHlManager::wildcardFind(const QString &fileName) {  int result = -1;  if ((result = realWildcardFind(fileName)) != -1)  return result;   int length = fileName.length();  QString backupSuffix = KateDocumentConfig::global()->backupSuffix();  if (fileName.endsWith(backupSuffix)) {  if ((result = realWildcardFind(fileName.left(length - backupSuffix.length()))) != -1)  return result;  }   for (QStringList::Iterator it = commonSuffixes.begin(); it != commonSuffixes.end(); ++it) {  if (*it != backupSuffix && fileName.endsWith(*it)) {  if ((result = realWildcardFind(fileName.left(length - (*it).length()))) != -1)  return result;  }  }   return -1; }  int KateHlManager::realWildcardFind(const QString &fileName) {  static QRegExp sep("\\s*;\\s*");   QPtrList highlights;   for (KateHighlighting *highlight = hlList.first(); highlight != 0L; highlight = hlList.next()) {  highlight->loadWildcards();   for (QStringList::Iterator it = highlight->getPlainExtensions().begin(); it != highlight->getPlainExtensions().end(); ++it)  if (fileName.endsWith((*it)))  highlights.append(highlight);   for (int i = 0; i < (int)highlight->getRegexpExtensions().count(); i++) {  QRegExp re = highlight->getRegexpExtensions()[i];  if (re.exactMatch(fileName))  highlights.append(highlight);  }  }   if ( !highlights.isEmpty() )  {  int pri = -1;  int hl = -1;   for (KateHighlighting *highlight = highlights.first(); highlight != 0L; highlight = highlights.next())  {  if (highlight->priority() > pri)  {  pri = highlight->priority();  hl = hlList.findRef (highlight);  }  }  return hl;  }   return -1; }  int KateHlManager::mimeFind( KateDocument *doc ) {  static QRegExp sep("\\s*;\\s*");   KMimeType::Ptr mt = doc->mimeTypeForContent();   QPtrList highlights;   for (KateHighlighting *highlight = hlList.first(); highlight != 0L; highlight = hlList.next())  {  QStringList l = QStringList::split( sep, highlight->getMimetypes() );   for( QStringList::Iterator it = l.begin(); it != l.end(); ++it )  {  if ( *it == mt->name() ) // faster than a regexp i guess?  highlights.append (highlight);  }  }   if ( !highlights.isEmpty() )  {  int pri = -1;  int hl = -1;   for (KateHighlighting *highlight = highlights.first(); highlight != 0L; highlight = highlights.next())  {  if (highlight->priority() > pri)  {  pri = highlight->priority();  hl = hlList.findRef (highlight);  }  }   return hl;  }   return -1; }  uint KateHlManager::defaultStyles() {  return 14; }  QString KateHlManager::defaultStyleName(int n, bool translateNames) {  static QStringList names;  static QStringList translatedNames;   if (names.isEmpty())  {  names << "Normal";  names << "Keyword";  names << "Data Type";  names << "Decimal/Value";  names << "Base-N Integer";  names << "Floating Point";  names << "Character";  names << "String";  names << "Comment";  names << "Others";  names << "Alert";  names << "Function";  // this next one is for denoting the beginning/end of a user defined folding region  names << "Region Marker";  // this one is for marking invalid input  names << "Error";   translatedNames << i18n("Normal");  translatedNames << i18n("Keyword");  translatedNames << i18n("Data Type");  translatedNames << i18n("Decimal/Value");  translatedNames << i18n("Base-N Integer");  translatedNames << i18n("Floating Point");  translatedNames << i18n("Character");  translatedNames << i18n("String");  translatedNames << i18n("Comment");  translatedNames << i18n("Others");  translatedNames << i18n("Alert");  translatedNames << i18n("Function");  // this next one is for denoting the beginning/end of a user defined folding region  translatedNames << i18n("Region Marker");  // this one is for marking invalid input  translatedNames << i18n("Error");  }   return translateNames ? translatedNames[n] : names[n]; }  void KateHlManager::getDefaults(uint schema, KateAttributeList &list) {  list.setAutoDelete(true);   KateAttribute* normal = new KateAttribute();  normal->setTextColor(Qt::black);  normal->setSelectedTextColor(Qt::white);  list.append(normal);   KateAttribute* keyword = new KateAttribute();  keyword->setTextColor(Qt::black);  keyword->setSelectedTextColor(Qt::white);  keyword->setBold(true);  list.append(keyword);   KateAttribute* dataType = new KateAttribute();  dataType->setTextColor(Qt::darkRed);  dataType->setSelectedTextColor(Qt::white);  list.append(dataType);   KateAttribute* decimal = new KateAttribute();  decimal->setTextColor(Qt::blue);  decimal->setSelectedTextColor(Qt::cyan);  list.append(decimal);   KateAttribute* basen = new KateAttribute();  basen->setTextColor(Qt::darkCyan);  basen->setSelectedTextColor(Qt::cyan);  list.append(basen);   KateAttribute* floatAttribute = new KateAttribute();  floatAttribute->setTextColor(Qt::darkMagenta);  floatAttribute->setSelectedTextColor(Qt::cyan);  list.append(floatAttribute);   KateAttribute* charAttribute = new KateAttribute();  charAttribute->setTextColor(Qt::magenta);  charAttribute->setSelectedTextColor(Qt::magenta);  list.append(charAttribute);   KateAttribute* string = new KateAttribute();  string->setTextColor(QColor::QColor("#D00"));  string->setSelectedTextColor(Qt::red);  list.append(string);   KateAttribute* comment = new KateAttribute();  comment->setTextColor(Qt::darkGray);  comment->setSelectedTextColor(Qt::gray);  comment->setItalic(true);  list.append(comment);   KateAttribute* others = new KateAttribute();  others->setTextColor(Qt::darkGreen);  others->setSelectedTextColor(Qt::green);  list.append(others);   KateAttribute* alert = new KateAttribute();  alert->setTextColor(Qt::white);  alert->setSelectedTextColor( QColor::QColor("#FCC") );  alert->setBold(true);  alert->setBGColor( QColor::QColor("#FCC") );  list.append(alert);   KateAttribute* functionAttribute = new KateAttribute();  functionAttribute->setTextColor(Qt::darkBlue);  functionAttribute->setSelectedTextColor(Qt::white);  list.append(functionAttribute);   KateAttribute* regionmarker = new KateAttribute();  regionmarker->setTextColor(Qt::white);  regionmarker->setBGColor(Qt::gray);  regionmarker->setSelectedTextColor(Qt::gray);  list.append(regionmarker);   KateAttribute* error = new KateAttribute();  error->setTextColor(Qt::red);  error->setUnderline(true);  error->setSelectedTextColor(Qt::red);  list.append(error);   KConfig *config = KateHlManager::self()->self()->getKConfig();  config->setGroup("Default Item Styles - Schema " + KateFactory::self()->schemaManager()->name(schema));   for (uint z = 0; z < defaultStyles(); z++)  {  KateAttribute *i = list.at(z);  QStringList s = config->readListEntry(defaultStyleName(z));  if (!s.isEmpty())  {  while( s.count()<8)  s << "";   QString tmp;  QRgb col;   tmp=s[0]; if (!tmp.isEmpty()) {  col=tmp.toUInt(0,16); i->setTextColor(col); }   tmp=s[1]; if (!tmp.isEmpty()) {  col=tmp.toUInt(0,16); i->setSelectedTextColor(col); }   tmp=s[2]; if (!tmp.isEmpty()) i->setBold(tmp!="0");   tmp=s[3]; if (!tmp.isEmpty()) i->setItalic(tmp!="0");   tmp=s[4]; if (!tmp.isEmpty()) i->setStrikeOut(tmp!="0");   tmp=s[5]; if (!tmp.isEmpty()) i->setUnderline(tmp!="0");   tmp=s[6]; if (!tmp.isEmpty()) {  if ( tmp != "-" )  {  col=tmp.toUInt(0,16);  i->setBGColor(col);  }  else  i->clearAttribute(KateAttribute::BGColor);  }  tmp=s[7]; if (!tmp.isEmpty()) {  if ( tmp != "-" )  {  col=tmp.toUInt(0,16);  i->setSelectedBGColor(col);  }  else  i->clearAttribute(KateAttribute::SelectedBGColor);  }  }  } }  void KateHlManager::setDefaults(uint schema, KateAttributeList &list) {  KConfig *config = KateHlManager::self()->self()->getKConfig();  config->setGroup("Default Item Styles - Schema " + KateFactory::self()->schemaManager()->name(schema));   for (uint z = 0; z < defaultStyles(); z++)  {  QStringList settings;  KateAttribute *i = list.at(z);   settings<<(i->itemSet(KateAttribute::TextColor)?QString::number(i->textColor().rgb(),16):"");  settings<<(i->itemSet(KateAttribute::SelectedTextColor)?QString::number(i->selectedTextColor().rgb(),16):"");  settings<<(i->itemSet(KateAttribute::Weight)?(i->bold()?"1":"0"):"");  settings<<(i->itemSet(KateAttribute::Italic)?(i->italic()?"1":"0"):"");  settings<<(i->itemSet(KateAttribute::StrikeOut)?(i->strikeOut()?"1":"0"):"");  settings<<(i->itemSet(KateAttribute::Underline)?(i->underline()?"1":"0"):"");  settings<<(i->itemSet(KateAttribute::BGColor)?QString::number(i->bgColor().rgb(),16):"-");  settings<<(i->itemSet(KateAttribute::SelectedBGColor)?QString::number(i->selectedBGColor().rgb(),16):"-");  settings<<"---";   config->writeEntry(defaultStyleName(z),settings);  }   emit changed(); }  int KateHlManager::highlights() {  return (int) hlList.count(); }  QString KateHlManager::hlName(int n) {  return hlList.at(n)->name(); }  QString KateHlManager::hlNameTranslated(int n) {  return hlList.at(n)->nameTranslated(); }  QString KateHlManager::hlSection(int n) {  return hlList.at(n)->section(); }  bool KateHlManager::hlHidden(int n) {  return hlList.at(n)->hidden(); }  QString KateHlManager::identifierForName(const QString& name) {  KateHighlighting *hl = 0;   if ((hl = hlDict[name]))  return hl->getIdentifier ();   return QString(); }  bool KateHlManager::resetDynamicCtxs() {  if (forceNoDCReset)  return false;   if (lastCtxsReset.elapsed() < KATE_DYNAMIC_CONTEXTS_RESET_DELAY)  return false;   KateHighlighting *hl;  for (hl = hlList.first(); hl; hl = hlList.next())  hl->dropDynamicContexts();   dynamicCtxsCount = 0;  lastCtxsReset.start();   return true; } //END  //BEGIN KateHighlightAction void KateViewHighlightAction::init() {  m_doc = 0;  subMenus.setAutoDelete( true );   connect(popupMenu(),SIGNAL(aboutToShow()),this,SLOT(slotAboutToShow())); }  void KateViewHighlightAction::updateMenu (Kate::Document *doc) {  m_doc = doc; }  void KateViewHighlightAction::slotAboutToShow() {  Kate::Document *doc=m_doc;  int count = KateHlManager::self()->highlights();   for (int z=0; zhlNameTranslated (z);  QString hlSection = KateHlManager::self()->hlSection (z);   if (!KateHlManager::self()->hlHidden(z))  {  if ( !hlSection.isEmpty() && (names.contains(hlName) < 1) )  {  if (subMenusName.contains(hlSection) < 1)  {  subMenusName << hlSection;  QPopupMenu *menu = new QPopupMenu ();  subMenus.append(menu);  popupMenu()->insertItem ( '&' + hlSection, menu);  }   int m = subMenusName.findIndex (hlSection);  names << hlName;  subMenus.at(m)->insertItem ( '&' + hlName, this, SLOT(setHl(int)), 0, z);  }  else if (names.contains(hlName) < 1)  {  names << hlName;  popupMenu()->insertItem ( '&' + hlName, this, SLOT(setHl(int)), 0, z);  }  }  }   if (!doc) return;   for (uint i=0;icount();i2++)  {  subMenus.at(i)->setItemChecked(subMenus.at(i)->idAt(i2),false);  }  }  popupMenu()->setItemChecked (0, false);   int i = subMenusName.findIndex (KateHlManager::self()->hlSection(doc->hlMode()));  if (i >= 0 && subMenus.at(i))  subMenus.at(i)->setItemChecked (doc->hlMode(), true);  else  popupMenu()->setItemChecked (0, true); }  void KateViewHighlightAction::setHl (int mode) {  Kate::Document *doc=m_doc;   if (doc)  doc->setHlMode((uint)mode); } //END KateViewHighlightAction  // kate: space-indent on; indent-width 2; replace-tabs on; testing standalone make: *** [test_dynamic] Hangup