Warning, /frameworks/syntax-highlighting/data/syntax/diff.xml is written in an unsupported language. File is not indexed.

0001 <?xml version="1.0" encoding="UTF-8"?>
0002 <!DOCTYPE language
0003 [
0004   <!ENTITY file  "(====|\*\*\*|\-\-\-|diff|Only in [^:]*:).*$">
0005 ]>
0006 <!--
0007     2006-08-02: 1.10 Matthew Woehlke <mw_triad@sourceforge.net>
0008       Added folding. Context diff changes are now identified as old/new (using
0009       seperate attributes). Recognize 'Only in' from 'diff -r' output.
0010       There is currently a bug (KATE limitation?) where regions may sometimes
0011       pick up one line too many.
0012     2008-02-13: 1.11 Eduardo Robles Elvira <edulix AT gmail DOT com>
0013      Fixed folding.
0014 -->
0015 <language name="Diff" version="9" kateversion="5.62" section="Other" extensions="*.diff;*patch;*.rej" mimetype="text/x-patch">
0016 
0017   <highlighting>
0018 
0019     <contexts>
0020 
0021       <context attribute="Normal Text" lineEndContext="#stay" name="Normal" fallthroughContext="AttrNormal">
0022         <Detect2Chars attribute="Header" context="AttrHeader_Chunk" char="@" char1="@" beginRegion="chunk" column="0"/>
0023         <AnyChar attribute="Header" context="AttrHeader_Chunk" String="0123456789" beginRegion="chunk" column="0"/>
0024         <RegExpr attribute="Header" context="RChunk" String="^\*+$" beginRegion="chunk" column="0"/>
0025         <RegExpr attribute="File" context="#stay" String="^Only in [^:]*:.*$" column="0"/>
0026         <StringDetect attribute="File" context="AttrFile_RFile" String="diff" beginRegion="chunk" column="0"/>
0027         <StringDetect attribute="File" context="AttrFile" String="====" column="0"/>
0028         <StringDetect attribute="File" context="AttrFile_File" String="***" beginRegion="chunk" column="0"/>
0029         <StringDetect attribute="File" context="AttrFile_File" String="---" beginRegion="chunk" column="0"/>
0030         <IncludeRules context="FindDiff"/>
0031         <DetectChar attribute="Changed line (old)" context="ChangedOld" char="!" column="0"/>
0032       </context>
0033 
0034       <context attribute="Normal Text" lineEndContext="#stay" name="FindDiff">
0035         <StringDetect attribute="File" context="AttrFile" String="---" column="0"/>
0036         <StringDetect attribute="Header" context="AttrHeader" String="+++" column="0"/>
0037         <AnyChar attribute="Added line" context="Added" String="+&gt;" column="0"/>
0038         <AnyChar attribute="Removed line" context="Removed" String="-&lt;" column="0"/>
0039       </context>
0040 
0041       <!-- block contexts -->
0042       <context attribute="Normal Text" lineEndContext="#stay" name="File" fallthroughContext="AttrNormal">
0043         <IncludeRules context="FindDiff"/>
0044         <Detect2Chars attribute="Header" context="AttrHeader_ChunkInFile" char="@" char1="@" beginRegion="chunk" column="0"/>
0045         <AnyChar attribute="Header" context="AttrHeader_ChunkInFile" String="0123456789" beginRegion="chunk" column="0"/>
0046         <RegExpr attribute="Header" context="RChunkInFile" String="^\*+$" beginRegion="chunk" column="0"/>
0047         <RegExpr attribute="File" context="#pop" String="^&file;" endRegion="chunk" column="0"/>
0048         <DetectChar attribute="Changed line (old)" context="ChangedOld" char="!" column="0"/>
0049       </context>
0050 
0051       <context attribute="Normal Text" lineEndContext="#stay" name="Chunk" fallthroughContext="AttrNormal">
0052         <IncludeRules context="FindDiff"/>
0053         <Detect2Chars attribute="Header" context="#pop" char="@" char1="@" endRegion="chunk" lookAhead="true" column="0"/>
0054         <AnyChar attribute="Header" context="#pop" String="0123456789" endRegion="chunk" lookAhead="true" column="0"/>
0055         <DetectChar attribute="Changed line (old)" context="ChangedOld" char="!" column="0"/>
0056       </context>
0057 
0058       <context attribute="Normal Text" lineEndContext="#stay" name="ChunkInFile" fallthroughContext="AttrNormal">
0059         <IncludeRules context="FindDiff"/>
0060         <Detect2Chars attribute="Header" context="#pop" char="@" char1="@" endRegion="chunk" lookAhead="true" column="0"/>
0061         <AnyChar attribute="Header" context="#pop" String="0123456789" endRegion="chunk" lookAhead="true" column="0"/>
0062         <StringDetect attribute="Normal Text" context="#pop!AttrNormal" String="Index:" endRegion="chunk" column="0"/>
0063         <RegExpr attribute="File" context="#pop" String="^&file;" endRegion="chunk" lookAhead="true" column="0"/>
0064         <DetectChar attribute="Changed line (old)" context="ChangedOld" char="!" column="0"/>
0065       </context>
0066 
0067       <!-- block contexts (diff -r) -->
0068       <context attribute="Normal Text" lineEndContext="#stay" name="RFile" fallthroughContext="AttrNormal">
0069         <RegExpr attribute="File" context="#pop" String="^(diff|Only in [^:]*:)" endRegion="chunk" lookAhead="true" column="0"/>
0070         <RegExpr attribute="Header" context="#stay" String="^&file;" column="0"/>
0071         <RegExpr attribute="Header" context="RChunkInFile" String="^\*+$" beginRegion="chunk" column="0"/>
0072         <IncludeRules context="File"/>
0073       </context>
0074 
0075       <context attribute="Normal Text" lineEndContext="#stay" name="RChunk" fallthroughContext="AttrNormal">
0076         <RegExpr attribute="Header" context="#stay" String="^\*\*\* .* \*\*\*\*$" column="0"/>
0077         <RegExpr attribute="Header" context="RChunkNew" String="^\-\-\- .* \-\-\-\-$" column="0"/>
0078         <IncludeRules context="Chunk"/>
0079       </context>
0080 
0081       <context attribute="Normal Text" lineEndContext="#stay" name="RChunkInFile" fallthroughContext="AttrNormal">
0082         <RegExpr attribute="Header" context="#stay" String="^\*\*\* .* \*\*\*\*$" column="0"/>
0083         <RegExpr attribute="Header" context="RChunkInFileNew" String="^\-\-\- .* \-\-\-\-$" column="0"/>
0084         <IncludeRules context="ChunkInFile"/>
0085       </context>
0086 
0087       <context attribute="Normal Text" lineEndContext="#stay" name="RChunkNew" fallthroughContext="AttrNormal">
0088         <Detect2Chars attribute="Header" context="#pop#pop" char="@" char1="@" lookAhead="true" column="0"/>
0089         <AnyChar attribute="Header" context="#pop#pop" String="0123456789" lookAhead="true" column="0"/>
0090         <DetectChar attribute="Changed line (new)" context="ChangedNew" char="!" column="0"/>
0091         <IncludeRules context="FindDiff"/>
0092       </context>
0093 
0094       <context attribute="Normal Text" lineEndContext="#stay" name="RChunkInFileNew" fallthroughContext="AttrNormal">
0095         <Detect2Chars attribute="Header" context="#pop#pop" char="@" char1="@" lookAhead="true" column="0"/>
0096         <AnyChar attribute="Header" context="#pop#pop" String="0123456789" lookAhead="true" column="0"/>
0097         <RegExpr attribute="File" context="#pop#pop" String="^&file;" endRegion="chunk" lookAhead="true" column="0"/>
0098         <DetectChar attribute="Changed line (new)" context="ChangedNew" char="!" column="0"/>
0099         <IncludeRules context="FindDiff"/>
0100       </context>
0101 
0102       <!-- line contexts -->
0103       <context attribute="Removed line" lineEndContext="#pop" name="Removed"/>
0104       <context attribute="Added line" lineEndContext="#pop" name="Added"/>
0105       <context attribute="Changed line (old)" lineEndContext="#pop" name="ChangedOld"/>
0106       <context attribute="Changed line (new)" lineEndContext="#pop" name="ChangedNew"/>
0107 
0108       <context attribute="Normal Text" lineEndContext="#pop" name="AttrNormal"/>
0109       <context attribute="File" lineEndContext="#pop" name="AttrFile"/>
0110       <context attribute="File" lineEndContext="#pop!File" name="AttrFile_File"/>
0111       <context attribute="File" lineEndContext="#pop!RFile" name="AttrFile_RFile"/>
0112       <context attribute="Header" lineEndContext="#pop" name="AttrHeader"/>
0113       <context attribute="Header" lineEndContext="#pop!Chunk" name="AttrHeader_Chunk"/>
0114       <context attribute="Header" lineEndContext="#pop!ChunkInFile" name="AttrHeader_ChunkInFile"/>
0115     </contexts>
0116 
0117     <itemDatas>
0118       <itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/>
0119       <itemData name="File"  defStyleNum="dsKeyword" spellChecking="false"/>
0120       <itemData name="Header"  defStyleNum="dsDataType" spellChecking="false"/>
0121       <itemData name="Removed line"  defStyleNum="dsString" spellChecking="false"/>
0122       <itemData name="Added line"  defStyleNum="dsVariable" spellChecking="false"/>
0123       <itemData name="Changed line (old)"  defStyleNum="dsString" spellChecking="false"/>
0124       <itemData name="Changed line (new)"  defStyleNum="dsVariable" spellChecking="false"/>
0125     </itemDatas>
0126 
0127   </highlighting>
0128 
0129 </language>