Path: blob/main/src/resources/pandoc/syntax-definitions/r.xml
12926 views
<?xml version="1.0" encoding="UTF-8"?>1<!DOCTYPE language SYSTEM "language.dtd">2<!-- Kate 2.5 (KDE 3.5) highlighting module for R3based on an earlier version by E.L. Willighagen. Code folding code by Ben Goodrich4version 2.0: (c) 2006 Thomas Friedrichsmeier, Arne Henningsen, and the RKWard Team5license: GPL v26Kate : http://kate.kde.org/7R : http://www.r-project.org/8RKWard : http://rkward.kde.org/9-->10<language version="12" kateversion="5.0" name="R Script" section="Scientific" extensions="*.R;*.r;*.S;*.s;*.q" mimetype="" license="GPLv2">11<highlighting>1213<list name="controls">14<item>for</item>15<item>in</item>16<item>next</item>17<item>break</item>18<item>while</item>19<item>repeat</item>20<item>if</item>21<item>else</item>22<item>switch</item>23<item>function</item>24</list>25<list name="words">26<item>TRUE</item>27<item>FALSE</item>28<item>NULL</item>29<item>NA</item>30<item>NA_integer_</item>31<item>NA_real_</item>32<item>NA_complex_</item>33<item>NA_character_</item>34<item>Inf</item>35<item>NaN</item>36</list>3738<contexts>39<!-- This context is really only good for detecting unexpected closing braces '}'. Since opening braces go to ctx0 (and nesting in there), this context is only active on the base level -->40<context attribute="Normal Text" lineEndContext="#stay" name="level0">41<IncludeRules context="CommonRules"/>4243<AnyChar attribute="Error" context="#stay" String="})"/>44</context>4546<context attribute="Normal Text" lineEndContext="#stay" name="ctx0">47<IncludeRules context="CommonRules"/>4849<DetectChar attribute="Symbol" context="#pop" char="}" endRegion="Brace1" />50<DetectChar attribute="Error" context="#stay" char=")"/>51</context>5253<context attribute="Normal Text" lineEndContext="#stay" name="parenthesis">54<LineContinue attribute="Operator" context="#stay"/>55<DetectChar attribute="Symbol" context="#pop" char=")"/>5657<RegExpr attribute="Identifier" context="#stay" String="[a-zA-Z_\.][0-9a-zA-Z_\.]*[\s]*[:]?=(?=[^=]|$)"/>5859<IncludeRules context="CommonRules"/>60<DetectChar attribute="Error" context="#stay" char="}" />61</context>6263<context attribute="String" lineEndContext="#stay" name="string">64<DetectChar attribute="String" context="#pop" char="""/>65<HlCStringChar attribute="String Char" context="#stay"/>66</context>6768<context attribute="String" lineEndContext="#stay" name="string2">69<DetectChar attribute="String" context="#pop" char="'"/>70<HlCStringChar attribute="String Char" context="#stay"/>71</context>7273<context attribute="Identifier" lineEndContext="#stay" name="backquotedsymbol">74<DetectChar attribute="String" context="#pop" char="`"/>75<HlCStringChar attribute="String Char" context="#stay"/>76</context>7778<context attribute="Normal Text" lineEndContext="#stay" name="operator_rhs" fallthrough="true" fallthroughContext="#pop">79<!-- While there is nothing of interest, stay in the context -->80<DetectSpaces />81<IncludeRules context="FindComments"/>82<!-- Operators other than +, -, and ! directly after another operator are an error. -->83<Detect2Chars attribute="Error" context="#stay" char="!" char1="="/>84<AnyChar attribute="Error" context="#stay" String="*/<>=|&:^@$~"/>85</context>8687<context attribute="Normal Text" lineEndContext="#stay" name="FindComments">88<Detect2Chars attribute="Headline" context="Headline" char="#" char1="#"/>89<DetectChar attribute="Comment" context="Comment" char="#"/>90</context>91<context attribute="Headline" lineEndContext="#pop" name="Headline">92<DetectSpaces />93<IncludeRules context="##Comments" />94</context>95<context attribute="Comment" lineEndContext="#pop" name="Comment">96<DetectSpaces />97<IncludeRules context="##Comments" />98</context>99100<!-- This context is not really used, but contains the common rules -->101<context name="CommonRules" lineEndContext="#stay" attribute="Normal Text" >102<DetectSpaces />103<IncludeRules context="FindComments"/>104<DetectChar attribute="String" context="string" char="""/>105<DetectChar attribute="String" context="string2" char="'"/>106<DetectChar attribute="String" context="backquotedsymbol" char="`"/>107<keyword attribute="Control Structure" context="#stay" String="controls"/>108<keyword attribute="Reserved Words" context="#stay" String="words"/>109<Float attribute="Float" context="#stay"/>110<Int attribute="Int" context="#stay"/>111<RegExpr attribute="Keyword" context="#stay" String="[a-zA-Z_]+[a-zA-Z_\.0-9]*(?=[\s]*[(])|\.[a-zA-Z_\.]+[a-zA-Z_\.0-9]*(?=[\s]*[(])"/>112<DetectChar attribute="Symbol" context="parenthesis" char="("/>113114<!-- For (assignment) operators, enter a new context operator_rhs to check what follows (generally, that should not be another op) -->115<StringDetect attribute="Assign" context="operator_rhs" String="<<-"/>116<Detect2Chars attribute="Assign" context="operator_rhs" char="<" char1="-"/>117<StringDetect attribute="Assign" context="operator_rhs" String="->>"/>118<Detect2Chars attribute="Assign" context="operator_rhs" char="-" char1=">"/>119<RegExpr attribute="Assign" context="operator_rhs" String="=(?!(=|>))"/>120<Detect2Chars attribute="Operator" context="operator_rhs" char="*" char1="*"/>121<Detect2Chars attribute="Operator" context="operator_rhs" char="<" char1="="/>122<Detect2Chars attribute="Operator" context="operator_rhs" char=">" char1="="/>123<Detect2Chars attribute="Operator" context="operator_rhs" char="=" char1="="/>124<Detect2Chars attribute="Operator" context="operator_rhs" char="=" char1=">"/>125<Detect2Chars attribute="Operator" context="operator_rhs" char="!" char1="="/>126<Detect2Chars attribute="Operator" context="operator_rhs" char="|" char1=">"/>127<Detect2Chars attribute="Operator" context="operator_rhs" char="|" char1="|"/>128<Detect2Chars attribute="Operator" context="operator_rhs" char="&" char1="&"/>129<StringDetect attribute="Operator" context="operator_rhs" String=":::"/>130<Detect2Chars attribute="Operator" context="operator_rhs" char=":" char1=":"/>131<AnyChar attribute="Operator" context="operator_rhs" String="+-*/<>=!|&:^@$~"/>132<RangeDetect attribute="Operator" context="operator_rhs" char="%" char1="%"/>133134<DetectChar attribute="Symbol" context="ctx0" char="{" beginRegion="Brace1" />135136<!-- This is needed only to assist variable based indentation -->137<AnyChar attribute="Symbol" context="#stay" String="[]" />138</context>139</contexts>140141<itemDatas>142<itemData name="Normal Text" defStyleNum="dsNormal" spellChecking="false"/>143<itemData name="Symbol" defStyleNum="dsNormal" spellChecking="false"/>144<itemData name="Keyword" defStyleNum="dsFunction" spellChecking="false"/>145<itemData name="Identifier" defStyleNum="dsAttribute" spellChecking="false"/>146<itemData name="String" defStyleNum="dsString"/>147<itemData name="Headline" defStyleNum="dsDocumentation" bold="1"/>148<itemData name="Comment" defStyleNum="dsComment"/>149<itemData name="Assign" defStyleNum="dsOthers" bold="1" italic="0" spellChecking="false"/>150<itemData name="Control Structure" defStyleNum="dsControlFlow" spellChecking="false"/>151<itemData name="Reserved Words" defStyleNum="dsConstant" spellChecking="false"/>152<itemData name="Error" defStyleNum="dsError" spellChecking="false"/>153<itemData name="Operator" defStyleNum="dsSpecialChar" spellChecking="false"/>154<itemData name="String Char" defStyleNum="dsSpecialChar" spellChecking="false"/>155<itemData name="Float" defStyleNum="dsFloat" spellChecking="false"/>156<itemData name="Int" defStyleNum="dsDecVal" spellChecking="false"/>157</itemDatas>158</highlighting>159160<general>161<comments>162<comment name="singleLine" start="#"/>163</comments>164<keywords casesensitive="true" weakDeliminator="." additionalDeliminator="$"/>165</general>166</language>167<!-- kate: replace-tabs off; -->168169170