~l3on/ubuntu/precise/rkward/rebuild1

« back to all changes in this revision

Viewing changes to rkward/syntax/rkward.xml

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Friedrichsmeier
  • Date: 2008-04-20 21:30:00 UTC
  • mfrom: (1.2.2 upstream) (3.1.9 hardy)
  • Revision ID: james.westby@ubuntu.com-20080420213000-fs4i8efmfc793bnn
new upstream release
closes: #475175
closes: #463348
closes: #475982

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?xml version="1.0" encoding="UTF-8"?>
2
2
<!DOCTYPE language SYSTEM "language.dtd">
3
3
<!-- Kate 2.0 (KDE 3.0) highlighting module for RKWard
4
 
        version 0.2: (c) 2006 P. Ecochard
 
4
        version 2.0: (c) 2006 P. Ecochard
5
5
        lincense: GPL v2
6
 
        Based on the highlighting module for R version 0.4: (c) 2006 Thomas Friedrichsmeier, Arne Henningsen, and the RKWard Team
 
6
        Based on the highlighting module for R version 2.0: (c) 2006 Thomas Friedrichsmeier, Arne Henningsen, and the RKWard Team
7
7
        
8
8
        Kate   : http://kate.kde.org/
9
9
        R      : http://www.r-project.org/
10
10
        RKWard : http://rkward.sourceforge.net/
11
11
        -->
12
 
<language version="0.2" kateversion="2.1" name="RKWard output" section="Scripts" extensions="" mimetype="" author="P. Ecochard" license="GPL">
 
12
<language version="2.02" kateversion="2.5" name="RKWard output" section="Scripts" extensions="" mimetype="" author="P. Ecochard" license="GPL">
13
13
<highlighting>
14
14
        <list name="controls">
15
15
        <item> for </item>
28
28
        <item> FALSE </item>
29
29
        <item> NULL </item>
30
30
        <item> NA </item>
 
31
        <item> NA_integer_ </item>
 
32
        <item> NA_real_ </item>
 
33
        <item> NA_complex_ </item>
 
34
        <item> NA_character_ </item>
31
35
        <item> Inf </item>
32
36
        <item> NaN </item>
33
37
        </list>
35
39
        <contexts>
36
40
                <!-- This context dispatches to the two main contexts output or command. -->
37
41
                <context attribute="Prompt" lineEndContext="#stay" name="ctxbase">
38
 
                        <RegExpr attribute="Prompt" context="command0" String="^&gt; " beginRegion="commandRegion"/>
 
42
                        <Detect2Chars attribute="Prompt" context="command0" char="&gt;" char1=" " column="0" beginRegion="commandRegion"/>
39
43
                        <RegExpr attribute="Normal Text" context="output" String="^([^&gt;\+]|$)" lookAhead="true"/>
40
44
                </context>
41
45
 
42
46
                <!-- The output context does no highlighting. If a "> " is encountered at line start, pop back to ctxbase (and to command0 from there) --> 
43
47
                <context attribute="Output" lineEndContext="#stay" name="output">
44
 
                        <RegExpr attribute="Prompt" context="#pop" String="^&gt; " lookAhead="true" endRegion="commandRegion"/>
 
48
                        <Detect2Chars attribute="Prompt" context="#pop" char="&gt;" char1=" " column="0" lookAhead="true" endRegion="commandRegion"/>
45
49
                </context>
46
50
 
47
51
                <!-- The base level context in command mode. Does not allow closing '}' -->
62
66
 
63
67
                <context attribute="Normal Text" lineEndContext="#stay" name="parenthesis">
64
68
                        <IncludeRules context="CommandContinuationCheck"/>
65
 
                        <DetectChar attribute="Keyword" context="#pop" char=")"/>
 
69
                        <DetectChar attribute="Symbol" context="#pop" char=")"/>
66
70
                        
67
71
                        <RegExpr attribute="Identifier" context="#stay" String="[a-zA-Z_\.][0-9a-zA-Z_\.]*[\s]*=(?=([^=]|$))"/>
68
72
                        
76
80
                        <HlCStringChar attribute="String Char" context="#stay"/>
77
81
                </context>
78
82
 
 
83
                <context attribute="String" lineEndContext="#stay" name="string2">
 
84
                        <IncludeRules context="CommandContinuationCheck"/>
 
85
                        <DetectChar attribute="String" context="#pop" char="'"/>
 
86
                        <HlCStringChar attribute="String Char" context="#stay"/>
 
87
                </context>
 
88
 
 
89
                <context attribute="Identifier" lineEndContext="#stay" name="backquotedsymbol">
 
90
                        <IncludeRules context="CommandContinuationCheck"/>
 
91
                        <DetectChar attribute="String" context="#pop" char="`"/>
 
92
                        <HlCStringChar attribute="String Char" context="#stay"/>
 
93
                </context>
 
94
 
79
95
                <context attribute="Headline" lineEndContext="#pop" name="Headline"/>
80
96
                <context attribute="Comment" lineEndContext="#pop" name="Comment"/>
81
97
 
91
107
                <!-- This context is not really used, but contains the common rules -->
92
108
                <context attribute="Normal Text" name="CommonRules" lineEndContext="#stay">
93
109
                        <DetectChar attribute="String" context="string" char="&quot;"/>
 
110
                        <DetectChar attribute="String" context="string2" char="'"/>
 
111
                        <DetectChar attribute="String" context="backquotedsymbol" char="`"/>
94
112
                        <keyword attribute="Control Structure" context="#stay" String="controls"/>
95
113
                        <keyword attribute="Reserved Words" context="#stay" String="words"/>
96
114
                        <Float attribute="Float" context="#stay"/>
97
115
                        <Int attribute="Int" context="#stay"/>
98
116
                        <RegExpr attribute="Keyword" context="#stay" String="[a-zA-Z_]+[a-zA-Z_\.0-9]*(?=[\s]*[(])"/>
99
117
                        <RegExpr attribute="Keyword" context="#stay" String="\.[a-zA-Z_\.]+[a-zA-Z_\.0-9]*(?=[\s]*[(])"/>
100
 
                        <RegExpr attribute="Keyword" context="parenthesis" String="\("/>
 
118
                        <RegExpr attribute="Symbol" context="parenthesis" String="\("/>
101
119
                        <StringDetect attribute="Headline" context="Headline" String="##"/>
102
120
                        <DetectChar attribute="Comment" context="Comment" char="#"/>
103
121
                        
113
131
                        <RegExpr attribute="Assign" context="#stay" String="=(?!=)"/>
114
132
                        
115
133
                        <!-- These operators are fine as long as they're followed by something else or end of line. Error otherwise -->
116
 
                        <RegExpr attribute="Operator" context="#stay" String="(\+|\-|\*|/|&lt;=|&gt;=|={1,2}|\!=|\|{1,2}|&amp;{1,2}|:{1,2}|\^|@|\$|~)((?!(\+|\-|\*|/|&lt;=|&gt;=|=|\!=|\||&amp;|:|\^|@|\$|~))|$)"/>
117
 
                        <RegExpr attribute="Error" context="#stay" String="(\+|\-|\*|/|&lt;=|&gt;=|={1,2}|\!=|\|{1,2}|&amp;{1,2}|:{1,2}|\^|@|\$|~){2,}"/>       
 
134
                        <RegExpr attribute="Operator" context="#stay" String="(\+|\-|\*|/|&lt;=|&gt;=|={1,2}|\!=|\|{1,2}|&amp;{1,2}|:{1,3}|\^|@|\$|~)((?!(\+|\-|\*|/|&lt;=|&gt;=|=|\!=|\||&amp;|:|\^|@|\$|~))|$)"/>
 
135
                        <RegExpr attribute="Error" context="#stay" String="(\+|\-|\*|/|&lt;=|&gt;=|={1,2}|\!=|\|{1,2}|&amp;{1,2}|:{1,3}|\^|@|\$|~){2,}"/>       
118
136
                        <RegExpr attribute="Operator" context="#stay" String="%[^%]*%"/>
119
137
 
120
138
                        <!-- Contrary to the normal R Script highlighting, we don't start a region here, but we do go into a command sub-context -->
121
139
                        <DetectChar attribute="Symbol" context="command" char="{" />
 
140
                        
 
141
                        <!-- This is needed only to assist variable based indentation -->
 
142
                        <DetectChar attribute="Symbol" context="#stay" char="[" />
 
143
                        <DetectChar attribute="Symbol" context="#stay" char="]" />
122
144
                </context>
123
145
        </contexts>
124
146