| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
<!DOCTYPE language |
| 3 |
[ |
| 4 |
<!ENTITY more "(_[0-9]++)*+"> |
| 5 |
<!ENTITY int "(0|[1-9][0-9]*+&more;)"> |
| 6 |
<!ENTITY frac "\.[0-9]+&more;"> |
| 7 |
<!ENTITY exp "[eE][+-]?[0-9]+&more;"> |
| 8 |
|
| 9 |
<!ENTITY offset "[+-][0-9][0-9]:[0-9][0-9]"> |
| 10 |
<!ENTITY time "[0-9][0-9]:[0-9][0-9]:[0-9][0-9](\.[0-9]+)?"> |
| 11 |
<!ENTITY datetime "[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]([T ]&time;(&offset;|Z)?)?|&time;"> |
| 12 |
]> |
| 13 |
<!-- https://github.com/toml-lang/toml --> |
| 14 |
<!-- https://toml.io/en/v1.0.0 --> |
| 15 |
<language |
| 16 |
name="TOML" |
| 17 |
section="Configuration" |
| 18 |
extensions="Cargo.lock;*.toml;*.rc;*.conf;*.cfg;*.cf;*.cnf;*.ini;mirrorlist" |
| 19 |
mimetype="text/x-toml;application/toml" |
| 20 |
version="13" |
| 21 |
kateversion="5.0" |
| 22 |
author="[email protected]" |
| 23 |
license="LGPLv2+" |
| 24 |
priority="-1" |
| 25 |
> |
| 26 |
<highlighting> |
| 27 |
<list name="bools"> |
| 28 |
<item>true</item> |
| 29 |
<item>false</item> |
| 30 |
</list> |
| 31 |
|
| 32 |
<contexts> |
| 33 |
<context attribute="Error" lineEndContext="#stay" name="Toml"> |
| 34 |
<DetectSpaces attribute="Whitespace"/> |
| 35 |
<Detect2Chars attribute="TableHeader" context="NestedTableHeader" char="[" char1="[" endRegion="Table"/> |
| 36 |
<DetectChar attribute="TableHeader" context="TableHeader" char="[" endRegion="Table"/> |
| 37 |
<DetectChar attribute="Assignment" context="Value" char="="/> |
| 38 |
<DetectChar char="#" attribute="Comment" context="Comment"/> |
| 39 |
<IncludeRules context="FindKey"/> |
| 40 |
</context> |
| 41 |
|
| 42 |
|
| 43 |
<context attribute="Key" lineEndContext="#stay" name="FindKey"> |
| 44 |
<DetectChar attribute="Key" char="."/> |
| 45 |
<RegExpr attribute="Key" context="#stay" String="[A-Za-z0-9_-]+"/> |
| 46 |
<DetectChar attribute="Key" context="QuotedKey" char="""/> |
| 47 |
<DetectChar attribute="Key" context="LitQuotedKey" char="'"/> |
| 48 |
</context> |
| 49 |
|
| 50 |
|
| 51 |
<!-- table headers --> |
| 52 |
<context attribute="TableHeader" fallthrough="true" fallthroughContext="#pop" lineEndContext="#pop" name="TableHeader"> |
| 53 |
<DetectChar attribute="TableHeader" context="#pop" char="]" beginRegion="Table"/> |
| 54 |
<IncludeRules context="TableHeaderCommon"/> |
| 55 |
</context> |
| 56 |
|
| 57 |
<context attribute="TableHeader" fallthrough="true" fallthroughContext="#pop" lineEndContext="#pop" name="NestedTableHeader"> |
| 58 |
<Detect2Chars attribute="TableHeader" context="#pop" char="]" char1="]" beginRegion="Table"/> |
| 59 |
<IncludeRules context="TableHeaderCommon"/> |
| 60 |
</context> |
| 61 |
|
| 62 |
<context attribute="TableHeader" lineEndContext="#pop" name="TableHeaderCommon"> |
| 63 |
<DetectSpaces attribute="Whitespace"/> |
| 64 |
<DetectChar attribute="TableHeader" char="."/> |
| 65 |
<RegExpr attribute="TableHeader" context="#stay" String="[A-Za-z0-9_-]+"/> |
| 66 |
<DetectChar attribute="TableHeader" context="QuotedKey" char="""/> |
| 67 |
<DetectChar attribute="TableHeader" context="LitQuotedKey" char="'"/> |
| 68 |
</context> |
| 69 |
|
| 70 |
|
| 71 |
<!-- values --> |
| 72 |
<context attribute="Error" lineEndContext="#pop" fallthrough="true" fallthroughContext="#pop" name="Value"> |
| 73 |
<DetectSpaces attribute="Whitespace"/> |
| 74 |
<WordDetect attribute="Boolean true" context="#pop" String="true"/> |
| 75 |
<WordDetect attribute="Boolean false" context="#pop" String="false"/> |
| 76 |
<StringDetect attribute="String" context="#pop!MultilineString" String="""""/> |
| 77 |
<DetectChar attribute="String" context="#pop!String" char="""/> |
| 78 |
<StringDetect attribute="String" context="#pop!LitMultilineString" String="'''"/> |
| 79 |
<DetectChar attribute="String" context="#pop!LitString" char="'"/> |
| 80 |
<DetectChar attribute="Array" context="#pop!Array" char="["/> |
| 81 |
<DetectChar attribute="InlineTable" context="#pop!InlineTable" char="{"/> |
| 82 |
<RegExpr attribute="Date" context="#pop" String="&datetime;"/> |
| 83 |
<RegExpr attribute="Int" context="#pop" String="[+-]?(0x[0-9a-fA-F]+(_[0-9a-fA-F]+)*|0o[0-7]+(_[0-7]+)*|0b[01]+(_[01]+)*|∫(?!(\.|[eE][+-]?)[0-9]))"/> |
| 84 |
<RegExpr attribute="Float" context="#pop" String="[+-]?(∫(&frac;(&exp;)?|&exp;)|inf|nan)"/> |
| 85 |
</context> |
| 86 |
|
| 87 |
<context attribute="Comment" lineEndContext="#pop" name="Comment"> |
| 88 |
<DetectSpaces/> |
| 89 |
<IncludeRules context="##Comments"/> |
| 90 |
<DetectIdentifier/> |
| 91 |
</context> |
| 92 |
|
| 93 |
|
| 94 |
<!-- Quoted keys and Strings--> |
| 95 |
<context attribute="Key" lineEndContext="#pop" name="QuotedKey"> |
| 96 |
<DetectChar attribute="Key" context="#pop" char="""/> |
| 97 |
<IncludeRules context="FindEscapedChar"/> |
| 98 |
</context> |
| 99 |
|
| 100 |
<context attribute="String" lineEndContext="#pop" name="String"> |
| 101 |
<DetectChar attribute="String" context="#pop" char="""/> |
| 102 |
<IncludeRules context="FindEscapedChar"/> |
| 103 |
</context> |
| 104 |
|
| 105 |
<context attribute="String" lineEndContext="#stay" name="MultilineString"> |
| 106 |
<StringDetect attribute="String" context="#pop" String="""""""/> |
| 107 |
<StringDetect attribute="String" context="#pop" String=""""""/> |
| 108 |
<StringDetect attribute="String" context="#pop" String="""""/> |
| 109 |
<LineContinue attribute="Escape" context="#stay"/> |
| 110 |
<IncludeRules context="FindEscapedChar"/> |
| 111 |
</context> |
| 112 |
|
| 113 |
<context attribute="String" lineEndContext="#pop" name="FindEscapedChar"> |
| 114 |
<RegExpr attribute="Escape" String="\\[btnfr"\\]|\\u[0-9a-fA-F]{4}|\\U[0-9a-fA-F]{8}" context="#stay"/> |
| 115 |
<RegExpr attribute="Error" String="\\[uU][0-9a-fA-F]*|\\." context="#stay"/> |
| 116 |
</context> |
| 117 |
|
| 118 |
<context attribute="Key" lineEndContext="#pop" name="LitQuotedKey"> |
| 119 |
<DetectChar attribute="Key" context="#pop" char="'"/> |
| 120 |
</context> |
| 121 |
|
| 122 |
<context attribute="LitString" lineEndContext="#pop" name="LitString"> |
| 123 |
<DetectChar attribute="String" context="#pop" char="'"/> |
| 124 |
</context> |
| 125 |
|
| 126 |
<context attribute="LitString" lineEndContext="#stay" name="LitMultilineString"> |
| 127 |
<StringDetect attribute="String" context="#pop" String="'''''"/> |
| 128 |
<StringDetect attribute="String" context="#pop" String="''''"/> |
| 129 |
<StringDetect attribute="String" context="#pop" String="'''"/> |
| 130 |
</context> |
| 131 |
|
| 132 |
|
| 133 |
<!-- Arrays --> |
| 134 |
<context attribute="Array" lineEndContext="#stay" name="Array" fallthrough="true" fallthroughContext="InArray"> |
| 135 |
<DetectSpaces attribute="Whitespace"/> |
| 136 |
<DetectChar context="#pop" attribute="Array" char="]"/> |
| 137 |
<DetectChar attribute="Comment" context="Comment" char="#"/> |
| 138 |
<DetectChar context="InArray" attribute="NextEntry" char=","/> |
| 139 |
</context> |
| 140 |
<context attribute="Error" lineEndContext="#stay" name="InArray"> |
| 141 |
<DetectChar context="#pop#pop" attribute="Array" char="]"/> |
| 142 |
<DetectChar context="#stay" attribute="Error" char=","/> |
| 143 |
<DetectChar attribute="Comment" context="Comment" char="#"/> |
| 144 |
<IncludeRules context="Value"/> |
| 145 |
</context> |
| 146 |
|
| 147 |
<context attribute="InlineTable" lineEndContext="#stay" name="InlineTable"> |
| 148 |
<DetectChar attribute="Assignment" context="Value" char="="/> |
| 149 |
<DetectChar char="#" attribute="Comment" context="Comment"/> |
| 150 |
<DetectChar context="#pop" attribute="InlineTable" char="}"/> |
| 151 |
<DetectChar context="#stay" attribute="NextEntry" char=","/> |
| 152 |
<IncludeRules context="FindKey"/> |
| 153 |
</context> |
| 154 |
|
| 155 |
</contexts> |
| 156 |
<itemDatas> |
| 157 |
<itemData name="Whitespace" defStyleNum="dsNormal"/> |
| 158 |
<itemData name="Key" defStyleNum="dsDataType"/> |
| 159 |
<itemData name="TableHeader" defStyleNum="dsKeyword"/> |
| 160 |
<itemData name="Assignment" defStyleNum="dsOperator"/> |
| 161 |
<itemData name="Comment" defStyleNum="dsComment"/> |
| 162 |
|
| 163 |
<itemData name="Date" defStyleNum="dsBaseN"/> |
| 164 |
<itemData name="Float" defStyleNum="dsFloat"/> |
| 165 |
<itemData name="Int" defStyleNum="dsDecVal"/> |
| 166 |
<itemData name="Boolean true" defStyleNum="dsConstant"/> |
| 167 |
<itemData name="Boolean false" defStyleNum="dsConstant"/> |
| 168 |
<itemData name="String" defStyleNum="dsString"/> |
| 169 |
<itemData name="LitString" defStyleNum="dsVerbatimString"/> |
| 170 |
<itemData name="Escape" defStyleNum="dsSpecialChar"/> |
| 171 |
<itemData name="Array" defStyleNum="dsOperator"/> |
| 172 |
<itemData name="InlineTable" defStyleNum="dsOperator"/> |
| 173 |
<itemData name="NextEntry" defStyleNum="dsOperator"/> |
| 174 |
|
| 175 |
<itemData name="Error" defStyleNum="dsError"/> |
| 176 |
</itemDatas> |
| 177 |
</highlighting> |
| 178 |
<general> |
| 179 |
<comments> |
| 180 |
<comment name="singleLine" start="#" position="afterwhitespace"/> |
| 181 |
</comments> |
| 182 |
</general> |
| 183 |
</language> |