forked from sgrif/diesel.rs-website
-
Notifications
You must be signed in to change notification settings - Fork 0
/
toml.xml
133 lines (130 loc) · 6.67 KB
/
toml.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language SYSTEM "language.dtd"
[
<!ENTITY more "(_\d+)*">
<!ENTITY int "[+-]?(0|[1-9]\d*)&more;">
<!ENTITY frac "\.\d+&more;">
<!ENTITY exp "[eE][+-]?\d+&more;">
<!ENTITY offset "[+-]\d\d:\d\d">
<!ENTITY time "\d\d:\d\d:\d\d(\.\d+)?(&offset;|Z)?">
<!ENTITY datetime "\d\d\d\d-\d\d-\d\d(T&time;)?">
]>
<!-- https://github.com/toml-lang/toml -->
<language name="TOML" section="Configuration" extensions="*.toml" mimetype="text/x-toml" version="8" kateversion="5.0" author="flying-sheep@web.de" license="LGPLv2+">
<highlighting>
<list name="bools">
<item>true</item>
<item>false</item>
</list>
<contexts>
<context attribute="Error" lineEndContext="#stay" name="Toml">
<DetectSpaces attribute="Whitespace"/>
<Detect2Chars attribute="TableHeader" context="NestedTableHeader" char="[" char1="[" endRegion="Table"/>
<DetectChar attribute="TableHeader" context="TableHeader" char="[" endRegion="Table"/>
<RegExpr attribute="Key" context="#stay" String="[\w-]+" firstNonSpace="true"/>
<DetectChar attribute="Key" context="QuotedKey" char=""" firstNonSpace="true"/>
<DetectChar attribute="Assignment" context="Value" char="="/>
<DetectChar char="#" attribute="Comment" context="Comment"/>
</context>
<!-- table headers -->
<context attribute="TableHeader" fallthrough="true" fallthroughContext="#pop" lineEndContext="#pop" name="TableHeader">
<IncludeRules context="TableHeaderCommon"/>
<DetectChar attribute="TableHeader" context="#pop" char="]" beginRegion="Table"/>
</context>
<context attribute="TableHeader" fallthrough="true" fallthroughContext="#pop" lineEndContext="#pop" name="NestedTableHeader">
<IncludeRules context="TableHeaderCommon"/>
<Detect2Chars attribute="TableHeader" context="#pop" char="]" char1="]" beginRegion="Table"/>
</context>
<context attribute="TableHeader" lineEndContext="#pop" name="TableHeaderCommon">
<DetectSpaces attribute="Whitespace"/>
<DetectChar attribute="TableHeader" context="#stay" char="."/>
<RegExpr attribute="Key" context="#stay" String="[\w-]+"/>
<DetectChar attribute="Key" context="QuotedKey" char="""/>
</context>
<!-- values -->
<context attribute="Normal Text" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop" name="Value">
<DetectSpaces attribute="Whitespace"/>
<RegExpr attribute="Date" context="#stay" String="&datetime;"/>
<keyword attribute="Bool" String="bools" context="#stay"/>
<RegExpr attribute="Float" context="#stay" String="∫(&frac;&exp;|&frac;|&exp;)"/>
<RegExpr attribute="Int" context="#stay" String="∫"/>
<StringDetect attribute="String" context="MultilineString" String="""""/>
<DetectChar attribute="String" context="String" char="""/>
<StringDetect attribute="String" context="LitMultilineString" String="'''"/>
<DetectChar attribute="String" context="LitString" char="'"/>
<DetectChar attribute="Array" context="Array" char="["/>
<DetectChar attribute="InlineTable" context="InlineTable" char="{"/>
<DetectChar char="#" attribute="Comment" context="Comment"/>
</context>
<context attribute="Comment" lineEndContext="#pop" name="Comment">
<DetectSpaces/>
<RegExpr attribute="Comment" String="^#" context="#stay" />
<DetectIdentifier/>
</context>
<!-- Quoted keys and Strings -->
<context attribute="Key" lineEndContext="#pop" name="QuotedKey">
<LineContinue attribute="Escape" context="#stay"/>
<RegExpr attribute="Escape" String="\\[btnfr"\\]|\\(u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})" context="#stay" />
<RegExpr attribute="Error" String="\\." context="#stay" />
<DetectChar attribute="Key" context="#pop" char="""/>
</context>
<context attribute="String" lineEndContext="#pop" name="String">
<LineContinue attribute="Escape" context="#stay"/>
<RegExpr attribute="Escape" String="\\[btnfr"\\]|\\(u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})" context="#stay" />
<RegExpr attribute="Error" String="\\." context="#stay" />
<DetectChar attribute="String" context="#pop" char="""/>
</context>
<context attribute="String" lineEndContext="#stay" name="MultilineString">
<LineContinue attribute="Escape" context="#stay"/>
<RegExpr attribute="Escape" String="\\[btnfr"\\]|\\(u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})" context="#stay" />
<RegExpr attribute="Error" String="\\." context="#stay" />
<StringDetect attribute="String" context="#pop" String="""""/>
</context>
<context attribute="LitString" lineEndContext="#pop" name="LitString">
<DetectChar attribute="String" context="#pop" char="'"/>
</context>
<context attribute="LitString" lineEndContext="#stay" name="LitMultilineString">
<StringDetect attribute="String" context="#pop" String="'''"/>
</context>
<!-- Arrays -->
<context attribute="Array" lineEndContext="#stay" name="Array">
<IncludeRules context="Value" />
<DetectChar context="#pop" attribute="Array" char="]" />
<DetectChar context="#stay" attribute="NextEntry" char="," />
</context>
<context attribute="InlineTable" lineEndContext="#stay" name="InlineTable">
<RegExpr attribute="Key" context="#stay" String="[\w-]+"/>
<DetectChar attribute="Key" context="QuotedKey" char="""/>
<DetectChar attribute="Assignment" context="Value" char="="/>
<DetectChar char="#" attribute="Comment" context="Comment"/>
<DetectChar context="#pop" attribute="InlineTable" char="}" />
<DetectChar context="#stay" attribute="NextEntry" char="," />
</context>
</contexts>
<itemDatas>
<itemData name="Normal Text" defStyleNum="dsNormal"/>
<itemData name="Key" defStyleNum="dsDataType"/>
<itemData name="TableHeader" defStyleNum="dsKeyword"/>
<itemData name="Assignment" defStyleNum="dsOperator"/>
<itemData name="Comment" defStyleNum="dsComment"/>
<itemData name="Date" defStyleNum="dsBaseN"/>
<itemData name="Float" defStyleNum="dsFloat"/>
<itemData name="Int" defStyleNum="dsDecVal"/>
<itemData name="Bool" defStyleNum="dsConstant"/>
<itemData name="String" defStyleNum="dsString"/>
<itemData name="LitString" defStyleNum="dsVerbatimString"/>
<itemData name="Escape" defStyleNum="dsSpecialChar"/>
<itemData name="Array" defStyleNum="dsOperator"/>
<itemData name="InlineTable" defStyleNum="dsOperator"/>
<itemData name="NextEntry" defStyleNum="dsOperator"/>
<itemData name="Whitespace" defStyleNum="dsNormal"/>
<itemData name="Error" defStyleNum="dsError"/>
</itemDatas>
</highlighting>
<general>
<comments>
<comment name="singleLine" start="#" position="afterwhitespace" />
</comments>
</general>
</language>
<!-- kate: replace-tabs off; -->