diff options
Diffstat (limited to 'kate/data/cpp.xml')
-rw-r--r-- | kate/data/cpp.xml | 453 |
1 files changed, 345 insertions, 108 deletions
diff --git a/kate/data/cpp.xml b/kate/data/cpp.xml index 691bcb624..48aed711c 100644 --- a/kate/data/cpp.xml +++ b/kate/data/cpp.xml @@ -1,21 +1,36 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE language SYSTEM "language.dtd"> -<language name="C++" section="Sources" - version="1.52" kateversion="2.5" - indenter="cstyle" - mimetype="text/x-c++src;text/x-c++hdr;text/x-chdr" - extensions="*.c++;*.cxx;*.cpp;*.cc;*.C;*.h;*.hh;*.H;*.h++;*.hxx;*.hpp;*.hcc;*.moc" - priority="9"> -<!-- -########################################################################## -## Fixes by Sebastian Pipping (webmaster@hartwork.org) -## -## NOTE: Keep in sync with C highlighter! (c.xml) -########################################################################## ---> +<!DOCTYPE language SYSTEM "language.dtd" +[ + <!ENTITY space " "> + <!ENTITY separators ",;"> + <!ENTITY ns_punctuators "!%&space;&()+-/.*<=>?[]{|}~^&separators;"> + <!ENTITY punctuators ":&ns_punctuators;"> + <!-- printf-like format strings conversion specifiers --> + <!ENTITY convspec "diouxXeEfFgGaAcsP%"> +]> +<language + name="C++" + section="Sources" + version="2.0-1" + kateversion="2.4" + indenter="cstyle" + mimetype="text/x-c++src;text/x-c++hdr;text/x-chdr" + extensions="*.c++;*.cxx;*.cpp;*.cc;*.C;*.h;*.hh;*.H;*.h++;*.hxx;*.hpp;*.hcc;*.moc" + author="Alex Turbov (i.zaufi@gmail.com)" + license="LGPL" + priority="9" + > + <!-- + Complete list of changes by Alex Turbov (I.zaufi@gmail.com) + can be found at: + http://kde-files.org/content/show.php?content=90660 + --> <highlighting> <list name="keywords"> + <item> alignof </item> + <item> alignas </item> <item> asm </item> + <item> auto </item> <item> break </item> <item> case </item> <item> catch </item> @@ -31,10 +46,9 @@ <item> else </item> <item> enum </item> <item> explicit </item> - <item> export </item> - <item> extern </item> + <item> export </item> <!-- Unused but reserved for future use --> <item> false </item> - <item> final </item> + <item> final </item> <!-- According N3272 --> <item> friend </item> <item> for </item> <item> goto </item> @@ -45,11 +59,10 @@ <item> noexcept </item> <item> nullptr </item> <item> operator </item> - <item> override </item> + <item> override </item> <!-- According N3272 --> <item> private </item> <item> protected </item> <item> public </item> - <item> qobject_cast </item> <item> reinterpret_cast </item> <item> return </item> <item> sizeof </item> @@ -64,17 +77,14 @@ <item> try </item> <item> typedef </item> <item> typeid </item> - <item> type_info </item> <item> typename </item> <item> union </item> <item> using </item> <item> virtual </item> <item> while </item> - + <!-- Alternative operators (see 2.12) --> <item> and </item> <item> and_eq </item> - <item> bad_cast </item> - <item> bad_typeid </item> <item> bitand </item> <item> bitor </item> <item> compl </item> @@ -85,6 +95,22 @@ <item> xor </item> <item> xor_eq </item> </list> + <!-- This keyword may appear in InternalsNS context. For example in code: + details::some_class::template some_templated_static(); + and it should be displayed as keyword, not like part of details namespace... + --> + <list name="template"> + <item> template </item> + </list> + + <!-- 7.6 Attributes --> + <list name="attributes"> + <!-- C++11 --> + <item> noreturn </item> + <item> carries_dependency </item> + <!-- C++1y --> + <item> deprecated </item> + </list> <!-- QT/TQT extensions --> <list name="extensions"> @@ -201,26 +227,18 @@ </list> <list name="types"> - <item> auto </item> <item> bool </item> <item> char </item> <item> char16_t </item> <item> char32_t </item> - <item> const </item> <item> double </item> <item> float </item> <item> int </item> <item> long </item> - <item> mutable </item> - <item> register </item> <item> short </item> <item> signed </item> - <item> static </item> <item> unsigned </item> <item> void </item> - <item> volatile </item> - <item> uchar </item> - <item> uint </item> <item> int8_t </item> <item> int16_t </item> <item> int32_t </item> @@ -231,143 +249,362 @@ <item> uint64_t </item> <item> wchar_t </item> </list> + <list name="modifiers"> + <item> const </item> + <item> extern </item> + <item> mutable </item> + <item> register </item> + <item> static </item> + <item> thread_local </item> + <item> volatile </item> + </list> + <list name="StdMacros"> + <item> __FILE__ </item> + <item> __LINE__ </item> + <item> __DATE__ </item> + <item> __TIME__ </item> + <item> __STDC__ </item> + <item> __STDC_VERSION__ </item> + <item> __STDC_HOSTED__ </item> + <item> __STDC_ISO_10646__ </item> + <item> __STDC_MB_MIGHT_NEQ_WC__ </item> + <item> __cplusplus </item> + <item> __func__ </item> + </list> + <contexts> - <context attribute="Normal Text" lineEndContext="#stay" name="Normal"> + <context name="Normal" attribute="Normal Text" lineEndContext="#stay"> <DetectSpaces /> - <RegExpr attribute="Preprocessor" context="Outscoped" String="#\s*if\s+0\s*$" beginRegion="PP" firstNonSpace="true" /> + <RegExpr attribute="Preprocessor" context="Outscoped" String="(#|%\:|\?\?=)\s*if\s+(0|false)\s*" beginRegion="PP" firstNonSpace="true" insensitive="false" /> + <RegExpr attribute="Preprocessor" context="Inscoped" String="(#|%\:|\?\?=)\s*if\s+(1|true)\s*" beginRegion="PP" firstNonSpace="true" insensitive="false" /> + <IncludeRules context="Main" /> + </context> + + <context name="Main" attribute="Normal Text" lineEndContext="#stay"> + <!-- Match preprocessor directives --> <DetectChar context="AfterHash" char="#" firstNonSpace="true" lookAhead="true" /> + <Detect2Chars context="AfterHash" char="%" char1=":" firstNonSpace="true" lookAhead="true" /> + <StringDetect context="AfterHash" String="??=" firstNonSpace="true" lookAhead="true" /> + <Detect2Chars attribute="Error" context="#stay" char="%" char1=":" /> + <StringDetect attribute="Error" String="??=" context="#stay" /> + <!-- Match special comments for region markers --> <StringDetect attribute="Region Marker" context="Region Marker" String="//BEGIN" beginRegion="Region1" firstNonSpace="true" /> <StringDetect attribute="Region Marker" context="Region Marker" String="//END" endRegion="Region1" firstNonSpace="true" /> + <!-- ATTENTION Special case `operator""` cuz Kate doesn't recognize + `operator` joined w/ quotes as a keyword here. BUG?? + --> + <RegExpr attribute="Normal Text" context="UDLOperator" String="operator\s*"" _[_0-9A-Za-z]*\b" lookAhead="true" /> + <RegExpr attribute="Error" context="#stay" String="operator\s*"" [_0-9A-Za-z]*\b" /> + <!-- Match keywords --> <keyword attribute="Keyword" context="#stay" String="keywords" /> - <keyword attribute="Extensions" context="#stay" String="extensions" /> + <!-- Detect attributes --> + <Detect2Chars attribute="Symbol" context="Attribute" char="[" char1="[" /> + <!-- Match numbers --> + <!-- ATTENTION Builtin number detectors have strange behaviour and definitely lack of required features --> + <!-- NOTE Order is important! --> + <RegExpr attribute="Hex" context="#stay" String="[\+\-]?0x[0-9A-Fa-f]('?[0-9A-Fa-f]+)*([Uu][Ll]{0,2}|[Ll]{0,2}[Uu]?|_[_0-9A-Za-z]*)?\b" /> + <RegExpr attribute="Binary" context="#stay" String="0[Bb][01]('?[01]+)*([Uu][Ll]{0,2}|[Ll]{0,2}[Uu]?|_[_0-9A-Za-z]*)?\b" /> + <RegExpr attribute="Float" context="#stay" String="[\+\-]?([0-9]+[Ee][\+\-]?[0-9]+|([0-9]+\.|\.[0-9]+|[0-9]+\.[0-9]+)([Ee][\+\-]?[0-9]+)?)[FfLl]?" /> + <RegExpr attribute="Octal" context="#stay" String="[\+\-]?0'?[0-7]('?[0-7]+)*([Uu][Ll]{0,2}|[Ll]{0,2}[Uu]?|_[_0-9A-Za-z]*)?\b" /> + <RegExpr attribute="Decimal" context="#stay" String="[\+\-]?(0|[1-9]('?[0-9]+)*)([Uu][Ll]{0,2}|[Ll]{0,2}[Uu]?|_[_0-9A-Za-z]*)?\b" /> + <RegExpr attribute="Error" context="#stay" String="[\+\-]?(0x?|[1-9][0-9]*)[0-9A-Za-z][_0-9A-Za-z]*\b" /> + <!-- Match string literals --> + <DetectChar attribute="String" context="String" char=""" /> + <Detect2Chars attribute="String" context="String" char="U" char1=""" /> + <Detect2Chars attribute="String" context="String" char="u" char1=""" /> + <Detect2Chars attribute="String" context="String" char="L" char1=""" /> + <StringDetect attribute="String" context="String" String="u8"" /> + <RegExpr attribute="String" context="RawString" String="(u|u8|U|L)?R"([^\(]{0,16})\(" lookAhead="true" /> + <RegExpr attribute="Error" context="#stay" String="(u|u8|U|L)?R"([^\(]{16,})\(" /> + <DetectChar attribute="String" context="Char Literal" char="'" /> + <Detect2Chars attribute="String" context="Char Literal" char="L" char1="'" /> + <Detect2Chars attribute="String" context="U-Char Literal" char="u" char1="'" /> + <Detect2Chars attribute="String" context="U-Char Literal" char="U" char1="'" /> + <!-- Match GCC extensions --> + <IncludeRules context="DetectGccExtensions##GCCExtensions" /> + <!-- Match most used namespaces and styles --> + <StringDetect attribute="Standard Classes" context="Standard Classes" String="std::" /> + <StringDetect attribute="Boost Stuff" context="Boost Stuff" String="boost::" /> + <StringDetect attribute="Boost Stuff" context="Boost Stuff" String="BOOST_" /> + <StringDetect attribute="Internals" context="InternalsNS" String="detail::" /> + <StringDetect attribute="Internals" context="InternalsNS" String="details::" /> + <StringDetect attribute="Internals" context="InternalsNS" String="aux::" /> + <StringDetect attribute="Internals" context="InternalsNS" String="internals::" /> <keyword attribute="Data Type" context="#stay" String="types" /> - <HlCChar attribute="Char" context="#stay"/> - <DetectChar attribute="String" context="String" char="""/> + <keyword attribute="Type Modifiers" context="#stay" String="modifiers" /> + <keyword attribute="Standard Macros" context="#stay" String="StdMacros" /> + <RegExpr attribute="Internals" context="#stay" String="_[a-zA-Z0-9_]+" /> + <RegExpr attribute="Internals" context="#stay" String="[a-zA-Z][a-zA-Z0-9_]*__\b" /> + <RegExpr attribute="Data Members (m_*)" context="#stay" String="[a-z][a-zA-Z0-9_]*_\b" /> + <RegExpr attribute="Data Members (m_*)" context="#stay" String="m_[a-zA-Z0-9_]+" /> + <RegExpr attribute="Globals (g_*)" context="#stay" String="g_[a-zA-Z0-9_]+" /> + <RegExpr attribute="Statics (s_*)" context="#stay" String="s_[a-zA-Z0-9_]+" /> + <RegExpr attribute="CONSTS/MACROS" context="#stay" String="[A-Z][A-Z0-9_]{2,}\b" /> + <RegExpr attribute="Types (*_t/*_type)" context="#stay" String="[a-zA-Z][a-zA-Z0-9_]*_t(ype)?\b" /> <DetectIdentifier /> - <Float attribute="Float" context="#stay"> - <AnyChar String="fF" attribute="Float" context="#stay"/> - </Float> - <HlCOct attribute="Octal" context="#stay"/> - <HlCHex attribute="Hex" context="#stay"/> - <Int attribute="Decimal" context="#stay"> - <StringDetect attribute="Decimal" context="#stay" String="ULL" insensitive="TRUE"/> - <StringDetect attribute="Decimal" context="#stay" String="LUL" insensitive="TRUE"/> - <StringDetect attribute="Decimal" context="#stay" String="LLU" insensitive="TRUE"/> - <StringDetect attribute="Decimal" context="#stay" String="UL" insensitive="TRUE"/> - <StringDetect attribute="Decimal" context="#stay" String="LU" insensitive="TRUE"/> - <StringDetect attribute="Decimal" context="#stay" String="LL" insensitive="TRUE"/> - <StringDetect attribute="Decimal" context="#stay" String="U" insensitive="TRUE"/> - <StringDetect attribute="Decimal" context="#stay" String="L" insensitive="TRUE"/> - </Int> + <!-- Match comments --> <IncludeRules context="##Doxygen" /> - <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/> - <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/> + <IncludeRules context="AlignedComments" /> + <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment" /> + <!-- Match scope regions --> <DetectChar attribute="Symbol" context="#stay" char="{" beginRegion="Brace1" /> <DetectChar attribute="Symbol" context="#stay" char="}" endRegion="Brace1" /> - <AnyChar attribute="Symbol" context="#stay" String=":!%&()+,-/.*<=>?[]{|}~^;"/> + <!-- Match punctuators --> + <AnyChar attribute="Separator Symbol" context="#stay" String="&separators;" /> + <AnyChar attribute="Symbol" context="#stay" String="&punctuators;" /> + <!-- Match invalid symbols --> + <DetectChar attribute="Error" context="#stay" char="#" /> + <DetectChar attribute="Error" context="#stay" char="$" /> + <DetectChar attribute="Error" context="#stay" char="@" /> + <DetectChar attribute="Error" context="#stay" char="`" /> </context> - <context attribute="String" lineEndContext="#pop" name="String"> - <LineContinue attribute="String" context="#stay"/> - <HlCStringChar attribute="String Char" context="#stay"/> - <DetectChar attribute="String" context="#pop" char="""/> + <context name="UDLOperator" attribute="Normal Text" lineEndContext="#pop"> + <StringDetect attribute="Keyword" context="#stay" String="operator" /> + <StringDetect attribute="String" context="#stay" String="""" /> + <DetectIdentifier context="#pop" /> </context> - <context attribute="Region Marker" lineEndContext="#pop" name="Region Marker"> + <context name="Char Literal" attribute="String" lineEndContext="#pop"> + <IncludeRules context="Universal Char" /> + <DetectChar attribute="String Char" context="Simple Esc" char="\" /> + <DetectChar attribute="String" context="#pop" char="'" /> </context> - <context attribute="Comment" lineEndContext="#pop" name="Commentar 1"> - <LineContinue attribute="Comment" context="#stay"/> + <context name="U-Char Literal" attribute="String" lineEndContext="#pop"> + <IncludeRules context="Universal Char" /> + <DetectChar attribute="String Char" context="Simple Esc" char="\" /> + <DetectChar attribute="String" context="#pop" char="'" /> + <RegExpr attribute="Error" context="#stay" String="[^']{2,}" /> + <RegExpr attribute="String" context="#stay" String=".{1}" /> + </context> + + <context name="Simple Esc" attribute="String Char" lineEndContext="#pop"> + <AnyChar attribute="String Char" context="#pop" String="tnvbrfa'"\" /> + <RegExpr attribute="String Char" context="#pop" String="[0-7]{1,3}" /> + <RegExpr attribute="String Char" context="#pop" String="x[0-9A-Fa-f]{1,}" /> + <RegExpr attribute="String" context="#pop" String="." /> + </context> + + <context name="Universal Char" attribute="String Char" lineEndContext="#pop"> + <RegExpr attribute="String Char" context="#stay" String="\\u[0-9A-Fa-f]{4}" /> + <RegExpr attribute="Error" context="#stay" String="\\u.{0,3}" /> + <RegExpr attribute="String Char" context="#stay" String="\\U[0-9A-Fa-f]{8}" /> + <RegExpr attribute="Error" context="#stay" String="\\U.{0,7}" /> + </context> + + <context name="String" attribute="String" lineEndContext="#pop"> + <LineContinue attribute="String" context="#stay" /> + <HlCStringChar attribute="String Char" context="#stay" /> + <IncludeRules context="Universal Char" /> + <RegExpr attribute="String Char" context="#stay" String="%[^"&convspec;]*[&convspec;]" /> + <DetectChar attribute="String" context="UDLStringSuffix" char=""" /> + </context> + + <context name="UDLStringSuffix" attribute="String" lineEndContext="#pop#pop"> + <RegExpr attribute="String" context="#pop#pop" String="_[_0-9A-Z-a-z]*\b" /> + <!-- TODO Is there any better way to quit the current context ?? --> + <RegExpr context="#pop#pop" String=".*" lookAhead="true" /> + </context> + + <context name="Attribute" attribute="Attribute" lineEndContext="#stay"> + <keyword attribute="Standard Attribute" context="#stay" String="attributes" /> + <Detect2Chars attribute="Symbol" context="#pop" char="]" char1="]" /> + <AnyChar context="#stay" String="&ns_punctuators;" attribute="Symbol" /> + <!-- Attributes may contain some text: [[deprecated("Reason text")]] --> + <DetectChar attribute="String" context="String" char=""" /> + </context> + + <context name="RawString" attribute="String" lineEndContext="#stay" dynamic="true"> + <LineContinue attribute="String" context="#stay" /> + <RegExpr attribute="String Char" context="#stay" String="%[^"&convspec;]*[&convspec;]" /> + <RegExpr attribute="String" context="#pop" String="\)%2"" dynamic="true"/> + </context> + + <context name="DetectIdentifierEnd" attribute="Normal Text" lineEndContext="#pop"> + <AnyChar context="#pop" String="&punctuators;" attribute="Symbol" /> + </context> + + <context name="Region Marker" attribute="Region Marker" lineEndContext="#pop" /> + + <context name="DetectNSEnd" attribute="Normal Text" lineEndContext="#pop"> + <keyword attribute="Keyword" context="#stay" String="template" /> + <DetectIdentifier context="#stay" /> + <AnyChar context="#pop" String="&separators;" attribute="Separator Symbol" /> + <AnyChar context="#pop" String="&ns_punctuators;" attribute="Symbol" /> + <AnyChar context="#stay" String="&space;" attribute="Normal Text" /> + </context> + + <context name="Standard Classes" attribute="Standard Classes" lineEndContext="#pop"> + <IncludeRules context="DetectNSEnd" /> + </context> + + <context name="Boost Stuff" attribute="Boost Stuff" lineEndContext="#pop"> + <IncludeRules context="DetectNSEnd" /> + </context> + + <context name="InternalsNS" attribute="Internals" lineEndContext="#pop"> + <IncludeRules context="DetectNSEnd" /> + </context> + + <context name="Commentar 1" attribute="Comment" lineEndContext="#pop"> + <LineContinue attribute="Comment" context="#stay" /> <DetectSpaces /> <IncludeRules context="##Alerts" /> + <IncludeRules context="##Modelines" /> <DetectIdentifier /> </context> - <context attribute="Comment" lineEndContext="#stay" name="Commentar 2"> + <context name="Commentar 2" attribute="Comment" lineEndContext="#stay"> <DetectSpaces /> - <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment"/> + <LineContinue attribute="Comment" context="#stay" /> + <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment" /> <IncludeRules context="##Alerts" /> + <IncludeRules context="##Modelines" /> <DetectIdentifier /> </context> - <context attribute="Error" lineEndContext="#pop" name="AfterHash"> + <context name="AfterHash" attribute="Error" lineEndContext="#pop"> <!-- define, elif, else, endif, error, if, ifdef, ifndef, include, include_next, line, pragma, undef, warning --> - <RegExpr attribute="Preprocessor" context="Preprocessor" String="#\s*if(?:def|ndef)?(?=(?:\(|\s+)\S)" insensitive="true" beginRegion="PP" firstNonSpace="true" /> - <RegExpr attribute="Preprocessor" context="Preprocessor" String="#\s*endif" insensitive="true" endRegion="PP" firstNonSpace="true" /> - <RegExpr attribute="Preprocessor" context="Define" String="#\s*define.*((?=\\))" insensitive="true" firstNonSpace="true" /> - <RegExpr attribute="Preprocessor" context="Preprocessor" String="#\s*(?:el(?:se|if)|include(?:_next)?|define|undef|line|error|warning|pragma)" insensitive="true" firstNonSpace="true" /> - <RegExpr attribute="Preprocessor" context="Preprocessor" String="#\s+[0-9]+" insensitive="true" firstNonSpace="true" /> + <RegExpr attribute="Preprocessor" context="Preprocessor" String="(#|%\:|\?\?=)\s*if(?:def|ndef)?(?=(?:\(|\s+)\S)" beginRegion="PP" firstNonSpace="true" insensitive="false" /> + <RegExpr attribute="Preprocessor" context="Preprocessor" String="(#|%\:|\?\?=)\s*endif" endRegion="PP" firstNonSpace="true" insensitive="false" /> + <!-- Switch to seperate context for multiline #defines --> + <RegExpr attribute="Preprocessor" context="Define" String="(#|%\:|\?\?=)\s*(cmake)?define.*((?=\\))" firstNonSpace="true" lookAhead="true" insensitive="false" /> + <RegExpr attribute="Preprocessor" context="Preprocessor" String="(#|%\:|\?\?=)\s*(?:el(?:se|if)|include(?:_next)?|(cmake)?define|undef|line|error|warning|pragma)" insensitive="false" firstNonSpace="true" /> + <RegExpr attribute="Preprocessor" context="Preprocessor" String="(#|%\:|\?\?=)\s+[0-9]+" firstNonSpace="true" insensitive="false" /> </context> - <context attribute="Preprocessor" lineEndContext="#pop" name="Preprocessor"> - <LineContinue attribute="Preprocessor" context="#stay"/> - <RangeDetect attribute="Prep. Lib" context="#stay" char=""" char1="""/> - <RangeDetect attribute="Prep. Lib" context="#stay" char="<" char1=">"/> + <context name="Preprocessor" attribute="Preprocessor" lineEndContext="#pop"> + <LineContinue attribute="Preprocessor" context="#stay" /> + <keyword attribute="Standard Macros" context="#stay" String="StdMacros" /> + <IncludeRules context="GNUMacros##GCCExtensions" /> + <RangeDetect attribute="Prep. Lib" context="#stay" char=""" char1=""" /> + <RangeDetect attribute="Prep. Lib" context="#stay" char="<" char1=">" /> <IncludeRules context="##Doxygen" /> <Detect2Chars attribute="Comment" context="Commentar/Preprocessor" char="/" char1="*" beginRegion="Comment2" /> - - <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/> + <IncludeRules context="AlignedComments" /> </context> - <context attribute="Preprocessor" lineEndContext="#pop" name="Define"> - <LineContinue attribute="Preprocessor" context="#stay"/> + <context name="Define" attribute="Preprocessor" lineEndContext="#pop"> + <LineContinue attribute="Separator Symbol" context="#stay" /> + <DetectChar attribute="Error" context="#stay" char="\\" /> + <keyword attribute="Standard Macros" context="#stay" String="StdMacros" /> + <IncludeRules context="GNUMacros##GCCExtensions" /> </context> - <context attribute="Comment" lineEndContext="#stay" name="Commentar/Preprocessor"> + <context name="Commentar/Preprocessor" attribute="Comment" lineEndContext="#stay"> <DetectSpaces /> <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="Comment2" /> <DetectIdentifier /> </context> - <context attribute="Comment" lineEndContext="#stay" name="Outscoped" > + <context name="Outscoped Common" attribute="Comment" lineEndContext="#stay"> <DetectSpaces /> <IncludeRules context="##Alerts" /> + <IncludeRules context="##Modelines" /> <DetectIdentifier /> <IncludeRules context="##Doxygen" /> - <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/> - <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/> - <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="PP" firstNonSpace="true" /> - <RegExpr attribute="Preprocessor" context="#pop" String="#\s*el(?:se|if)" firstNonSpace="true" /> - <RegExpr attribute="Preprocessor" context="#pop" String="#\s*endif" endRegion="PP" firstNonSpace="true" /> + <IncludeRules context="AlignedComments" /> + <!-- Do not try to detect "C" style comments inside outscoped text + to prevent incorrect highlighting in case of overlapped (or not closed properly) + comment block... + + <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment" /> + --> + <RegExpr attribute="Comment" context="Outscoped intern" String="(#|%\:|\?\?=)\s*if" beginRegion="PP" firstNonSpace="true" insensitive="false" /> + <LineContinue context="#stay" /> + </context> + + <context name="Outscoped" attribute="Comment" lineEndContext="#stay"> + <IncludeRules context="Outscoped Common" /> + <RegExpr attribute="Preprocessor" context="#pop" String="(#|%\:|\?\?=)\s*el(?:se|if)" firstNonSpace="true" insensitive="false" /> + <RegExpr attribute="Preprocessor" context="#pop" String="(#|%\:|\?\?=)\s*endif" endRegion="PP" firstNonSpace="true" insensitive="false" /> </context> - <context attribute="Comment" lineEndContext="#stay" name="Outscoped intern"> + <context name="Outscoped 2" attribute="Comment" lineEndContext="#stay"> + <IncludeRules context="Outscoped Common" /> + <RegExpr attribute="Preprocessor" context="#pop#pop" String="(#|%\:|\?\?=)\s*endif" endRegion="PP" firstNonSpace="true" insensitive="false" /> + </context> + + <context name="Inscoped" attribute="Normal Text" lineEndContext="#stay"> + <DetectSpaces /> + <RegExpr attribute="Preprocessor" context="Outscoped" String="(#|%\:|\?\?=)\s*if\s+(0|false)\s*" beginRegion="PP" firstNonSpace="true" insensitive="false" /> + <RegExpr attribute="Preprocessor" context="Outscoped 2" String="(#|%\:|\?\?=)\s*el(?:se|if)" firstNonSpace="true" insensitive="false" /> + <IncludeRules context="Main" /> + </context> + + <context name="Outscoped intern" attribute="Comment" lineEndContext="#stay"> <DetectSpaces /> <IncludeRules context="##Alerts" /> + <IncludeRules context="##Modelines" /> <DetectIdentifier /> - <DetectChar attribute="String" context="String" char="""/> <IncludeRules context="##Doxygen" /> - <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/"/> - <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment"/> - <RegExpr attribute="Comment" context="Outscoped intern" String="#\s*if" beginRegion="PP" firstNonSpace="true" /> - <RegExpr attribute="Comment" context="#pop" String="#\s*endif" endRegion="PP" firstNonSpace="true" /> + <IncludeRules context="AlignedComments" /> + <Detect2Chars attribute="Comment" context="Commentar 2" char="/" char1="*" beginRegion="Comment" /> + <RegExpr attribute="Comment" context="Outscoped intern" String="(#|%\:|\?\?=)\s*if" beginRegion="PP" firstNonSpace="true" insensitive="false" /> + <RegExpr attribute="Comment" context="#pop" String="(#|%\:|\?\?=)\s*endif" endRegion="PP" firstNonSpace="true" insensitive="false" /> + </context> + + <context name="AlignedComments" lineEndContext="#stay" attribute="Comment"> + <Detect2Chars attribute="Region Marker" context="Commentar 1" column="0" char="/" char1="/" /> + <Detect2Chars attribute="Region Marker" context="Commentar 1" column="4" char="/" char1="/" /> + <Detect2Chars attribute="Region Marker" context="Commentar 1" column="8" char="/" char1="/" /> + <Detect2Chars attribute="Region Marker" context="Commentar 1" column="12" char="/" char1="/" /> + <Detect2Chars attribute="Region Marker" context="Commentar 1" column="16" char="/" char1="/" /> + <Detect2Chars attribute="Region Marker" context="Commentar 1" column="20" char="/" char1="/" /> + <Detect2Chars attribute="Region Marker" context="Commentar 1" column="24" char="/" char1="/" /> + <Detect2Chars attribute="Region Marker" context="Commentar 1" column="28" char="/" char1="/" /> + <Detect2Chars attribute="Region Marker" context="Commentar 1" column="32" char="/" char1="/" /> + <Detect2Chars attribute="Region Marker" context="Commentar 1" column="36" char="/" char1="/" /> + <Detect2Chars attribute="Region Marker" context="Commentar 1" column="40" char="/" char1="/" /> + <Detect2Chars attribute="Region Marker" context="Commentar 1" column="44" char="/" char1="/" /> + <Detect2Chars attribute="Region Marker" context="Commentar 1" column="48" char="/" char1="/" /> + <Detect2Chars attribute="Region Marker" context="Commentar 1" column="52" char="/" char1="/" /> + <Detect2Chars attribute="Region Marker" context="Commentar 1" column="56" char="/" char1="/" /> + <Detect2Chars attribute="Region Marker" context="Commentar 1" column="60" char="/" char1="/" /> + <Detect2Chars attribute="Comment" context="Commentar 1" char="/" char1="/" /> </context> </contexts> + <itemDatas> - <itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/> - <itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/> - <itemData name="Extensions" defStyleNum="dsKeyword" color="#0095ff" selColor="#ffffff" bold="1" italic="0" spellChecking="false"/> - <itemData name="Data Type" defStyleNum="dsDataType" spellChecking="false"/> - <itemData name="Decimal" defStyleNum="dsDecVal" spellChecking="false"/> - <itemData name="Octal" defStyleNum="dsBaseN" spellChecking="false"/> - <itemData name="Hex" defStyleNum="dsBaseN" spellChecking="false"/> - <itemData name="Float" defStyleNum="dsFloat" spellChecking="false"/> - <itemData name="Char" defStyleNum="dsChar" spellChecking="false"/> - <itemData name="String" defStyleNum="dsString"/> - <itemData name="String Char" defStyleNum="dsChar"/> - <itemData name="Comment" defStyleNum="dsComment"/> - <itemData name="Symbol" defStyleNum="dsNormal" spellChecking="false"/> - <itemData name="Preprocessor" defStyleNum="dsOthers" spellChecking="false"/> - <itemData name="Prep. Lib" defStyleNum="dsOthers" spellChecking="false"/> - <itemData name="Region Marker" defStyleNum="dsRegionMarker" spellChecking="false"/> - <itemData name="Error" defStyleNum="dsError" spellChecking="false"/> + <itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false" /> + <itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false" /> + <itemData name="Data Type" defStyleNum="dsDataType" spellChecking="false" /> + <itemData name="Type Modifiers" defStyleNum="dsDataType" spellChecking="false" /> + <itemData name="Attribute" defStyleNum="dsKeyword" spellChecking="false" bold="false" italic="true" /> + <itemData name="Standard Attribute" defStyleNum="dsKeyword" spellChecking="false" bold="false" italic="true" /> + <itemData name="Decimal" defStyleNum="dsDecVal" spellChecking="false" /> + <itemData name="Octal" defStyleNum="dsBaseN" spellChecking="false" /> + <itemData name="Hex" defStyleNum="dsBaseN" spellChecking="false" /> + <itemData name="Binary" defStyleNum="dsBaseN" spellChecking="false" /> + <itemData name="Float" defStyleNum="dsFloat" spellChecking="false" /> + <itemData name="Char" defStyleNum="dsChar" spellChecking="false" /> + <itemData name="String" defStyleNum="dsString" spellChecking="true" /> + <itemData name="String Char" defStyleNum="dsChar" spellChecking="false" /> + <itemData name="Comment" defStyleNum="dsComment" spellChecking="true" /> + <itemData name="Symbol" defStyleNum="dsNormal" spellChecking="false" /> + <itemData name="Separator Symbol" defStyleNum="dsNormal" spellChecking="false" /> + <itemData name="Data Members (m_*)" defStyleNum="dsNormal" spellChecking="false" /> + <itemData name="Globals (g_*)" defStyleNum="dsNormal" spellChecking="false" /> + <itemData name="Statics (s_*)" defStyleNum="dsNormal" spellChecking="false" /> + <itemData name="Types (*_t/*_type)" defStyleNum="dsNormal" spellChecking="false" /> + <itemData name="CONSTS/MACROS" defStyleNum="dsNormal" spellChecking="false" /> + <itemData name="Preprocessor" defStyleNum="dsOthers" spellChecking="false" /> + <itemData name="Prep. Lib" defStyleNum="dsOthers" spellChecking="false" /> + <itemData name="Standard Macros" defStyleNum="dsOthers" spellChecking="false" /> + <itemData name="Standard Classes" defStyleNum="dsNormal" spellChecking="false" color="#59ff00" selColor="#59ff00" /> + <itemData name="Boost Stuff" defStyleNum="dsNormal" spellChecking="false" color="#23a45b" selColor="#23a45b" /> + <itemData name="Internals" defStyleNum="dsNormal" spellChecking="false" color="#808080" selColor="#808080" /> + <itemData name="Region Marker" defStyleNum="dsRegionMarker" spellChecking="false" /> + <itemData name="Error" defStyleNum="dsError" spellChecking="false" /> </itemDatas> </highlighting> <general> <comments> <comment name="singleLine" start="//" /> - <comment name="multiLine" start="/*" end="*/" region="Comment"/> + <comment name="multiLine" start="/*" end="*/" region="Comment" /> </comments> <keywords casesensitive="1" /> </general> </language> +<!-- kate: indent-width 2; tab-width 2; --> |