summaryrefslogtreecommitdiffstats
path: root/kate/data/rest.xml
diff options
context:
space:
mode:
Diffstat (limited to 'kate/data/rest.xml')
-rw-r--r--kate/data/rest.xml40
1 files changed, 38 insertions, 2 deletions
diff --git a/kate/data/rest.xml b/kate/data/rest.xml
index ad7900c41..2e6b55b0f 100644
--- a/kate/data/rest.xml
+++ b/kate/data/rest.xml
@@ -6,7 +6,7 @@
<!ENTITY SimpleReferenceNameChars "\w-_\.:\+">
]>
<!-- Copyright Matt Williams <matt@milliams.com> June 2010 -->
-<language name="reStructuredText" extensions="*.rst" section="Markup" mimetype="text/x-rst" version="1.02" kateversion="2.5" casesensitive="1">
+<language name="reStructuredText" extensions="*.rst" section="Markup" mimetype="text/x-rst" version="1.03" kateversion="2.5" casesensitive="1">
<highlighting>
@@ -21,24 +21,56 @@
<RegExpr attribute="FootnoteReference" context="#stay" String="&inlinestart;\[[^\s].*\]_&inlineend;" minimal="true"/>
<RegExpr attribute="HyperlinkRefOrInterpretedText" context="#stay" String="&inlinestart;`[^\s].*(`|`_)&inlineend;" minimal="true"/>
<RegExpr attribute="HyperlinkReference" context="#stay" String="\w+_(\s|$)" minimal="true"/>
+ <RegExpr attribute="Role" String=":[^:]+:" context="Role" />
<DetectChar attribute="Field" context="Field" firstNonSpace="true" char=":"/>
<RegExpr attribute="Footnote" context="#stay" String="^\s*\.\. \[(\d+|#|\*|#[&SimpleReferenceNameChars;]+)\]\s" minimal="true" firstNonSpace="true"/>
<RegExpr attribute="Citation" context="#stay" String="^\s*\.\. \[[&SimpleReferenceNameChars;]+\]\s" minimal="true" firstNonSpace="true"/>
<RegExpr attribute="HyperlinkTarget" context="#stay" String="^\s*(\.\. (__:|_[&SimpleReferenceNameChars; ]+:(\s|$))|__ )" minimal="true" firstNonSpace="true"/>
+ <RegExpr attribute="CMakeCode" String="\s*\.\. code-block::\s*cmake$" context="CMakeCodeBlock" />
+ <RegExpr attribute="CppCode" String="\s*\.\. code-block::\s*c\+\+" context="CppCodeBlock" />
<RegExpr attribute="Directive" context="#stay" String="^\s*\.\. [\w-_\.]+::(\s|$)" minimal="true" firstNonSpace="true"/>
+ <RegExpr attribute="Code" String="::$" context="CodeBlock" />
<RegExpr attribute="SubstitutionDefinition" context="#stay" String="^\s*\.\. \|[&SimpleReferenceNameChars; ]+\|\s+[&SimpleReferenceNameChars;]+::\s" minimal="true" firstNonSpace="true"/>
</context>
<context name="Field" attribute="Field" lineEndContext="#stay">
<DetectChar attribute="Field" context="#pop" char=":"/>
<Detect2Chars attribute="Field" context="#stay" char="\" char1=":"/>
</context>
+ <context name="HyperlinkRefOrInterpretedText" attribute="HyperlinkRefOrInterpretedText" lineEndContext="#pop">
+ <DetectChar attribute="HyperlinkRefOrInterpretedText" char="`" context="#pop" />
+ </context>
+ <context name="Role" attribute="Role" lineEndContext="#pop">
+ <RegExpr attribute="Keyword" String="\w+" context="#stay" />
+ <DetectChar attribute="HyperlinkRefOrInterpretedText" char="`" context="#pop!HyperlinkRefOrInterpretedText" />
+ </context>
+ <context name="CMakeCodeBlock" attribute="CMakeCode" lineEndContext="#stay">
+ <RegExpr attribute="CMakeCode" String="^\s" context="CMakeCode" />
+ </context>
+ <context name="CppCodeBlock" attribute="CppCode" lineEndContext="#stay">
+ <RegExpr attribute="CppCode" String="^\s" context="CppCode" />
+ </context>
+ <context name="CodeBlock" attribute="Code" lineEndContext="#stay">
+ <RegExpr attribute="Code" String="^\s" context="Code" />
+ </context>
+
+ <context name="CMakeCode" attribute="CMakeCode" lineEndContext="#stay">
+ <RegExpr attribute="Normal" String="^\S" lookAhead="true" context="#pop#pop" />
+ <IncludeRules context="##CMake" includeAttrib="true"/>
+ </context>
+ <context name="CppCode" attribute="CppCode" lineEndContext="#stay">
+ <RegExpr attribute="Normal" String="^\S" lookAhead="true" context="#pop#pop" />
+ <IncludeRules context="##C++" includeAttrib="true"/>
+ </context>
+ <context name="Code" attribute="Code" lineEndContext="#stay">
+ <RegExpr attribute="Normal" String="^\S" lookAhead="true" context="#pop#pop" />
+ </context>
</contexts>
<itemDatas>
<itemData name="Normal" defStyleNum="dsNormal" />
<itemData name="Bold" defStyleNum="dsNormal" bold="1" />
<itemData name="Italic" defStyleNum="dsNormal" italic="1" />
- <itemData name="InlineLiteral" defStyleNum="dsString" />
+ <itemData name="InlineLiteral" defStyleNum="dsDataType" />
<itemData name="SubstitutionReference" defStyleNum="dsFunction" />
<itemData name="InlineInternalTarget" defStyleNum="dsFunction" />
<itemData name="FootnoteReference" defStyleNum="dsOthers" />
@@ -51,6 +83,10 @@
<itemData name="HyperlinkTarget" defStyleNum="dsDataType" />
<itemData name="Directive" defStyleNum="dsDataType" />
<itemData name="SubstitutionDefinition" defStyleNum="dsDataType" />
+ <itemData name="Role" defStyleNum="dsNormal" bold="1" />
+ <itemData name="CMakeCode" defStyleNum="dsDataType" />
+ <itemData name="CppCode" defStyleNum="dsDataType" />
+ <itemData name="Code" defStyleNum="dsDataType" />
</itemDatas>
</highlighting>