<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"
[
    <!ENTITY wordsep "(?:[][,?;()]|\.$|\.?\s|$)">   <!-- things that end a TagWord -->
    <!ENTITY sl_word ".*?(?=&wordsep;)">
    <!ENTITY ml_word ".*?(?=&wordsep;|\*/)">
]>
<language name="Doxygen"
          version="14"
          kateversion="5.0"
          section="Markup"
          extensions="*.dox;*.doxygen"
          mimetype="text/x-doxygen"
          author="Dominik Haumann (dhaumann@kde.org)"
          license="MIT"
          priority="9">
  <highlighting>
    <!-- NOTE: all tags may begin with a \ or @ char
         so if you add/change tags you have to do it twice -->
    <!-- NOTE: Tags @code/@endcode, @dot/@enddot, @vermatim/@endverbatim, @msc/@endmsc, @f[/@f]
         do not present in keywords due separate handle rules...
    -->
    <list name="TagOnly">
      <item>\arg</item>              <item>@arg</item>
      <item>\author</item>           <item>@author</item>
      <item>\authors</item>          <item>@authors</item>
      <item>\brief</item>            <item>@brief</item>
      <item>\callgraph</item>        <item>@callgraph</item>
      <item>\callergraph</item>      <item>@callergraph</item>
      <item>\date</item>             <item>@date</item>
      <item>\deprecated</item>       <item>@deprecated</item>
      <item>\details</item>          <item>@details</item>
      <item>\docbookonly</item>      <item>@docbookonly</item>
      <item>\else</item>             <item>@else</item>
      <item>\endcond</item>          <item>@endcond</item>
      <item>\enddocbookonly</item>   <item>@enddocbookonly</item>
      <item>\endhtmlonly</item>      <item>@endhtmlonly</item>
      <item>\endif</item>            <item>@endif</item>
      <item>\endinternal</item>      <item>@endinternal</item>
      <item>\endlatexonly</item>     <item>@endlatexonly</item>
      <item>\endlink</item>          <item>@endlink</item>
      <item>\endmanonly</item>       <item>@endmanonly</item>
      <item>\endparblock</item>      <item>@endparblock</item>
      <item>\endrtfonly</item>       <item>@endrtfonly</item>
      <item>\endsecreflist</item>    <item>@endsecreflist</item>
      <item>\endxmlonly</item>       <item>@endxmlonly</item>
      <item>\hideinitializer</item>  <item>@hideinitializer</item>
      <item>\htmlonly</item>         <item>@htmlonly</item>
      <!-- TODO @internal is a candidate to be handled separately, cuz may introduce folding region -->
      <item>\internal</item>         <item>@internal</item>
      <item>\invariant</item>        <item>@invariant</item>
      <item>\latexonly</item>        <item>@latexonly</item>
      <item>\li</item>               <item>@li</item>
      <item>\manonly</item>          <item>@manonly</item>
      <item>\n</item>                <item>@n</item>
      <item>\nosubgrouping</item>    <item>@nosubgrouping</item>
      <item>\only</item>             <item>@only</item>
      <item>\parblock</item>         <item>@parblock</item>
      <item>\post</item>             <item>@post</item>
      <item>\pre</item>              <item>@pre</item>
      <item>\private</item>          <item>@pivate</item>
      <item>\privatesection</item>   <item>@pivatesection</item>
      <item>\protected</item>        <item>@protected</item>
      <item>\protectedsection</item> <item>@protectedsection</item>
      <item>\public</item>           <item>@public</item>
      <item>\publicsection</item>    <item>@publicsection</item>
      <item>\pure</item>             <item>@pure</item>
      <item>\remark</item>           <item>@remark</item>
      <item>\remarks</item>          <item>@remarks</item>
      <item>\return</item>           <item>@return</item>
      <item>\returns</item>          <item>@returns</item>
      <item>\result</item>           <item>@result</item>
      <item>\rtfonly</item>          <item>@rtfonly</item>
      <item>\sa</item>               <item>@sa</item>
      <item>\secreflist</item>       <item>@secreflist</item>
      <item>\see</item>              <item>@see</item>
      <item>\short</item>            <item>@short</item>
      <item>\showinitializer</item>  <item>@showinitializer</item>
      <item>\since</item>            <item>@since</item>
      <item>\static</item>           <item>@static</item>
      <item>\tableofcontents</item>  <item>@tableofcontents</item>
      <item>\test</item>             <item>@test</item>
      <item>\version</item>          <item>@version</item>
      <item>\xmlonly</item>          <item>@xmlonly</item>
    </list>

    <list name="TagWord">
      <item>\a</item>                <item>@a</item>
      <item>\anchor</item>           <item>@anchor</item>
      <item>\b</item>                <item>@b</item>
      <item>\c</item>                <item>@c</item>
      <item>\cite</item>             <item>@cite</item>
      <item>\cond</item>             <item>@cond</item>
      <item>\copybrief</item>        <item>@copybrief</item>
      <item>\copydetails</item>      <item>@copydetails</item>
      <item>\copydoc</item>          <item>@copydoc</item>
      <item>\def</item>              <item>@def</item>
      <item>\dir</item>              <item>@dir</item>
      <item>\dontinclude</item>      <item>@dontinclude</item>
      <item>\e</item>                <item>@e</item>
      <item>\elseif</item>           <item>@elseif</item>
      <item>\em</item>               <item>@em</item>
      <item>\enum</item>             <item>@enum</item>
      <item>\example</item>          <item>@example</item>
      <item>\exception</item>        <item>@exception</item>
      <item>\exceptions</item>       <item>@exceptions</item>
      <item>\extends</item>          <item>@extends</item>
      <item>\file</item>             <item>@file</item>
      <item>\htmlinclude</item>      <item>@htmlinclude</item>
      <item>\idlexcept</item>        <item>@idlexcept</item>
      <item>\if</item>               <item>@if</item>
      <item>\ifnot</item>            <item>@ifnot</item>
      <item>\implements</item>       <item>@implements</item>
      <item>\include</item>          <item>@include</item>
      <item>\includelineno</item>    <item>@includelineno</item>
      <item>\latexinclude</item>     <item>@latexinclude</item>
      <item>\link</item>             <item>@link</item>
      <item>\memberof</item>         <item>@memberof</item>
      <item>\namespace</item>        <item>@namespace</item>
      <item>\p</item>                <item>@p</item>
      <item>\package</item>          <item>@package</item>
      <item>\property</item>         <item>@property</item>
      <item>\relatedalso</item>      <item>@relatedalso</item>
      <item>\relatesalso</item>      <item>@relatesalso</item>
      <item>\related</item>          <item>@related</item>
      <item>\relates</item>          <item>@relates</item>
      <item>\retval</item>           <item>@retval</item>
      <item>\throw</item>            <item>@throw</item>
      <item>\throws</item>           <item>@throws</item>
      <item>\verbinclude</item>      <item>@verbinclude</item>
      <item>\version</item>          <item>@version</item>
      <!-- TODO Introduce separate context for @xrefitem? -->
      <item>\xrefitem</item>         <item>@xrefitem</item>
    </list>
    <list name="TagParam">
      <item>\param</item>            <item>@param</item>
      <!-- TODO @tparam has no optional direction actually! -->
      <item>\tparam</item>           <item>@tparam</item>
    </list>
    <!-- TODO Better (separate?) highlighting for @image required -->
    <list name="TagWordWord">
      <item>\image</item>            <item>@image</item>
    </list>
      <!-- TODO @union, @struct, @protocol, @interface, @class, @category
           actually takes 3 params, 1 mandatory and 2 optional
        -->
      <!-- TODO @headerfile actually takes 2 params, where last one is optional -->
    <list name="TagWordString">
      <item>\addtogroup</item>       <item>@addtogroup</item>
      <item>\category</item>         <item>@category</item>
      <item>\class</item>            <item>@class</item>
      <item>\diafile</item>          <item>@diafile</item>
      <item>\dotfile</item>          <item>@dotfile</item>
      <item>\defgroup</item>         <item>@defgroup</item>
      <item>\interface</item>        <item>@interface</item>
      <item>\headerfile</item>       <item>@headerfile</item>
      <item>\mscfile</item>          <item>@mscfile</item>
      <item>\page</item>             <item>@page</item>
      <item>\paragraph</item>        <item>@paragraph</item>
      <item>\protocol</item>         <item>@prtocol</item>
      <item>\ref</item>              <item>@ref</item>
      <item>\section</item>          <item>@section</item>
      <item>\snippet</item>          <item>@snippet</item>
      <item>\struct</item>           <item>@struct</item>
      <item>\subpage</item>          <item>@subpage</item>
      <item>\subsection</item>       <item>@subsection</item>
      <item>\subsubsection</item>    <item>@subsubsection</item>
      <item>\union</item>            <item>@union</item>
      <item>\weakgroup</item>        <item>@weakgroup</item>
    </list>
    <list name="TagString">
      <item>\addindex</item>         <item>@addindex</item>
      <item>\copyright</item>        <item>@copyright</item>
      <item>\fn</item>               <item>@fn</item>
      <item>\ingroup</item>          <item>@ingroup</item>
      <item>\line</item>             <item>@line</item>
      <item>\mainpage</item>         <item>@mainpage</item>
      <item>\name</item>             <item>@name</item>
      <item>\overload</item>         <item>@overload</item>
      <item>\par</item>              <item>@par</item>
      <item>\skip</item>             <item>@skip</item>
      <item>\skipline</item>         <item>@skipline</item>
      <item>\typedef</item>          <item>@typedef</item>
      <item>\until</item>            <item>@until</item>
      <item>\var</item>              <item>@var</item>
      <item>\vhdlflow</item>         <item>@vhdlflow</item>
    </list>
    <list name="TagEnd">
      <item>\endcode</item>          <item>@endcode</item>
      <item>\endverbatim</item>      <item>@endverbatim</item>
      <item>\endmsc</item>           <item>@endmsc</item>
      <item>\enddot</item>           <item>@enddot</item>
    </list>
    <list name="Note">
      <item>\note</item>             <item>@note</item>
    </list>
    <list name="Warning">
      <item>\warning</item>          <item>@warning</item>
    </list>
    <list name="Attention">
      <item>\attention</item>        <item>@attention</item>
      <item>\bug</item>              <item>@bug</item>
    </list>
    <list name="Todo">
      <item>\todo</item>             <item>@todo</item>
    </list>

    <contexts>
    <!--
      Different types of recognized command formats:
      (w/ params specified according doxygen manual (http://www.stack.nl/~dimitri/doxygen/commands.html))

      @tag                       : TagOnly
      @tag <word>                : TagWord
      @tag (rest_of_line)        : TagString
      @tag {paragraph}           : TagOnly
      @tag <word> <word>         : TagWordWord
      @tag <word> (rest_of_line) : TagWordString

      TODO Not all commands are handled properly nowadays :( Need few more contexts...
    -->
      <context attribute="Normal Text" lineEndContext="#stay" name="Normal">
        <RegExpr attribute="Comment" context="LineComment" String="//(?:!|(?:/(?=[^/]|$)))&lt;?" />
        <RegExpr attribute="Comment" context="BlockComment" String="/\*(?:\*[^*/]|!|[*!]&lt;|\*$)" beginRegion="BlockComment" />
        <RegExpr attribute="Region" context="#stay" String="//\s*@\{\s*$" beginRegion="MemberGroup" />
        <RegExpr attribute="Region" context="#stay" String="//\s*@\}\s*$"   endRegion="MemberGroup" />
        <RegExpr attribute="Region" context="#stay" String="/\*\s*@\{\s*\*/" beginRegion="MemberGroup" />
        <RegExpr attribute="Region" context="#stay" String="/\*\s*@\}\s*\*/"   endRegion="MemberGroup" />
      </context>
      <context attribute="Comment" lineEndContext="#pop" name="LineComment">
        <LineContinue attribute="Comment" context="#stay" />
        <DetectSpaces />
        <IncludeRules context="##Comments" />
        <DetectIdentifier />
        <AnyChar attribute="Comment" context="SL_StartTag" String="\@" lookAhead="true" />
        <DetectChar attribute="Comment" context="SL_StartHTMLTag" char="&lt;" lookAhead="true" />
        <DetectChar attribute="Comment" context="Entities" char="&amp;" lookAhead="true" />
      </context>
      <context attribute="Comment" lineEndContext="#stay" name="BlockComment">
        <DetectSpaces />
        <IncludeRules context="##Comments" />
        <DetectIdentifier />
        <AnyChar attribute="Comment" context="ML_StartTag" String="\@" lookAhead="true" />
        <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="BlockComment" />
        <DetectChar attribute="Comment" context="ML_StartHTMLTag" char="&lt;" lookAhead="true" />
        <DetectChar attribute="Comment" context="Entities" char="&amp;" lookAhead="true" />
      </context>

      <!-- NOTE: all contexts beginning with ML_ are for multiline comments
                 The following contexts contain a Detect2Chars that looks for a */ sequence
                 to end multiline comments. Singleline comments do not have this limitation -
                 that's why all contexts are copy&pasted and the line <Detect2Chars ... */> is removed.
                 <IncludeRules context="acontext"> could be used instead but it would make context switching
                 much more complex and very hard to understand! (But use IncludeRules where the rules don't
                 refer to another SL_*/ML_* context, to help maintainability.)
      -->
      <context attribute="Comment" lineEndContext="#pop" name="ML_StartTag">
        <keyword attribute="Tags" context="#pop!ML_TagWord" String="TagWord" />
        <keyword attribute="Tags" context="#pop!ML_TagParam" String="TagParam" />
        <keyword attribute="Tags" context="#pop!ML_TagWordWord" String="TagWordWord" />
        <keyword attribute="Tags" context="#pop!ML_TagString" String="TagString" />
        <keyword attribute="Tags" context="#pop!ML_TagWordString" String="TagWordString" />
        <WordDetect attribute="Tags" context="#pop!ML_Code" String="\code" beginRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop!ML_Code" String="@code" beginRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop!ML_Verbatim" String="\verbatim" beginRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop!ML_Verbatim" String="@verbatim" beginRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop!ML_Formula" String="\f[" beginRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop!ML_Formula" String="@f[" beginRegion="VerbatimBlock" />
        <StringDetect attribute="Tags" context="#pop!ML_FormulaShort" String="\f$" beginRegion="VerbatimBlock" />
        <StringDetect attribute="Tags" context="#pop!ML_FormulaShort" String="@f$" beginRegion="VerbatimBlock" />
        <StringDetect attribute="Tags" context="#pop!ML_FormulaEnv" String="\f{" beginRegion="VerbatimBlock" />
        <StringDetect attribute="Tags" context="#pop!ML_FormulaEnv" String="@f{" beginRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop!ML_Msc" String="\msc" beginRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop!ML_Msc" String="@msc" beginRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop!ML_Dot" String="\dot" beginRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop!ML_Dot" String="@dot" beginRegion="VerbatimBlock" />
        <IncludeRules context="Inc_OtherTag" />
      </context>
      <context attribute="Comment" lineEndContext="#pop" name="ML_StartHTMLTag">
        <Detect2Chars attribute="Comment" context="#pop" char="&lt;" char1="&lt;" />
        <RegExpr attribute="HTML Tag" context="#pop!ML_htmltag" String="&lt;\/?[-\w0-9._:@]+" />
        <StringDetect attribute="HTML Comment" context="#pop!ML_htmlcomment" String="&lt;!--" />
        <DetectChar attribute="Comment" context="#pop" char="&lt;" />
      </context>

      <!-- tag contexts -->
      <context attribute="Comment" lineEndContext="#pop" name="ML_TagWord">
        <DetectSpaces />
        <Detect2Chars attribute="Comment" context="#pop#pop" char="*" char1="/" endRegion="BlockComment" />
        <keyword attribute="Tags" context="#pop!ML_TagWord" String="TagWord" />
        <IncludeRules context="ML_Inc_Word" />
      </context>
      <context attribute="Comment" lineEndContext="#pop" name="ML_TagParam">
        <DetectSpaces />
        <Detect2Chars attribute="Comment" context="#pop#pop" char="*" char1="/" endRegion="BlockComment" />
        <StringDetect attribute="Tags" context="#pop!ML_TagWord" String="[in]" />
        <StringDetect attribute="Tags" context="#pop!ML_TagWord" String="[out]" />
        <StringDetect attribute="Tags" context="#pop!ML_TagWord" String="[in,out]" />
        <IncludeRules context="ML_Inc_Word" />
      </context>
      <context attribute="Comment" lineEndContext="#pop" name="ML_TagWordWord">
        <DetectSpaces />
        <Detect2Chars attribute="Comment" context="#pop#pop" char="*" char1="/" endRegion="BlockComment" />
        <RegExpr attribute="Word" context="#pop!ML_TagWord" String="&ml_word;" />
      </context>
      <context attribute="Comment" lineEndContext="#pop" name="ML_TagString">
        <DetectSpaces />
        <Detect2Chars attribute="Comment" context="#pop#pop" char="*" char1="/" endRegion="BlockComment" />
        <StringDetect attribute="HTML Comment" context="ML_htmlcomment" String="&lt;!--" />
        <Detect2Chars attribute="Comment" context="#stay" char="&lt;" char1="&lt;" />
        <RegExpr attribute="HTML Tag" context="ML_htmltag" String="&lt;\/?[-\w0-9._:@]+" />
        <RegExpr attribute="Description" context="#stay" String="[&lt;*]?[^&lt;*\s]+" />
      </context>
      <context attribute="Comment" lineEndContext="#pop" name="ML_TagWordString">
        <DetectSpaces />
        <Detect2Chars attribute="Comment" context="#pop#pop" char="*" char1="/" endRegion="BlockComment" />
        <IncludeRules context="ML_Inc_Word" />
      </context>

      <context name="ML_Inc_Word" attribute="Word" lineEndContext="#pop">
        <RegExpr attribute="Word" context="#pop" String="&ml_word;" />
      </context>


      <!-- html contexts -->
      <context name="ML_htmltag" attribute="Identifier" lineEndContext="#stay">
        <Detect2Chars attribute="Comment" context="#pop#pop" char="*" char1="/" endRegion="BlockComment" />
        <Detect2Chars attribute="HTML Tag" context="#pop" char="/" char1="&gt;" />
        <DetectChar attribute="HTML Tag" context="#pop" char="&gt;" />
        <DetectSpaces />
        <DetectChar attribute="Identifier" context="ML_identifiers" char="=" />
      </context>
      <context name="ML_htmlcomment" attribute="HTML Comment" lineEndContext="#stay">
        <DetectSpaces />
        <Detect2Chars attribute="Comment" context="#pop#pop" char="*" char1="/" endRegion="BlockComment" />
        <IncludeRules context="##Comments" />
        <DetectIdentifier />
        <StringDetect attribute="HTML Comment" context="#pop" String="--&gt;" />
      </context>
      <context name="ML_identifiers" attribute="Identifier" lineEndContext="#stay">
        <DetectSpaces />
        <Detect2Chars attribute="Comment" context="#pop#pop#pop" char="*" char1="/" endRegion="BlockComment" />
        <DetectChar attribute="Types" context="ML_types1" char="'" />
        <DetectChar attribute="Types" context="ML_types2" char="&quot;" />
      </context>
      <context name="ML_types1" attribute="Types" lineEndContext="#stay">
        <Detect2Chars attribute="Comment" context="#pop#pop#pop#pop" char="*" char1="/" endRegion="BlockComment" />
        <DetectChar attribute="Types" context="#pop#pop" char="'" />
      </context>
      <context name="ML_types2" attribute="Types" lineEndContext="#stay">
        <Detect2Chars attribute="Comment" context="#pop#pop#pop#pop" char="*" char1="/" endRegion="BlockComment" />
        <DetectChar attribute="Types" context="#pop#pop" char="&quot;" />
      </context>

      <context name="ML_FindNextLine" attribute="Comment" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop">
        <DetectSpaces />
        <Detect2Chars attribute="Comment" context="#pop!ML_End_BlockComment" char="*" char1="/" endRegion="VerbatimBlock" lookAhead="1"/>
        <Detect2Chars attribute="Comment" context="ML_VerbatimPrefix" char="*" char1="*" lookAhead="true" />
        <DetectChar attribute="Comment" context="#pop" char="*" />
      </context>
      <context name="ML_VerbatimPrefix" attribute="Comment" lineEndContext="#stay">
        <DetectChar attribute="Comment" context="#pop" char="*" />
      </context>

      <context name="ML_End_BlockComment" attribute="Comment" lineEndContext="#stay">
        <Detect2Chars attribute="Error" context="#pop#pop#pop" char="*" char1="/" endRegion="BlockComment"/>
      </context>

      <context name="ML_Code" attribute="Code" lineEndContext="ML_FindNextLine">
        <Detect2Chars attribute="Comment" context="ML_End_BlockComment" char="*" char1="/" endRegion="VerbatimBlock" lookAhead="1"/>
        <WordDetect attribute="Tags" context="#pop" String="\endcode" endRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop" String="@endcode" endRegion="VerbatimBlock" />
      </context>

      <context name="ML_Verbatim" attribute="Verbatim" lineEndContext="ML_FindNextLine">
        <Detect2Chars attribute="Comment" context="ML_End_BlockComment" char="*" char1="/" endRegion="VerbatimBlock" lookAhead="1"/>
        <WordDetect attribute="Tags" context="#pop" String="\endverbatim" endRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop" String="@endverbatim" endRegion="VerbatimBlock" />
      </context>

      <context name="ML_Formula" attribute="Formulas" lineEndContext="ML_FindNextLine">
        <Detect2Chars attribute="Comment" context="ML_End_BlockComment" char="*" char1="/" endRegion="VerbatimBlock" lookAhead="1"/>
        <StringDetect attribute="Tags" context="#pop" String="\f]" endRegion="VerbatimBlock" />
        <StringDetect attribute="Tags" context="#pop" String="@f]" endRegion="VerbatimBlock" />
        <!-- TODO: How to force LaTeX math context here?? -->
        <!-- <IncludeRules context="##LaTeX" /> -->
      </context>

      <context name="ML_FormulaShort" attribute="Formulas" lineEndContext="ML_FindNextLine">
        <Detect2Chars attribute="Comment" context="ML_End_BlockComment" char="*" char1="/" endRegion="VerbatimBlock" lookAhead="1"/>
        <StringDetect attribute="Tags" context="#pop" String="\f$" endRegion="VerbatimBlock" />
        <StringDetect attribute="Tags" context="#pop" String="@f$" endRegion="VerbatimBlock" />
        <!-- TODO: How to force LaTeX math context here?? -->
        <!-- <IncludeRules context="##LaTeX" /> -->
      </context>

      <context name="ML_FormulaEnv" attribute="Word" lineEndContext="ML_FindNextLine">
        <DetectChar attribute="Tags" context="#pop!ML_FormulaEnvStart" char="}" />
        <Detect2Chars attribute="Comment" context="ML_End_BlockComment" char="*" char1="/" endRegion="VerbatimBlock" lookAhead="1"/>
      </context>

      <context name="ML_FormulaEnvStart" attribute="Formulas" lineEndContext="ML_FindNextLine" fallthrough="true" fallthroughContext="#pop!ML_FormulaEnvFormula">
        <DetectSpaces attribute="Comment" />
        <DetectChar attribute="Tags" context="#pop!ML_FormulaEnvFormula" char="{" />
        <Detect2Chars attribute="Comment" context="ML_End_BlockComment" char="*" char1="/" endRegion="VerbatimBlock" lookAhead="1"/>
      </context>

      <context name="ML_FormulaEnvFormula" attribute="Formulas" lineEndContext="ML_FindNextLine">
        <Detect2Chars attribute="Comment" context="ML_End_BlockComment" char="*" char1="/" endRegion="VerbatimBlock" lookAhead="1"/>
        <StringDetect attribute="Tags" context="#pop" String="\f}" endRegion="VerbatimBlock" />
        <StringDetect attribute="Tags" context="#pop" String="@f}" endRegion="VerbatimBlock" />
        <!-- TODO: How to force LaTeX math context here?? -->
        <!-- <IncludeRules context="##LaTeX" /> -->
      </context>

      <context name="ML_Msc" attribute="Message Sequence Chart" lineEndContext="ML_FindNextLine">
        <Detect2Chars attribute="Comment" context="ML_End_BlockComment" char="*" char1="/" endRegion="VerbatimBlock" lookAhead="1"/>
        <WordDetect attribute="Tags" context="#pop" String="\endmsc" endRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop" String="@endmsc" endRegion="VerbatimBlock" />
      </context>

      <context name="ML_Dot" attribute="Dot Graph" lineEndContext="ML_FindNextLine">
        <Detect2Chars attribute="Comment" context="ML_End_BlockComment" char="*" char1="/" endRegion="VerbatimBlock" lookAhead="1"/>
        <WordDetect attribute="Tags" context="#pop" String="\enddot" endRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop" String="@enddot" endRegion="VerbatimBlock" />
      </context>

      <!-- NOTE: all contexts beginning with SL_ are for singleline comments -->
      <context attribute="Comment" lineEndContext="#pop" name="SL_StartTag">
        <keyword attribute="Tags" context="#pop!SL_TagWord" String="TagWord" />
        <keyword attribute="Tags" context="#pop!SL_TagParam" String="TagParam" />
        <keyword attribute="Tags" context="#pop!SL_TagWordWord" String="TagWordWord" />
        <keyword attribute="Tags" context="#pop!SL_TagString" String="TagString" />
        <keyword attribute="Tags" context="#pop!SL_TagWordString" String="TagWordString" />
        <WordDetect attribute="Tags" context="#pop!SL_Code" String="\code" beginRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop!SL_Code" String="@code" beginRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop!SL_Verbatim" String="\verbatim" beginRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop!SL_Verbatim" String="@verbatim" beginRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop!SL_Formula" String="\f[" beginRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop!SL_Formula" String="@f[" beginRegion="VerbatimBlock" />
        <StringDetect attribute="Tags" context="#pop!SL_FormulaShort" String="\f$" beginRegion="VerbatimBlock" />
        <StringDetect attribute="Tags" context="#pop!SL_FormulaShort" String="@f$" beginRegion="VerbatimBlock" />
        <StringDetect attribute="Tags" context="#pop!SL_FormulaEnv" String="\f{" beginRegion="VerbatimBlock" />
        <StringDetect attribute="Tags" context="#pop!SL_FormulaEnv" String="@f{" beginRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop!SL_Msc" String="\msc" beginRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop!SL_Msc" String="@msc" beginRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop!SL_Dot" String="\dot" beginRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop!SL_Dot" String="@dot" beginRegion="VerbatimBlock" />
        <IncludeRules context="Inc_OtherTag" />
      </context>
      <context attribute="Comment" lineEndContext="#pop" name="SL_StartHTMLTag">
        <Detect2Chars attribute="Comment" context="#pop" char="&lt;" char1="&lt;" />
        <RegExpr attribute="HTML Tag" context="#pop!SL_htmltag" String="&lt;\/?[-\w0-9._:@]+" />
        <StringDetect attribute="HTML Comment" context="#pop!SL_htmlcomment" String="&lt;!--" />
        <DetectChar attribute="Comment" context="#pop" char="&lt;" />
      </context>

      <!-- tag contexts -->
      <context attribute="Comment" lineEndContext="#pop" name="SL_TagWord">
        <DetectSpaces />
        <keyword attribute="Tags" context="#pop!SL_TagWord" String="TagWord" />
        <IncludeRules context="SL_Inc_Word" />
      </context>
      <context attribute="Comment" lineEndContext="#pop" name="SL_TagParam">
        <DetectSpaces />
        <StringDetect attribute="Tags" context="#pop!SL_TagWord" String="[in]" />
        <StringDetect attribute="Tags" context="#pop!SL_TagWord" String="[out]" />
        <StringDetect attribute="Tags" context="#pop!SL_TagWord" String="[in,out]" />
        <IncludeRules context="SL_Inc_Word" />
      </context>
      <context attribute="Comment" lineEndContext="#pop" name="SL_TagWordWord">
        <DetectSpaces />
        <RegExpr attribute="Word" context="#pop!SL_TagWord" String="&sl_word;" />
      </context>
      <context attribute="Comment" lineEndContext="#pop" name="SL_TagString">
        <DetectSpaces />
        <StringDetect attribute="HTML Comment" context="SL_htmlcomment" String="&lt;!--" />
        <Detect2Chars attribute="Comment" context="#stay" char="&lt;" char1="&lt;" />
        <RegExpr attribute="HTML Tag" context="SL_htmltag" String="&lt;\/?[-\w0-9._:@]+" />
        <RegExpr attribute="Description" context="#stay" String="&lt;?[^&lt;\s]+" />
      </context>
      <context attribute="Comment" lineEndContext="#pop" name="SL_TagWordString">
        <DetectSpaces />
        <IncludeRules context="SL_Inc_Word" />
      </context>
      <context name="SL_Inc_Word" attribute="Word" lineEndContext="#pop">
        <RegExpr attribute="Word" context="#pop" String="&sl_word;" />
      </context>

      <!-- html contexts -->
      <context name="SL_htmltag" attribute="Identifier" lineEndContext="#pop">
        <Detect2Chars attribute="HTML Tag" context="#pop" char="/" char1="&gt;" />
        <DetectChar attribute="HTML Tag" context="#pop" char="&gt;" />
        <DetectSpaces />
        <DetectChar attribute="Identifier" context="SL_identifiers" char="=" />
      </context>
      <context name="SL_htmlcomment" attribute="HTML Comment" lineEndContext="#pop">
        <DetectSpaces />
        <IncludeRules context="##Comments" />
        <DetectIdentifier />
        <StringDetect attribute="HTML Comment" context="#pop" String="--&gt;" />
      </context>
      <context name="SL_identifiers" attribute="Identifier" lineEndContext="#pop">
        <DetectSpaces />
        <DetectChar attribute="Types" context="SL_types1" char="'" />
        <DetectChar attribute="Types" context="SL_types2" char="&quot;" />
      </context>
      <context name="SL_types1" attribute="Types" lineEndContext="#pop">
        <DetectChar attribute="Types" context="#pop#pop" char="'" />
      </context>
      <context name="SL_types2" attribute="Types" lineEndContext="#pop">
        <DetectChar attribute="Types" context="#pop#pop" char="&quot;" />
      </context>

      <context name="SL_FindNextLine" attribute="Normal Text" lineEndContext="#stay" fallthrough="true" fallthroughContext="#pop#pop#pop">
        <DetectSpaces />
        <StringDetect attribute="Comment" context="#pop" String="///" />
        <StringDetect attribute="Comment" context="#pop" String="//!" />
        <RegExpr attribute="Comment" context="#pop#pop#pop" String="." lookAhead="true" endRegion="VerbatimBlock" />
      </context>

      <context name="SL_Code" attribute="Code" lineEndContext="SL_FindNextLine">
        <WordDetect attribute="Tags" context="#pop" String="\endcode" endRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop" String="@endcode" endRegion="VerbatimBlock" />
      </context>

      <context name="SL_Verbatim" attribute="Verbatim" lineEndContext="SL_FindNextLine">
        <WordDetect attribute="Tags" context="#pop" String="\endverbatim" endRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop" String="@endverbatim" endRegion="VerbatimBlock" />
      </context>

      <context name="SL_Formula" attribute="Formulas" lineEndContext="SL_FindNextLine">
        <StringDetect attribute="Tags" context="#pop" String="\f]" endRegion="VerbatimBlock" />
        <StringDetect attribute="Tags" context="#pop" String="@f]" endRegion="VerbatimBlock" />
        <!-- TODO: How to force LaTeX math context here?? -->
        <!-- <IncludeRules context="##LaTeX" /> -->
      </context>

      <context name="SL_FormulaShort" attribute="Formulas" lineEndContext="SL_FindNextLine">
        <StringDetect attribute="Tags" context="#pop" String="\f$" endRegion="VerbatimBlock" />
        <StringDetect attribute="Tags" context="#pop" String="@f$" endRegion="VerbatimBlock" />
        <!-- TODO: How to force LaTeX math context here?? -->
        <!-- <IncludeRules context="##LaTeX" /> -->
      </context>

      <context name="SL_FormulaEnv" attribute="Word" lineEndContext="SL_FindNextLine">
        <DetectChar attribute="Tags" context="#pop!SL_FormulaEnvStart" char="}" />
      </context>

      <context name="SL_FormulaEnvStart" attribute="Formulas" lineEndContext="SL_FindNextLine" fallthrough="true" fallthroughContext="#pop!SL_FormulaEnvFormula">
        <DetectSpaces attribute="Comment" />
        <DetectChar attribute="Tags" context="#pop!SL_FormulaEnvFormula" char="{" />
      </context>

      <context name="SL_FormulaEnvFormula" attribute="Formulas" lineEndContext="SL_FindNextLine">
        <StringDetect attribute="Tags" context="#pop" String="\f}" endRegion="VerbatimBlock" />
        <StringDetect attribute="Tags" context="#pop" String="@f}" endRegion="VerbatimBlock" />
        <!-- TODO: How to force LaTeX math context here?? -->
        <!-- <IncludeRules context="##LaTeX" /> -->
      </context>

      <context name="SL_Msc" attribute="Message Sequence Chart" lineEndContext="SL_FindNextLine">
        <WordDetect attribute="Tags" context="#pop" String="\endmsc" endRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop" String="@endmsc" endRegion="VerbatimBlock" />
      </context>

      <context name="SL_Dot" attribute="Dot Graph" lineEndContext="SL_FindNextLine">
        <WordDetect attribute="Tags" context="#pop" String="\enddot" endRegion="VerbatimBlock" />
        <WordDetect attribute="Tags" context="#pop" String="@enddot" endRegion="VerbatimBlock" />
      </context>

      <context name="Entities" attribute="Word" lineEndContext="#stay">
        <RegExpr attribute="Entities" context="#pop" String="&amp;[A-Za-z]+&#59;" />
        <DetectChar attribute="Comment" context="#pop" char="&amp;" />
      </context>

      <context name="Inc_OtherTag" attribute="Comment" lineEndContext="#pop">
        <keyword attribute="Note" context="#pop" String="Note" />
        <keyword attribute="Warning" context="#pop" String="Warning" />
        <keyword attribute="Attention" context="#pop" String="Attention" />
        <keyword attribute="Todo" context="#pop" String="Todo" />
        <keyword attribute="Tags" context="#pop" String="TagOnly" />
        <Detect2Chars attribute="Region" context="#pop" char="@" char1="{" beginRegion="Group" />
        <Detect2Chars attribute="Region" context="#pop" char="@" char1="}" endRegion="Group" />
        <Detect2Chars attribute="Tags" context="#pop!LanguageId" char="\" char1="~" />
        <Detect2Chars attribute="Tags" context="#pop!LanguageId" char="@" char1="~" />
        <keyword attribute="Error" context="#pop" String="TagEnd" />
        <RegExpr attribute="Error" context="#pop" String="[@\\]f[]}]" />
        <RegExpr attribute="Tags" context="#pop" String="[@\\](?:[#$%&amp;&lt;&gt;&quot;@\\.]|::|---?)(?=&wordsep;)" />
        <RegExpr attribute="Custom Tags" context="#pop" String="[@\\](?:[^@\\ \t\*]|\*(?!/))+" />
        <AnyChar attribute="Comment" context="#pop" String="\@" />
      </context>

      <context name="LanguageId" attribute="Word" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop">
        <DetectIdentifier />
      </context>

  </contexts>
    <itemDatas>
      <itemData name="Normal Text"  defStyleNum="dsNormal" />
      <itemData name="Tags"         defStyleNum="dsAnnotation" bold="1" />
      <itemData name="Custom Tags"  defStyleNum="dsAnnotation" />
      <itemData name="Word"         defStyleNum="dsCommentVar" bold="1" italic="0" />
      <itemData name="HTML Tag"     defStyleNum="dsKeyword" bold="1" italic="0" />
      <itemData name="Entities"     defStyleNum="dsOthers" color="#4086C0" bold="1" italic="1" />
      <itemData name="Description"  defStyleNum="dsDocumentation" />
      <itemData name="Comment"      defStyleNum="dsComment" />
      <itemData name="Region"       defStyleNum="dsRegionMarker" />
      <itemData name="Identifier"   defStyleNum="dsOthers" />
      <itemData name="HTML Comment" defStyleNum="dsComment" />
      <itemData name="Types"        defStyleNum="dsDataType" />
      <itemData name="Code"         defStyleNum="dsComment" />
      <itemData name="Dot Graph"    defStyleNum="dsComment" color="#00A000" selColor="#ffffff" italic="1" />
      <itemData name="Formulas"     defStyleNum="dsComment" color="#00A000" selColor="#ffffff" italic="1" />
      <itemData name="Message Sequence Chart" defStyleNum="dsComment" color="#00A000" selColor="#ffffff" italic="1" />
      <itemData name="Verbatim"     defStyleNum="dsComment" />
      <itemData name="Note"         defStyleNum="dsInformation" bold="1" italic="0" />
      <itemData name="Warning"      defStyleNum="dsWarning" bold="1" italic="0" />
      <itemData name="Attention"    defStyleNum="dsAnnotation" bold="1" italic="0" />
      <itemData name="Todo"         defStyleNum="dsAnnotation" bold="1" italic="0" />
      <itemData name="Error"        defStyleNum="dsError" />
    </itemDatas>
  </highlighting>
  <general>
    <keywords casesensitive="1" weakDeliminator="\$" />
  </general>
</language>
<!-- kate: indent-width 2; -->
