Changeset View
Changeset View
Standalone View
Standalone View
data/syntax/rdoc.xml
- This file was added.
1 | <?xml version="1.0" encoding="UTF-8"?> | ||||
---|---|---|---|---|---|
2 | <!DOCTYPE language SYSTEM "language.dtd"> | ||||
3 | <language name="R documentation" version="1" section="Markup" kateversion="5.0" | ||||
4 | extensions="*.Rd" author="Aaron Puchert" license="MIT" > | ||||
5 | <highlighting> | ||||
6 | <list name="PreprocessorOptions"> | ||||
7 | <item>unix</item> | ||||
8 | <item>windows</item> | ||||
9 | </list> | ||||
10 | <list name="Formats"> | ||||
11 | <item>example</item> | ||||
12 | <item>html</item> | ||||
13 | <item>latex</item> | ||||
14 | <item>text</item> | ||||
15 | <item>TRUE</item> | ||||
16 | <item>FALSE</item> | ||||
17 | </list> | ||||
18 | | ||||
19 | <list name="TopLevel-ExpectLatex"> | ||||
20 | <item>\author</item> | ||||
21 | <item>\concept</item> | ||||
22 | <item>\description</item> | ||||
23 | <item>\details</item> | ||||
24 | <item>\docType</item> | ||||
25 | <item>\encoding</item> | ||||
26 | <item>\format</item> | ||||
27 | <item>\keyword</item> | ||||
28 | <item>\name</item> | ||||
29 | <item>\note</item> | ||||
30 | <item>\references</item> | ||||
31 | <item>\seealso</item> | ||||
32 | <item>\source</item> | ||||
33 | <item>\title</item> | ||||
34 | </list> | ||||
35 | <list name="TopLevel-ExpectNameLatex"> | ||||
36 | <item>\section</item> | ||||
37 | </list> | ||||
38 | <list name="TopLevel-ExpectMacroLatex"> | ||||
39 | <item>\newcommand</item> | ||||
40 | <item>\renewcommand</item> | ||||
41 | </list> | ||||
42 | <list name="TopLevel-ExpectRLike"> | ||||
43 | <item>\examples</item> | ||||
44 | <item>\usage</item> | ||||
45 | </list> | ||||
46 | <list name="TopLevel-ExpectVerbatim"> | ||||
47 | <item>\alias</item> | ||||
48 | <item>\Rdversion</item> | ||||
49 | <item>\synopsis</item> | ||||
50 | <item>\RdOpts</item> | ||||
51 | </list> | ||||
52 | <list name="TopLevel-ExpectItem2List"> | ||||
53 | <item>\arguments</item> | ||||
54 | <item>\value</item> | ||||
55 | </list> | ||||
56 | | ||||
57 | <!-- For now we highlight these as macros. | ||||
58 | <list name="Latex-Markup"> | ||||
59 | <item>\cr</item> | ||||
60 | <item>\dots</item> | ||||
61 | <item>\ldots</item> | ||||
62 | <item>\R</item> | ||||
63 | <item>\tab</item> | ||||
64 | </list> | ||||
65 | --> | ||||
66 | <list name="Latex-ExpectLatex"> | ||||
67 | <item>\acronym</item> | ||||
68 | <item>\bold</item> | ||||
69 | <item>\cite</item> | ||||
70 | <item>\command</item> | ||||
71 | <item>\dfn</item> | ||||
72 | <item>\dQuote</item> | ||||
73 | <item>\email</item> | ||||
74 | <item>\emph</item> | ||||
75 | <item>\file</item> | ||||
76 | <item>\linkS4class</item> | ||||
77 | <item>\pkg</item> | ||||
78 | <item>\sQuote</item> | ||||
79 | <item>\strong</item> | ||||
80 | <item>\var</item> | ||||
81 | </list> | ||||
82 | <list name="Latex-ExpectNameLatex"> | ||||
83 | <item>\enc</item> | ||||
84 | <item>\method</item> | ||||
85 | <item>\S3method</item> | ||||
86 | <item>\S4method</item> | ||||
87 | </list> | ||||
88 | <list name="Latex-ExpectNameLatex-Section"> | ||||
89 | <item>\subsection</item> | ||||
90 | </list> | ||||
91 | <list name="Latex-ExpectMacroLatex"> | ||||
92 | <item>\newcommand</item> | ||||
93 | <item>\renewcommand</item> | ||||
94 | </list> | ||||
95 | <list name="Latex-ExpectItemList"> | ||||
96 | <item>\enumerate</item> | ||||
97 | <item>\itemize</item> | ||||
98 | </list> | ||||
99 | <list name="Latex-ExpectItem2List"> | ||||
100 | <item>\describe</item> | ||||
101 | </list> | ||||
102 | <list name="Latex-ExpectIf"> | ||||
103 | <item>\if</item> | ||||
104 | <item>\ifelse</item> | ||||
105 | </list> | ||||
106 | <list name="Latex-ExpectRLike"> | ||||
107 | <item>\code</item> | ||||
108 | <item>\dontshow</item> | ||||
109 | <item>\donttest</item> | ||||
110 | <item>\testonly</item> | ||||
111 | </list> | ||||
112 | <list name="Latex-ExpectVerbatim"> | ||||
113 | <item>\dontrun</item> | ||||
114 | <item>\env</item> | ||||
115 | <item>\kbd</item> | ||||
116 | <item>\option</item> | ||||
117 | <item>\out</item> | ||||
118 | <item>\preformatted</item> | ||||
119 | <item>\samp</item> | ||||
120 | <item>\special</item> | ||||
121 | <item>\url</item> | ||||
122 | <item>\deqn</item> | ||||
123 | <item>\eqn</item> | ||||
124 | </list> | ||||
125 | <list name="Latex-ExpectVerbatimLatex"> | ||||
126 | <item>\tabular</item> | ||||
127 | <item>\href</item> | ||||
128 | </list> | ||||
129 | <list name="Latex-ExpectOptionLatex"> | ||||
130 | <item>\link</item> | ||||
131 | </list> | ||||
132 | <list name="Latex-ExpectOptionRLike"> | ||||
133 | <item>\Sexpr</item> | ||||
134 | </list> | ||||
135 | | ||||
136 | <contexts> | ||||
137 | <context name="TopLevel" attribute="NormalText" lineEndContext="#stay"> | ||||
138 | <IncludeRules context="Common"/> | ||||
139 | | ||||
140 | <keyword String="TopLevel-ExpectLatex" attribute="Section" context="ExpectLatex"/> | ||||
141 | <keyword String="TopLevel-ExpectNameLatex" attribute="Section" context="ExpectNameLatex"/> | ||||
142 | <keyword String="TopLevel-ExpectMacroLatex" attribute="Markup" context="ExpectMacroLatex"/> | ||||
143 | <keyword String="TopLevel-ExpectRLike" attribute="Section" context="ExpectRLike"/> | ||||
144 | <keyword String="TopLevel-ExpectVerbatim" attribute="Section" context="ExpectVerbatim"/> | ||||
145 | <keyword String="TopLevel-ExpectItem2List" attribute="Section" context="ExpectItem2List"/> | ||||
146 | </context> | ||||
147 | | ||||
148 | <!-- Common rules: only included in other contexts --> | ||||
149 | <context name="Common" attribute="NormalText" lineEndContext="#stay"> | ||||
150 | <DetectSpaces/> | ||||
151 | <DetectChar char="%" attribute="Comment" context="Comment"/> | ||||
152 | | ||||
153 | <Detect2Chars char="\" char1="\" attribute="Escape"/> | ||||
154 | <Detect2Chars char="\" char1="%" attribute="Escape"/> | ||||
155 | <Detect2Chars char="\" char1="{" attribute="Escape"/> | ||||
156 | <Detect2Chars char="\" char1="}" attribute="Escape"/> | ||||
157 | | ||||
158 | <StringDetect String="#ifdef" firstNonSpace="true" attribute="Preprocessor" | ||||
159 | context="PreprocessorCondition" beginRegion="Preprocessor"/> | ||||
160 | <StringDetect String="#ifndef" firstNonSpace="true" attribute="Preprocessor" | ||||
161 | context="PreprocessorCondition" beginRegion="Preprocessor"/> | ||||
162 | <StringDetect String="#endif" firstNonSpace="true" attribute="Preprocessor" | ||||
163 | context="Comment" endRegion="Preprocessor"/> | ||||
164 | </context> | ||||
165 | | ||||
166 | <!-- Contexts where we expect certain arguments --> | ||||
167 | <context name="ExpectLatex" attribute="NormalText" lineEndContext="#stay"> | ||||
168 | <DetectChar char="{" attribute="Brace" context="#pop!Latex" beginRegion="Brace"/> | ||||
169 | <RegExpr String="[^ {]*" attribute="Error"/> | ||||
170 | </context> | ||||
171 | <context name="ExpectItemList" attribute="NormalText" lineEndContext="#stay"> | ||||
172 | <DetectChar char="{" attribute="Brace" context="#pop!ItemList" beginRegion="Brace"/> | ||||
173 | <RegExpr String="[^ {]*" attribute="Error"/> | ||||
174 | </context> | ||||
175 | <context name="ExpectItem2List" attribute="NormalText" lineEndContext="#stay"> | ||||
176 | <DetectChar char="{" attribute="Brace" context="#pop!Item2List" beginRegion="Brace"/> | ||||
177 | <RegExpr String="[^ {]*" attribute="Error"/> | ||||
178 | </context> | ||||
179 | <context name="ExpectNameLatex" attribute="NormalText" lineEndContext="#stay"> | ||||
180 | <DetectChar char="{" attribute="Brace" context="#pop!NameLatex" beginRegion="Brace"/> | ||||
181 | <RegExpr String="[^ {]*" attribute="Error"/> | ||||
182 | </context> | ||||
183 | <context name="ExpectMacroLatex" attribute="NormalText" lineEndContext="#stay"> | ||||
184 | <DetectChar char="{" attribute="Brace" context="#pop!MacroLatex" beginRegion="Brace"/> | ||||
185 | <RegExpr String="[^ {]*" attribute="Error"/> | ||||
186 | </context> | ||||
187 | <context name="ExpectRLike" attribute="NormalText" lineEndContext="#stay"> | ||||
188 | <DetectChar char="{" attribute="Brace" context="#pop!RLike" beginRegion="Brace"/> | ||||
189 | <RegExpr String="[^ {]*" attribute="Error"/> | ||||
190 | </context> | ||||
191 | <context name="ExpectVerbatim" attribute="NormalText" lineEndContext="#stay"> | ||||
192 | <DetectChar char="{" attribute="Brace" context="#pop!Verbatim" beginRegion="Brace"/> | ||||
193 | <RegExpr String="[^ {]*" attribute="Error"/> | ||||
194 | </context> | ||||
195 | <context name="ExpectVerbatimLatex" attribute="NormalText" lineEndContext="#stay"> | ||||
196 | <DetectChar char="{" attribute="Brace" context="#pop!VerbatimLatex" beginRegion="Brace"/> | ||||
197 | <RegExpr String="[^ {]*" attribute="Error"/> | ||||
198 | </context> | ||||
199 | <context name="ExpectOptionLatex" attribute="Verbatim" lineEndContext="#stay"> | ||||
200 | <IncludeRules context="Common"/> | ||||
201 | <DetectChar char="{" attribute="Brace" context="#pop!Latex" beginRegion="Brace"/> | ||||
202 | <DetectChar char="[" attribute="Brace" context="#pop!OptionLatex" beginRegion="Bracket"/> | ||||
203 | <RegExpr String="[^ {[]*" attribute="Error"/> | ||||
204 | </context> | ||||
205 | <context name="ExpectOptionRLike" attribute="Verbatim" lineEndContext="#stay"> | ||||
206 | <IncludeRules context="Common"/> | ||||
207 | <DetectChar char="{" attribute="Brace" context="#pop!RLike" beginRegion="Brace"/> | ||||
208 | <DetectChar char="[" attribute="Brace" context="#pop!OptionRLike" beginRegion="Bracket"/> | ||||
209 | <RegExpr String="[^ {[]*" attribute="Error"/> | ||||
210 | </context> | ||||
211 | <context name="ExpectIf" attribute="NormalText" lineEndContext="#stay"> | ||||
212 | <IncludeRules context="Common"/> | ||||
213 | <DetectChar char="{" attribute="Brace" context="#pop!If" beginRegion="Brace"/> | ||||
214 | <RegExpr String="[^ {]*" attribute="Error"/> | ||||
215 | </context> | ||||
216 | | ||||
217 | <!-- The actual arguments --> | ||||
218 | <context name="Latex" attribute="NormalText" lineEndContext="#stay"> | ||||
219 | <IncludeRules context="Common"/> | ||||
220 | <DetectChar char="{" attribute="Brace" context="Latex" beginRegion="Brace"/> | ||||
221 | <DetectChar char="}" attribute="Brace" context="#pop" endRegion="Brace"/> | ||||
222 | | ||||
223 | <keyword String="Latex-ExpectLatex" attribute="Markup" context="ExpectLatex"/> | ||||
224 | <keyword String="Latex-ExpectNameLatex" attribute="Markup" context="ExpectNameLatex"/> | ||||
225 | <keyword String="Latex-ExpectNameLatex-Section" attribute="Section" context="ExpectNameLatex"/> | ||||
226 | <keyword String="Latex-ExpectMacroLatex" attribute="Markup" context="ExpectMacroLatex"/> | ||||
227 | <keyword String="Latex-ExpectItemList" attribute="Markup" context="ExpectItemList"/> | ||||
228 | <keyword String="Latex-ExpectItem2List" attribute="Markup" context="ExpectItem2List"/> | ||||
229 | <keyword String="Latex-ExpectIf" attribute="Markup" context="ExpectIf"/> | ||||
230 | <keyword String="Latex-ExpectRLike" attribute="Markup" context="ExpectRLike"/> | ||||
231 | <keyword String="Latex-ExpectVerbatim" attribute="Markup" context="ExpectVerbatim"/> | ||||
232 | <keyword String="Latex-ExpectVerbatimLatex" attribute="Markup" context="ExpectVerbatimLatex"/> | ||||
233 | <keyword String="Latex-ExpectOptionLatex" attribute="Markup" context="ExpectOptionLatex"/> | ||||
234 | <keyword String="Latex-ExpectOptionRLike" attribute="Markup" context="ExpectOptionRLike"/> | ||||
235 | | ||||
236 | <RegExpr String="\\[A-Za-z][A-Za-z0-9]*" attribute="UserDefinedMacro"/> | ||||
237 | <RegExpr String="#[1-9]" attribute="UserDefinedMacroArgument"/> | ||||
238 | </context> | ||||
239 | <context name="ItemList" attribute="NormalText" lineEndContext="#stay"> | ||||
240 | <IncludeRules context="Common"/> | ||||
241 | <DetectChar char="{" attribute="Brace" context="Item2List" beginRegion="Brace"/> | ||||
242 | <DetectChar char="}" attribute="Brace" context="#pop" endRegion="Brace"/> | ||||
243 | <StringDetect String="\item" attribute="Markup"/> | ||||
244 | </context> | ||||
245 | <context name="Item2List" attribute="NormalText" lineEndContext="#stay"> | ||||
246 | <IncludeRules context="Common"/> | ||||
247 | <DetectChar char="{" attribute="Brace" context="Item2List" beginRegion="Brace"/> | ||||
248 | <DetectChar char="}" attribute="Brace" context="#pop" endRegion="Brace"/> | ||||
249 | <StringDetect String="\item" attribute="Markup" context="ExpectNameLatex"/> | ||||
250 | </context> | ||||
251 | <context name="NameLatex" attribute="ItemName" lineEndContext="#stay"> | ||||
252 | <IncludeRules context="Common"/> | ||||
253 | <DetectChar char="{" attribute="Brace" context="Latex" beginRegion="Brace"/> | ||||
254 | <DetectChar char="}" attribute="Brace" context="#pop!ExpectLatex" endRegion="Brace"/> | ||||
255 | </context> | ||||
256 | <context name="MacroLatex" attribute="UserDefinedMacro" lineEndContext="#stay"> | ||||
257 | <IncludeRules context="Common"/> | ||||
258 | <DetectChar char="}" attribute="Brace" context="#pop!ExpectLatex" endRegion="Brace"/> | ||||
259 | </context> | ||||
260 | <context name="RLike" attribute="NormalText" lineEndContext="#stay"> | ||||
261 | <IncludeRules context="Common"/> | ||||
262 | <DetectChar char="}" attribute="Brace" context="#pop" endRegion="Brace"/> | ||||
263 | <StringDetect String="\var" attribute="Markup" context="ExpectLatex"/> | ||||
264 | <Detect2Chars char="\" char1="v" attribute="Markup" context="ExpectLatex"/> | ||||
265 | <StringDetect String="\link" attribute="Markup" context="ExpectOptionLatex"/> | ||||
266 | <Detect2Chars char="\" char1="l" attribute="Markup" context="ExpectOptionLatex"/> | ||||
267 | <IncludeRules context="level0##R Script"/> | ||||
268 | </context> | ||||
269 | <context name="Verbatim" attribute="Verbatim" lineEndContext="#stay"> | ||||
270 | <IncludeRules context="Common"/> | ||||
271 | <DetectChar char="{" attribute="Brace" context="Verbatim" beginRegion="Brace"/> | ||||
272 | <DetectChar char="}" attribute="Brace" context="#pop" endRegion="Brace"/> | ||||
273 | </context> | ||||
274 | <context name="VerbatimLatex" attribute="Verbatim" lineEndContext="#stay"> | ||||
275 | <IncludeRules context="Common"/> | ||||
276 | <DetectChar char="{" attribute="Brace" context="Verbatim" beginRegion="Brace"/> | ||||
277 | <DetectChar char="}" attribute="Brace" context="#pop!ExpectLatex" endRegion="Brace"/> | ||||
278 | </context> | ||||
279 | <context name="OptionLatex" attribute="Verbatim" lineEndContext="#stay"> | ||||
280 | <IncludeRules context="Common"/> | ||||
281 | <DetectChar char="{" attribute="Brace" context="Verbatim" beginRegion="Brace"/> | ||||
282 | <DetectChar char="]" attribute="Brace" context="#pop!ExpectLatex" endRegion="Bracket"/> | ||||
283 | </context> | ||||
284 | <context name="OptionRLike" attribute="Verbatim" lineEndContext="#stay"> | ||||
285 | <IncludeRules context="Common"/> | ||||
286 | <DetectChar char="{" attribute="Brace" context="Verbatim" beginRegion="Brace"/> | ||||
287 | <DetectChar char="]" attribute="Brace" context="#pop!ExpectRLike" endRegion="Bracket"/> | ||||
288 | </context> | ||||
289 | <context name="If" attribute="Verbatim" lineEndContext="#stay"> | ||||
290 | <IncludeRules context="Common"/> | ||||
291 | <keyword String="Formats" attribute="Builtin"/> | ||||
292 | <DetectChar char="}" attribute="Brace" context="#pop" endRegion="Brace"/> | ||||
293 | </context> | ||||
294 | | ||||
295 | <context name="Comment" attribute="Comment" lineEndContext="#pop"> | ||||
296 | <IncludeRules context="##Alerts"/> | ||||
297 | </context> | ||||
298 | | ||||
299 | <context name="PreprocessorCondition" attribute="Preprocessor" lineEndContext="#pop"> | ||||
300 | <keyword String="PreprocessorOptions" attribute="Builtin"/> | ||||
301 | </context> | ||||
302 | </contexts> | ||||
303 | | ||||
304 | <itemDatas> | ||||
305 | <itemData name="NormalText" defStyleNum="dsNormal"/> | ||||
306 | <itemData name="Brace" defStyleNum="dsOperator" spellChecking="false"/> | ||||
307 | <itemData name="Section" defStyleNum="dsControlFlow" spellChecking="false"/> | ||||
308 | <itemData name="Markup" defStyleNum="dsKeyword" spellChecking="false"/> | ||||
309 | <itemData name="UserDefinedMacro" defStyleNum="dsFunction" spellChecking="false"/> | ||||
310 | <itemData name="UserDefinedMacroArgument" defStyleNum="dsVariable" spellChecking="false"/> | ||||
311 | <itemData name="ItemName" defStyleNum="dsSpecialString"/> | ||||
312 | <itemData name="Escape" defStyleNum="dsSpecialChar" spellChecking="false"/> | ||||
313 | <itemData name="Preprocessor" defStyleNum="dsPreprocessor" spellChecking="false"/> | ||||
314 | <itemData name="Builtin" defStyleNum="dsBuiltIn" spellChecking="false"/> | ||||
315 | <itemData name="Verbatim" defStyleNum="dsVerbatimString" spellChecking="false"/> | ||||
316 | <itemData name="Comment" defStyleNum="dsComment"/> | ||||
317 | <itemData name="Error" defStyleNum="dsError"/> | ||||
318 | </itemDatas> | ||||
319 | </highlighting> | ||||
320 | <general> | ||||
321 | <keywords weakDeliminator="\" wordWrapDeliminator=",{}[]"/> | ||||
322 | <comments> | ||||
323 | <comment name="singleLine" start="%"/> | ||||
324 | </comments> | ||||
325 | </general> | ||||
326 | </language> |