Warning, /frameworks/syntax-highlighting/data/syntax/roff.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 roffidc "[^]\s]">
0005   <!ENTITY roffid  "(?:&roffidc;|\(&roffidc;{2}|\[&roffidc;+\])">
0006   <!ENTITY roffnum "([0-9]+)">
0007   <!ENTITY argsep1 "([^\\]|\\[&#37; |\^{}'`\-!?@)/,&amp;:~0E_acdeprtu])">
0008   <!ENTITY argsep2 "([^\\0-9]|\\[&#37;:{}'`\-_!@/cep])">
0009 
0010   <!ENTITY font1 "\\[fF]&roffid;">
0011   <!ENTITY font2 "\\f([0-9]|\([0-9][0-9]|\[[0-9]+\])">
0012   <!ENTITY font3 "\\s(\[([1-3][0-9]|[04-9])\]|[04-9]|[+-][0-9]|([+-]?\(|\([+-])[0-9][0-9])">
0013 
0014   <!ENTITY escape1 "\\(\$[0-9*@]|[.:&#37; |^{}_!?@)/,&amp;:~0acdeEprtu])">
0015   <!ENTITY escape2 "\\[gkmMVYz]&roffid;">
0016   <!ENTITY escape3 "\\O([0-4]|\[5[lrci][^]]\])">
0017 ]>
0018 <language name="Roff" section="Markup" version="9" kateversion="5.0" extensions="" author="Matthew Woehlke (mw_triad@users.sourceforge.net)" license="GPL">
0019 
0020   <highlighting>
0021 
0022     <list name="layout">
0023       <item>br</item>
0024       <item>sp</item>
0025     </list>
0026 
0027     <list name="formatting">
0028     </list>
0029 
0030     <list name="gnuext">
0031     </list>
0032 
0033     <contexts>
0034 
0035       <!-- root context -->
0036       <context name="Normal" attribute="Normal Text" lineEndContext="#stay">
0037         <IncludeRules context="DetectComments"/>
0038         <DetectChar attribute="Other Macros" context="DetectDirective" char="." column="0"/>
0039         <IncludeRules context="DetectOthers"/>
0040       </context>
0041 
0042       <context name="DetectComments" attribute="Normal Text" lineEndContext="#stay">
0043         <RegExpr attribute="Comment" context="Comment" String="^\.\s*\\&quot;" column="0"/>
0044         <Detect2Chars attribute="Comment" context="Comment" char="\" char1="&quot;"/>
0045         <Detect2Chars attribute="Comment" context="Comment" char="\" char1="#"/>
0046       </context>
0047 
0048       <!-- catch glyphc, registers, strings, etc -->
0049       <context name="DetectOthers" attribute="Normal Text" lineEndContext="#stay">
0050         <IncludeRules context="DetectComments"/>
0051         <DetectChar attribute="Escape" context="DetectEscape" char="\" lookAhead="true"/>
0052         <DetectChar attribute="String" context="String" char="&quot;"/>
0053       </context>
0054 
0055       <!-- detect escapes -->
0056       <context name="DetectEscape" attribute="Error" lineEndContext="#pop">
0057         <RegExpr attribute="Register" context="#pop" String="\\(\*|n[+-]?)&roffid;"/>
0058         <RegExpr attribute="Font" context="#pop" String="&font1;|&font2;|&font3;"/>
0059         <Detect2Chars attribute="Escape" context="#pop" char="\" char1="\"/>
0060         <RegExpr attribute="Escape" context="Argument" String="\\[ABDXZbow]&argsep1;"/>
0061         <RegExpr attribute="Escape" context="#pop" String="&escape1;|&escape2;|&escape3;"/>
0062         <RegExpr attribute="Escape" context="Measurement" String="(?|\\[hHSvx]&argsep1;|\\[lL]&argsep1;\|?)"/> <!-- TODO - optional trailing &glyph; -->
0063         <RegExpr attribute="Escape" context="Argument" String="\\R&argsep1;"/> <!-- TODO - &roffid; (register), measurement -->
0064         <RegExpr attribute="Glyph" context="GlyphArgument" String="\\C&argsep1;"/>
0065         <RegExpr attribute="Glyph" context="#pop" String="\\N&argsep2;[0-9]+\1|\\&roffid;"/>
0066         <LineContinue attribute="Escape" context="#pop" char="\"/>
0067         <DetectChar attribute="Error" context="#pop" char="\"/>
0068       </context>
0069 
0070       <!-- directive start -->
0071       <context name="DetectDirective" attribute="Other Macros" lineEndContext="#pop">
0072         <keyword attribute="Layout Macros" context="Directive" String="layout"/>
0073         <keyword attribute="Format Macros" context="Directive" String="formatting"/>
0074         <keyword attribute="GNU Macros" context="Directive" String="gnuext"/>
0075         <RegExpr attribute="Other Macros" context="dsDirective" String="\s*ds\b" column="1"/>
0076         <RegExpr attribute="Other Macros" context="deDirective" String="\s*de\b" column="1" beginRegion="de"/>
0077         <RegExpr attribute="Other Macros" context="daDirective" String="\s*da(?=\s+[A-Za-z]+)" column="1" beginRegion="di"/>
0078         <RegExpr attribute="Other Macros" context="diDirective" String="\s*di(?=\s+[A-Za-z]+)" column="1" beginRegion="di"/>
0079         <RegExpr attribute="Other Macros" context="Directive" String="\s*[A-Za-z]+\b" column="1"/>
0080       </context>
0081 
0082       <!-- comment -->
0083       <context name="Comment" attribute="Comment" lineEndContext="#pop">
0084         <DetectSpaces />
0085         <IncludeRules context="##Comments"/>
0086         <DetectIdentifier />
0087       </context>
0088 
0089       <!-- error -->
0090       <context name="Error" attribute="Error" lineEndContext="#stay"/>
0091 
0092       <!-- generic directive -->
0093       <context name="Directive" attribute="Identifier" lineEndContext="#pop">
0094         <Float attribute="Number" context="#stay"/>
0095         <Int attribute="Number" context="#stay"/>
0096         <IncludeRules context="DetectOthers"/>
0097       </context>
0098 
0099       <!-- quoted string -->
0100       <context name="String" attribute="String" lineEndContext="#pop">
0101         <Detect2Chars attribute="Escape" context="#stay" char="\" char1="&quot;"/>
0102         <DetectChar attribute="String" context="#pop" char="&quot;"/>
0103         <IncludeRules context="DetectOthers"/>
0104       </context>
0105 
0106       <!-- \!, \? escapes -->
0107       <context name="LiteralSL" attribute="Normal Text" lineEndContext="#pop"/>
0108       <context name="LiteralIL" attribute="Normal Text" lineEndContext="Error">
0109         <Detect2Chars attribute="Escape" context="#stay" char="\" char1="\"/>
0110         <Detect2Chars attribute="Escape" context="#pop" char="\" char1="?"/>
0111       </context>
0112 
0113       <!-- escape argument -->
0114       <context name="Argument" attribute="String" lineEndContext="Error" dynamic="true">
0115         <StringDetect attribute="Escape" context="#pop#pop" String="%1" dynamic="true"/>
0116         <IncludeRules context="DetectOthers"/>
0117       </context>
0118 
0119       <!-- glyph escape argument -->
0120       <context name="GlyphArgument" attribute="Glyph" lineEndContext="Error" dynamic="true">
0121         <StringDetect attribute="Glyph" context="#pop#pop" String="%1" dynamic="true"/>
0122       </context>
0123 
0124       <!-- measurement (or expression) escape argument -->
0125       <context name="Measurement" attribute="Error" lineEndContext="Error" dynamic="true">
0126         <StringDetect attribute="Escape" context="#pop#pop" String="%1" dynamic="true"/>
0127         <!-- TODO -->
0128       </context>
0129 
0130       <!-- .de directive -->
0131       <context name="deDirective" attribute="Identifier" lineEndContext="deBody"/>
0132       <context name="deBody" attribute="Normal Text" lineEndContext="#stay">
0133         <Detect2Chars attribute="Other Macros" context="#pop#pop" char="." char1="." column="0" endRegion="de"/>
0134         <IncludeRules context="Normal"/>
0135       </context>
0136 
0137       <!-- .di directives -->
0138       <context name="diDirective" attribute="Identifier" lineEndContext="diBody"/>
0139       <context name="diBody" attribute="Normal Text" lineEndContext="#stay">
0140         <RegExpr attribute="Other Macros" context="#pop#pop" String="^\.\s*di\b" column="0" endRegion="di"/>
0141         <Detect2Chars attribute="Escape" context="LiteralSL" char="\" char1="!"/>
0142         <Detect2Chars attribute="Escape" context="LiteralIL" char="\" char1="?"/>
0143         <IncludeRules context="Normal"/>
0144       </context>
0145 
0146       <!-- .da directives -->
0147       <context name="daDirective" attribute="Identifier" lineEndContext="daBody"/>
0148       <context name="daBody" attribute="Normal Text" lineEndContext="#stay">
0149         <RegExpr attribute="Other Macros" context="#pop#pop" String="^\.\s*da\b" column="0" endRegion="di"/>
0150         <Detect2Chars attribute="Escape" context="LiteralSL" char="\" char1="!"/>
0151         <Detect2Chars attribute="Escape" context="LiteralIL" char="\" char1="?"/>
0152         <IncludeRules context="Normal"/>
0153       </context>
0154 
0155       <!-- .ds directive -->
0156       <context name="dsDirective" attribute="Identifier" lineEndContext="#pop">
0157         <Float attribute="Number" context="#stay"/>
0158         <Int attribute="Number" context="#stay"/>
0159         <DetectChar attribute="String" context="dsString" char="&quot;"/>
0160         <IncludeRules context="DetectOthers"/>
0161       </context>
0162 
0163       <!-- .ds quoted value -->
0164       <context name="dsString" attribute="String" lineEndContext="#pop">
0165         <IncludeRules context="DetectOthers"/>
0166       </context>
0167 
0168     </contexts>
0169 
0170     <itemDatas>
0171       <itemData name="Normal Text"    defStyleNum="dsNormal"/>
0172       <itemData name="Comment"        defStyleNum="dsComment"/>
0173       <itemData name="Layout Macros"  defStyleNum="dsKeyword"/>
0174       <itemData name="Format Macros"  defStyleNum="dsKeyword"/>
0175       <itemData name="GNU Macros"     defStyleNum="dsDataType"/>
0176       <itemData name="Other Macros"   defStyleNum="dsFunction"/>
0177       <itemData name="Identifier"     defStyleNum="dsString"/>
0178       <itemData name="Number"         defStyleNum="dsDecVal"/>
0179       <itemData name="Register"       defStyleNum="dsOthers"/>
0180       <itemData name="Font"           defStyleNum="dsOthers"/>
0181       <itemData name="Glyph"          defStyleNum="dsOthers"/>
0182       <itemData name="Escape"         defStyleNum="dsChar"/>
0183       <itemData name="String"         defStyleNum="dsString"/>
0184       <itemData name="Error"          defStyleNum="dsError"/>
0185     </itemDatas>
0186 
0187   </highlighting>
0188 
0189   <general>
0190 
0191     <comments>
0192       <comment name="singleLine" start=".\&quot;" />
0193     </comments>
0194 
0195     <keywords casesensitive="1"/>
0196 
0197   </general>
0198 
0199 </language>
0200 <!-- kate: replace-tabs on; tab-width 2; indent-width 2; -->