Changeset View
Changeset View
Standalone View
Standalone View
autotests/input/syntax/d399388_dynamic_RegExpr.xml
- This file was added.
1 | <?xml version="1.0" encoding="UTF-8"?> | ||||
---|---|---|---|---|---|
2 | | ||||
3 | <!DOCTYPE language SYSTEM "language.dtd"> | ||||
4 | | ||||
5 | <language name="IncludeRules (Dynamic)" section="Other" extensions="*.dyInclRl;" mimetype="" version="1" kateversion="5.0" priority="100"> | ||||
6 | <highlighting> | ||||
7 | <contexts> | ||||
8 | <context name="normal" attribute="Normal" lineEndContext="#stay"> | ||||
9 | <DetectChar char="X" attribute="Operator" context="X"/> | ||||
10 | </context> | ||||
11 | | ||||
12 | <context name="X" attribute="Normal" lineEndContext="#stay"> | ||||
13 | <DetectChar char="{" attribute="Delimiter" context="X brace"/> | ||||
14 | <RegExpr String="(\S)" attribute="Delimiter" context="X char"/> | ||||
15 | </context> | ||||
16 | | ||||
17 | <context name="X brace" attribute="String" lineEndContext="#stay"> | ||||
18 | <!-- escape the context with a matching delimiter --> | ||||
19 | <DetectChar char="}" attribute="Delimiter" context="#pop#pop"/> | ||||
20 | <!-- inherit highlighting rules from "generic" delimiter context --> | ||||
21 | <IncludeRules context="X char"/> | ||||
22 | </context> | ||||
23 | | ||||
24 | <context name="X char" attribute="String" lineEndContext="#stay"> | ||||
25 | <!-- escape the context with a matching delimiter --> | ||||
26 | <RegExpr String="%1" dynamic="true" attribute="Delimiter" context="#pop#pop"/> | ||||
27 | <!-- highlight some random words --> | ||||
28 | <WordDetect String="other" insensitive="true" attribute="Other"/> | ||||
29 | </context> | ||||
30 | </contexts> | ||||
31 | | ||||
32 | <itemDatas> | ||||
33 | <itemData name="Normal" defStyleNum="dsNormal"/> | ||||
34 | <itemData name="Operator" defStyleNum="dsKeyword"/> | ||||
35 | <itemData name="Delimiter" defStyleNum="dsExtension"/> | ||||
36 | <itemData name="String" defStyleNum="dsString"/> | ||||
37 | <itemData name="Other" defStyleNum="dsImport"/> | ||||
38 | </itemDatas> | ||||
39 | </highlighting> | ||||
40 | </language> |