summaryrefslogtreecommitdiffstats
path: root/kate/data/rtf.xml
blob: 50ea497bc87ab99dc93b9af25af516150ab616e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd" [ <!ENTITY number "([-]?\d+)"> ] >
<language name="Rich Text Format" version="1.0" kateversion="2.4" section="Markup" extensions="*.rtf" mimetype="text/rtf;application/rtf" author="Lukas Sommer" license="LGPL version 2.1, or version 3 or later versions approved by the membership of KDE e.V.; or any other license appoved by the emembership of KDE e.V.">

  <highlighting>
    
    <contexts>

      <context attribute="Text" lineEndContext="#stay" name="context_normal">
        <DetectChar char="{" attribute="Braces" beginRegion="true" />
        <DetectChar char="}" attribute="Braces" endRegion="true" />
        <DetectChar char="\" lookAhead="true" context="context_process_backslash" />
      </context>

      <context lineEndContext="context_normal" fallthrough="true" fallthroughContext="context_normal" attribute="Numeric parameter" name="context_process_backslash">
        <Detect2Chars char="\" char1="|" attribute="Control words" />
        <Detect2Chars char="\" char1="~" attribute="Character" />
        <Detect2Chars char="\" char1="-" attribute="Character" />
        <Detect2Chars char="\" char1="_" attribute="Character" />
        <Detect2Chars char="\" char1=":" attribute="Control words" />
        <Detect2Chars char="\" char1="*" attribute="Control words" />
        <Detect2Chars char="\" char1="\" attribute="Character" />
        <Detect2Chars char="\" char1="{" attribute="Character" />
        <Detect2Chars char="\" char1="}" attribute="Character" />
        <RegExpr String="\\u&number;" attribute="Character"/>
        <RegExpr String="\\'[01-9a-f]{2}" attribute="Character"/>
        <RegExpr String="\\[a-zA-Z]+" attribute="Control words" context="context_functionparameter" />
        <DetectChar char="\" attribute="Error" />
      </context>

      <context attribute="Control words" lineEndContext="context_normal" fallthrough="true" fallthroughContext="context_normal" name="context_functionparameter">
        <RegExpr String="[-]?\d+" attribute="Numeric parameter" context="context_normal" />
        <DetectChar char="-" attribute="Error" />
      </context>

    </contexts>
    
    <itemDatas>
      <itemData name="Text" defStyleNum="dsString"/>
      <itemData name="Character" defStyleNum="dsChar"/>
      <itemData name="Braces" defStyleNum="dsKeyword"/>
      <itemData name="Control words" defStyleNum="dsFunction"/>
      <itemData name="Numeric parameter" defStyleNum="dsDecVal"/>
      <itemData name="Error" defStyleNum="dsError"/>
    </itemDatas>
    
  </highlighting>
  
</language>