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 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329
|
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE language [
<!ENTITY regexpr_identifier "([\w_-]+)">
<!ENTITY regexpr_variable "(@®expr_identifier;)">
<!ENTITY anychar_operator ":,!/*-+=><()%">
<!ENTITY regexpr_number "(\-?((\d+(\.\d+)?)|(\.\d+))%?)">
<!ENTITY regexpr_color "((#[\dabcdefABCDEF]{3}|#[\dabcdefABCDEF]{6})(?=(\W|$)))">
]>
<!-- Syntax highlighting definition for CartoCSS MSS, see https://github.com/mapbox/carto
CartoCSS defines two file formats: MML (Map Markup Language) and MSS (Map Stylesheet).
This file provides syntax highlighting for MSS. MSS is similar in syntax to CSS,
but completly different in its semantics. -->
<language name="CartoCSS MSS"
version="6"
kateversion="5.0"
section="Markup"
extensions="*.mss"
author="Lukas Sommer"
license="CC0 Public Domain Dedication, version 1.0, as published by Creative Commons">
<highlighting>
<list name="list_colornames">
<!-- This list is based on https://github.com/mapbox/carto/blob/35773a5f519b1ded0d88b14d53ac875cd610bb8c/build/vim-carto/syntax/carto.vim#L53
and https://github.com/mapbox/carto/blob/35773a5f519b1ded0d88b14d53ac875cd610bb8c/build/carto.tmbundle/Syntaxes/carto.tmLanguage#L279
-->
<item>aliceblue</item>
<item>antiquewhite</item>
<item>aqua</item>
<item>aquamarine</item>
<item>azure</item>
<item>beige</item>
<item>bisque</item>
<item>black</item>
<item>blanchedalmond</item>
<item>blue</item>
<item>blueviolet</item>
<item>brown</item>
<item>burlywood</item>
<item>cadetblue</item>
<item>chartreuse</item>
<item>chocolate</item>
<item>coral</item>
<item>cornflowerblue</item>
<item>cornsilk</item>
<item>crimson</item>
<item>cyan</item>
<item>darkblue</item>
<item>darkcyan</item>
<item>darkgoldenrod</item>
<item>darkgray</item>
<item>darkgreen</item>
<item>darkgrey</item>
<item>darkkhaki</item>
<item>darkmagenta</item>
<item>darkolivegreen</item>
<item>darkorange</item>
<item>darkorchid</item>
<item>darkred</item>
<item>darksalmon</item>
<item>darkseagreen</item>
<item>darkslateblue</item>
<item>darkslategrey</item>
<item>darkturquoise</item>
<item>darkviolet</item>
<item>deeppink</item>
<item>deepskyblue</item>
<item>dimgray</item>
<item>dimgrey</item>
<item>dodgerblue</item>
<item>firebrick</item>
<item>floralwhite</item>
<item>forestgreen</item>
<item>fuchsia</item>
<item>gainsboro</item>
<item>ghostwhite</item>
<item>gold</item>
<item>goldenrod</item>
<item>gray</item>
<item>grey</item>
<item>green</item>
<item>greenyellow</item>
<item>honeydew</item>
<item>hotpink</item>
<item>indianred</item>
<item>indigo</item>
<item>ivory</item>
<item>khaki</item>
<item>lavender</item>
<item>lavenderblush</item>
<item>lawngreen</item>
<item>lemonchiffon</item>
<item>lightblue</item>
<item>lightcoral</item>
<item>lightcyan</item>
<item>lightgoldenrodyellow</item>
<item>lightgray</item>
<item>lightgreen</item>
<item>lightgrey</item>
<item>lightpink</item>
<item>lightsalmon</item>
<item>lightseagreen</item>
<item>lightskyblue</item>
<item>lightslategray</item>
<item>lightslategrey</item>
<item>lightsteelblue</item>
<item>lightyellow</item>
<item>lime</item>
<item>limegreen</item>
<item>linen</item>
<item>magenta</item>
<item>maroon</item>
<item>mediumaquamarine</item>
<item>mediumblue</item>
<item>mediumorchid</item>
<item>mediumpurple</item>
<item>mediumseagreen</item>
<item>mediumslateblue</item>
<item>mediumspringgreen</item>
<item>mediumturquoise</item>
<item>mediumvioletred</item>
<item>midnightblue</item>
<item>mintcream</item>
<item>mistyrose</item>
<item>moccasin</item>
<item>navajowhite</item>
<item>navy</item>
<item>oldlace</item>
<item>olive</item>
<item>olivedrab</item>
<item>orange</item>
<item>orangered</item>
<item>orchid</item>
<item>palegoldenrod</item>
<item>palegreen</item>
<item>paleturquoise</item>
<item>palevioletred</item>
<item>papayawhip</item>
<item>peachpuff</item>
<item>peru</item>
<item>pink</item>
<item>plum</item>
<item>powderblue</item>
<item>purple</item>
<item>red</item>
<item>rosybrown</item>
<item>royalblue</item>
<item>saddlebrown</item>
<item>salmon</item>
<item>sandybrown</item>
<item>seagreen</item>
<item>seashell</item>
<item>sienna</item>
<item>silver</item>
<item>skyblue</item>
<item>slateblue</item>
<item>slategray</item>
<item>slategrey</item>
<item>snow</item>
<item>springgreen</item>
<item>steelblue</item>
<item>tan</item>
<item>teal</item>
<item>thistle</item>
<item>tomato</item>
<item>turquoise</item>
<item>violet</item>
<item>wheat</item>
<item>white</item>
<item>whitesmoke</item>
<item>yellow</item>
<item>yellowgreen</item>
<item>transparent</item>
</list>
<contexts>
<context attribute="Mapnik Symbolizer Parameter" lineEndContext="#stay" name="context_default">
<DetectSpaces/>
<Detect2Chars attribute="Comment" context="context_comment_multiline" char="/" char1="*" lookAhead="true" beginRegion="region_comment"/>
<Detect2Chars attribute="Comment" context="context_comment_singleline" char="/" char1="/" lookAhead="true"/>
<DetectChar attribute="Operator" char="{" beginRegion="region_braces"/>
<DetectChar attribute="Operator" char="}" endRegion="region_braces"/>
<DetectChar attribute="Operator" char="[" context="context_filter_attribute"/> <!-- This rule must be _before_ the “Operator” rule to make sure it is working. -->
<RegExpr attribute="Attachment" String="::®expr_identifier;"/> <!-- This rule must be _before_ the “Operator” rule to make sure it is working. -->
<DetectChar attribute="Operator" char=":" context="context_expression"/>
<RegExpr attribute="CartoCSS Variable" String="®expr_variable;"/>
<RegExpr attribute="Named instances" String="®expr_identifier;/"/>
<RegExpr attribute="Layer ID" String="#®expr_identifier;"/>
<RegExpr attribute="Class" String="\.®expr_identifier;"/>
</context>
<context attribute="Keyword" lineEndContext="#stay" name="context_expression">
<DetectSpaces/>
<RangeDetect char="[" char1="]" attribute="Data Field"/> <!-- This rule must be _before_ the “Operator” rule to make sure it is working. -->
<RegExpr attribute="Number" String="®expr_number;"/> <!-- This rule must be _before_ the “Operator” rule to make sure it is working. -->
<AnyChar attribute="Operator" String="&anychar_operator;[]"/>
<RegExpr attribute="CartoCSS Variable" String="®expr_variable;"/>
<RegExpr attribute="Function" String="®expr_identifier;(?=\()"/>
<RegExpr attribute="Color" String="®expr_color;"/>
<keyword attribute="Color" context="#stay" String="list_colornames"/>
<!-- The strings that might appear hear (both single-quoted and double-quoted strings)
are either normal strings or expression strings: If they are the only content
(like in “test: "mystring";”) than they are expression strings. If there is other
content (like in “test: "mystring" + [myfield];” or “test: [myfield] + "mystring";”),
than they are normal strings. This is however difficult to detect, therefore we default
simply to expression strings.-->
<DetectChar attribute="Expression String" char=""" context="context_expressionstring_doublequote"/>
<DetectChar attribute="Expression String" char="'" context="context_expressionstring_singlequote"/>
<!-- An expression ends with a semicolon “;”. However, the
CartoCSS parser allows to omit the semicolon at the end
of a block of curly braces “{}”. Therefore, we also
have to detect the closing curly braces “}” here: -->
<DetectChar attribute="Operator" char=";" context="#pop"/>
<DetectChar attribute="Operator" char="}" endRegion="region_braces" context="#pop"/>
</context>
<context attribute="Data Field" lineEndContext="#stay" name="context_filter_attribute">
<DetectSpaces/>
<RegExpr attribute="CartoCSS Variable" String="®expr_variable;"/>
<AnyChar attribute="Operator" String="&anychar_operator;" context="context_filter_rule"/>
<WordDetect String="zoom" insensitive="true" attribute="Keyword"/>
<DetectChar attribute="Data Field" char=""" context="context_filter_attribute_doublequote"/>
<DetectChar attribute="Data Field" char="'" context="context_filter_attribute_singlequote"/>
<DetectChar attribute="Operator" char="]" context="#pop"/>
</context>
<context attribute="Data Field" lineEndContext="#pop" name="context_filter_attribute_doublequote">
<DetectChar char=""" context="#pop"/>
</context>
<context attribute="Data Field" lineEndContext="#pop" name="context_filter_attribute_singlequote">
<DetectChar char="'" context="#pop"/>
</context>
<context attribute="Keyword" lineEndContext="#stay" name="context_filter_rule">
<DetectSpaces/>
<RegExpr attribute="Number" String="®expr_number;"/> <!-- This rule must be _before_ the “Operator” rule to make sure it is working. -->
<AnyChar attribute="Operator" String="&anychar_operator;"/>
<RegExpr attribute="CartoCSS Variable" String="®expr_variable;"/>
<WordDetect String="zoom" insensitive="true" attribute="Keyword"/>
<RegExpr attribute="Function" String="®expr_identifier;(?=\()"/>
<RegExpr attribute="Color" String="®expr_color;"/>
<keyword attribute="Color" context="#stay" String="list_colornames"/>
<DetectChar attribute="Normal String" char=""" context="context_normalstring_doublequote"/>
<DetectChar attribute="Normal String" char="'" context="context_normalstring_singlequote"/>
<DetectChar attribute="Operator" char="]" context="#pop#pop"/>
</context>
<context attribute="Comment" lineEndContext="#stay" name="context_comment_multiline">
<Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="region_comment"/>
<IncludeRules context="##Comments"/>
</context>
<context attribute="Comment" lineEndContext="#pop" name="context_comment_singleline">
<IncludeRules context="##Comments"/>
</context>
<context attribute="Expression String" lineEndContext="#pop" name="context_expressionstring_doublequote">
<DetectChar attribute="Expression String" char=""" context="#pop"/>
<RangeDetect char="[" char1="]" attribute="Data Field"/>
<RegExpr attribute="Mapnik Render-Time Variable" String="®expr_variable;"/>
<DetectChar attribute="Normal String" char="'" context="context_normalstring_singlequote"/>
</context>
<context attribute="Expression String" lineEndContext="#pop" name="context_expressionstring_singlequote">
<DetectChar attribute="Expression String" char="'" context="#pop"/>
<RangeDetect char="[" char1="]" attribute="Data Field"/>
<RegExpr attribute="Mapnik Render-Time Variable" String="®expr_variable;"/>
<DetectChar attribute="Normal String" char=""" context="context_normalstring_doublequote"/>
</context>
<context attribute="Normal String" lineEndContext="#pop" name="context_include_escape_characters">
<!-- Helper context. Can be included in other contexts to detect escape characters. -->
<RegExpr attribute="Escape Sequenze" String="(\\[abfnrtv"'\\])|(\\u[0-9a-fA-F]{4})|(\\U[0-9a-fA-F]{8})"/>
<RegExpr attribute="Error" String="\\[uU]"/>
</context>
<context attribute="Normal String" lineEndContext="#pop" name="context_normalstring_doublequote">
<DetectChar attribute="Normal String" char=""" context="#pop"/>
<IncludeRules context="context_include_escape_characters"/>
</context>
<context attribute="Normal String" lineEndContext="#pop" name="context_normalstring_singlequote">
<DetectChar attribute="Normal String" char="'" context="#pop"/>
<IncludeRules context="context_include_escape_characters"/>
</context>
</contexts>
<itemDatas>
<itemData name="Class" defStyleNum="dsNormal" spellChecking="false"/>
<itemData name="Layer ID" defStyleNum="dsNormal" spellChecking="false"/>
<itemData name="Attachment" defStyleNum="dsControlFlow" spellChecking="false"/>
<itemData name="Named instances" defStyleNum="dsDataType" spellChecking="false"/>
<itemData name="Mapnik Symbolizer Parameter" defStyleNum="dsNormal" spellChecking="false"/>
<itemData name="Operator" defStyleNum="dsOperator" spellChecking="false"/>
<itemData name="Keyword" defStyleNum="dsKeyword" spellChecking="false"/>
<itemData name="Function" defStyleNum="dsFunction" spellChecking="false"/>
<itemData name="Number" defStyleNum="dsFloat" spellChecking="false"/>
<itemData name="Color" defStyleNum="dsConstant" spellChecking="false"/>
<itemData name="Expression String" defStyleNum="dsSpecialString" spellChecking="false"/>
<!-- “Mapnik Render-Time Variable” work completly different from “CartoCSS Variable” and
has therefore a completly different color. -->
<itemData name="Mapnik Render-Time Variable" defStyleNum="dsSpecialChar" spellChecking="false"/>
<itemData name="Normal String" defStyleNum="dsString" spellChecking="false"/>
<itemData name="Escape Sequenze" defStyleNum="dsSpecialChar" spellChecking="false"/>
<itemData name="Data Field" defStyleNum="dsVariable" spellChecking="false"/>
<!-- “CartoCSS Variable”, inspite of its name, uses “dsPreprocessor” as default color.
This is appropriate because it actually behaves rather like a preprocessor: It is even
possible to define strings, and if escape sequences like “\n” are treated as such
is decided later, depending on the position of the actual usage of the variable. -->
<itemData name="CartoCSS Variable" defStyleNum="dsPreprocessor" spellChecking="false"/>
<itemData name="Comment" defStyleNum="dsComment" spellChecking="true" />
<itemData name="Error" defStyleNum="dsError" spellChecking="false"/>
</itemDatas>
</highlighting>
<general>
<comments>
<comment name="singleLine" start="//" position="afterwhitespace"/>
<comment name="multiLine" start="/*" end="*/" region="region_comment"/>
</comments>
<keywords casesensitive="true" weakDeliminator="-"/>
</general>
</language>
<!-- kate: replace-tabs off; -->
|