Version: (using KDE 4.3.0) OS: Linux Installed from: Ubuntu Packages Forwarding upstream bug report: https://bugs.launchpad.net/ubuntu/+source/kdesdk/+bug/405760 Original description: --------------------- kate Versione 4.2.98 (KDE 4.2.98 (KDE 4.3 RC3)) there is an error on recognize \" , the text after is highlighting with red try to use highlighting for cmake with the text below example: project( test ) #for slice2cpp ADD_CUSTOM_COMMAND( OUTPUT src/test.cpp src/test.hpp COMMAND slice2cpp --header-ext hpp --output-dir src idl/test.ice COMMAND sed -i 's,include <test.hpp>,include \"test.hpp\",' ${archiveTest_SOURCE_DIR}/src/test.cpp WORKING_DIRECTORY ${archiveTest_SOURCE_DIR} )
From my own testing, it appears that CMake accepts '\"' outside of a string as not starting a string (that is, it is an escape outside of a string as well as inside). For what it's worth, vim has the same bug. (Also I am reasonably certain that the snippet code is not what the OP intended.)
maybe something like this would be better for detecting the start of a string, if it's actually allowd to have \" outside of a string... - <DetectChar attribute="Strings" context="String" char="""/> + <RegExpr attribute="Strings" context="String" String="[^\\]""/>
(Gee, that was quick :-)...) Nah, I'd rather avoid the regex. Besides, your example is wrong; it would have to be a look-back expression to be correct (and to not highlight too much). See http://reviewboard.kde.org/r/2043/ for my proposed fix (basically, copy the rule that detects '\"' to just before we would detect starting a string, as well as where it currently is, just before we would detect ending a string).
SVN commit 1044075 by mwoehlke: improve cmake.xml Rearrange stuff to reduce rule duplication, and recognize '\"' as an escape outside of strings. BUG: 212798 REVIEW: 2043 M +8 -10 cmake.xml WebSVN link: http://websvn.kde.org/?view=rev&revision=1044075