Warning, /frameworks/syntax-highlighting/data/syntax/carto-css.xml is written in an unsupported language. File is not indexed.

0001 <?xml version="1.0" encoding="UTF-8"?>
0002 <!DOCTYPE language [
0003   <!ENTITY regexpr_identifier "([\w_-]+)">
0004   <!ENTITY regexpr_variable "(@&regexpr_identifier;)">
0005   <!ENTITY anychar_operator ":,!/*-+=&gt;&lt;()&#x0025;">
0006   <!ENTITY regexpr_number "(\-?((\d+(\.\d+)?)|(\.\d+))&#x0025;?)">
0007   <!ENTITY regexpr_color "((#[\dabcdefABCDEF]{3}|#[\dabcdefABCDEF]{6})(?=(\W|$)))">
0008 ]>
0009 <!-- Syntax highlighting definition for CartoCSS MSS, see https://github.com/mapbox/carto
0010      CartoCSS defines two file formats: MML (Map Markup Language) and MSS (Map Stylesheet).
0011      This file provides syntax highlighting for MSS. MSS is similar in syntax to CSS,
0012      but completly different in its semantics. -->
0013 <language name="CartoCSS MSS"
0014           version="6"
0015                   kateversion="5.0"
0016                   section="Markup"
0017                   extensions="*.mss"
0018                   author="Lukas Sommer"
0019                   license="CC0 Public Domain Dedication, version 1.0, as published by Creative Commons">
0020 
0021 
0022         <highlighting>
0023 
0024                 <list name="list_colornames">
0025             <!-- This list is based on https://github.com/mapbox/carto/blob/35773a5f519b1ded0d88b14d53ac875cd610bb8c/build/vim-carto/syntax/carto.vim#L53
0026                  and https://github.com/mapbox/carto/blob/35773a5f519b1ded0d88b14d53ac875cd610bb8c/build/carto.tmbundle/Syntaxes/carto.tmLanguage#L279
0027             -->
0028                         <item>aliceblue</item>
0029                         <item>antiquewhite</item>
0030                         <item>aqua</item>
0031                         <item>aquamarine</item>
0032                         <item>azure</item>
0033                         <item>beige</item>
0034                         <item>bisque</item>
0035                         <item>black</item>
0036                         <item>blanchedalmond</item>
0037                         <item>blue</item>
0038                         <item>blueviolet</item>
0039                         <item>brown</item>
0040                         <item>burlywood</item>
0041                         <item>cadetblue</item>
0042                         <item>chartreuse</item>
0043                         <item>chocolate</item>
0044                         <item>coral</item>
0045                         <item>cornflowerblue</item>
0046                         <item>cornsilk</item>
0047                         <item>crimson</item>
0048                         <item>cyan</item>
0049                         <item>darkblue</item>
0050                         <item>darkcyan</item>
0051                         <item>darkgoldenrod</item>
0052                         <item>darkgray</item>
0053                         <item>darkgreen</item>
0054                         <item>darkgrey</item>
0055                         <item>darkkhaki</item>
0056                         <item>darkmagenta</item>
0057                         <item>darkolivegreen</item>
0058                         <item>darkorange</item>
0059                         <item>darkorchid</item>
0060                         <item>darkred</item>
0061                         <item>darksalmon</item>
0062                         <item>darkseagreen</item>
0063                         <item>darkslateblue</item>
0064                         <item>darkslategrey</item>
0065                         <item>darkturquoise</item>
0066                         <item>darkviolet</item>
0067                         <item>deeppink</item>
0068                         <item>deepskyblue</item>
0069                         <item>dimgray</item>
0070                         <item>dimgrey</item>
0071                         <item>dodgerblue</item>
0072                         <item>firebrick</item>
0073                         <item>floralwhite</item>
0074                         <item>forestgreen</item>
0075                         <item>fuchsia</item>
0076                         <item>gainsboro</item>
0077                         <item>ghostwhite</item>
0078                         <item>gold</item>
0079                         <item>goldenrod</item>
0080                         <item>gray</item>
0081                         <item>grey</item>
0082                         <item>green</item>
0083                         <item>greenyellow</item>
0084                         <item>honeydew</item>
0085                         <item>hotpink</item>
0086                         <item>indianred</item>
0087                         <item>indigo</item>
0088                         <item>ivory</item>
0089                         <item>khaki</item>
0090                         <item>lavender</item>
0091                         <item>lavenderblush</item>
0092                         <item>lawngreen</item>
0093                         <item>lemonchiffon</item>
0094                         <item>lightblue</item>
0095                         <item>lightcoral</item>
0096                         <item>lightcyan</item>
0097                         <item>lightgoldenrodyellow</item>
0098                         <item>lightgray</item>
0099                         <item>lightgreen</item>
0100                         <item>lightgrey</item>
0101                         <item>lightpink</item>
0102                         <item>lightsalmon</item>
0103                         <item>lightseagreen</item>
0104                         <item>lightskyblue</item>
0105                         <item>lightslategray</item>
0106                         <item>lightslategrey</item>
0107                         <item>lightsteelblue</item>
0108                         <item>lightyellow</item>
0109                         <item>lime</item>
0110                         <item>limegreen</item>
0111                         <item>linen</item>
0112                         <item>magenta</item>
0113                         <item>maroon</item>
0114                         <item>mediumaquamarine</item>
0115                         <item>mediumblue</item>
0116                         <item>mediumorchid</item>
0117                         <item>mediumpurple</item>
0118                         <item>mediumseagreen</item>
0119                         <item>mediumslateblue</item>
0120                         <item>mediumspringgreen</item>
0121                         <item>mediumturquoise</item>
0122                         <item>mediumvioletred</item>
0123                         <item>midnightblue</item>
0124                         <item>mintcream</item>
0125                         <item>mistyrose</item>
0126                         <item>moccasin</item>
0127                         <item>navajowhite</item>
0128                         <item>navy</item>
0129                         <item>oldlace</item>
0130                         <item>olive</item>
0131                         <item>olivedrab</item>
0132                         <item>orange</item>
0133                         <item>orangered</item>
0134                         <item>orchid</item>
0135                         <item>palegoldenrod</item>
0136                         <item>palegreen</item>
0137                         <item>paleturquoise</item>
0138                         <item>palevioletred</item>
0139                         <item>papayawhip</item>
0140                         <item>peachpuff</item>
0141                         <item>peru</item>
0142                         <item>pink</item>
0143                         <item>plum</item>
0144                         <item>powderblue</item>
0145                         <item>purple</item>
0146                         <item>red</item>
0147                         <item>rosybrown</item>
0148                         <item>royalblue</item>
0149                         <item>saddlebrown</item>
0150                         <item>salmon</item>
0151                         <item>sandybrown</item>
0152                         <item>seagreen</item>
0153                         <item>seashell</item>
0154                         <item>sienna</item>
0155                         <item>silver</item>
0156                         <item>skyblue</item>
0157                         <item>slateblue</item>
0158                         <item>slategray</item>
0159                         <item>slategrey</item>
0160                         <item>snow</item>
0161                         <item>springgreen</item>
0162                         <item>steelblue</item>
0163                         <item>tan</item>
0164                         <item>teal</item>
0165                         <item>thistle</item>
0166                         <item>tomato</item>
0167                         <item>turquoise</item>
0168                         <item>violet</item>
0169                         <item>wheat</item>
0170                         <item>white</item>
0171                         <item>whitesmoke</item>
0172                         <item>yellow</item>
0173                         <item>yellowgreen</item>
0174                         <item>transparent</item>
0175                 </list>
0176 
0177                 <contexts>
0178 
0179                         <context attribute="Mapnik Symbolizer Parameter" lineEndContext="#stay" name="context_default">
0180                                 <DetectSpaces/>
0181                                 <Detect2Chars attribute="Comment" context="context_comment_multiline" char="/" char1="*" lookAhead="true" beginRegion="region_comment"/>
0182                                 <Detect2Chars attribute="Comment" context="context_comment_singleline" char="/" char1="/" lookAhead="true"/>
0183                                 <DetectChar attribute="Operator" char="{" beginRegion="region_braces"/>
0184                                 <DetectChar attribute="Operator" char="}" endRegion="region_braces"/>
0185                                 <DetectChar attribute="Operator" char="[" context="context_filter_attribute"/> <!-- This rule must be _before_ the “Operator” rule to make sure it is working. -->
0186                                 <RegExpr attribute="Attachment" String="::&regexpr_identifier;"/> <!-- This rule must be _before_ the “Operator” rule to make sure it is working. -->
0187                                 <DetectChar attribute="Operator" char=":" context="context_expression"/>
0188                                 <RegExpr attribute="CartoCSS Variable" String="&regexpr_variable;"/>
0189                                 <RegExpr attribute="Named instances" String="&regexpr_identifier;/"/>
0190                                 <RegExpr attribute="Layer ID" String="#&regexpr_identifier;"/>
0191                                 <RegExpr attribute="Class" String="\.&regexpr_identifier;"/>
0192                         </context>
0193 
0194                         <context attribute="Keyword" lineEndContext="#stay" name="context_expression">
0195                                 <DetectSpaces/>
0196                                 <RangeDetect char="[" char1="]" attribute="Data Field"/> <!-- This rule must be _before_ the “Operator” rule to make sure it is working. -->
0197                                 <RegExpr attribute="Number" String="&regexpr_number;"/> <!-- This rule must be _before_ the “Operator” rule to make sure it is working. -->
0198                                 <AnyChar attribute="Operator" String="&anychar_operator;[]"/>
0199                                 <RegExpr attribute="CartoCSS Variable" String="&regexpr_variable;"/>
0200                                 <RegExpr attribute="Function" String="&regexpr_identifier;(?=\()"/>
0201                                 <RegExpr attribute="Color" String="&regexpr_color;"/>
0202                                 <keyword attribute="Color" context="#stay" String="list_colornames"/>
0203                                 <!-- The strings that might appear hear (both single-quoted and double-quoted strings)
0204                                  are either normal strings or expression strings: If they are the only content
0205                                  (like in “test: "mystring";”) than they are expression strings. If there is other
0206                                  content (like in “test: "mystring" + [myfield];” or “test: [myfield] + "mystring";”),
0207                                  than they are normal strings. This is however difficult to detect, therefore we default
0208                                  simply to expression strings.-->
0209                                 <DetectChar attribute="Expression String" char="&quot;" context="context_expressionstring_doublequote"/>
0210                                 <DetectChar attribute="Expression String" char="'" context="context_expressionstring_singlequote"/>
0211                                 <!-- An expression ends with a semicolon “;”. However, the
0212                                 CartoCSS parser allows to omit the semicolon at the end
0213                                 of a block of curly braces “{}”. Therefore, we also
0214                                 have to detect the closing curly braces “}” here: -->
0215                                 <DetectChar attribute="Operator" char=";" context="#pop"/>
0216                                 <DetectChar attribute="Operator" char="}" endRegion="region_braces" context="#pop"/>
0217                         </context>
0218 
0219                         <context attribute="Data Field" lineEndContext="#stay" name="context_filter_attribute">
0220                                 <DetectSpaces/>
0221                                 <RegExpr attribute="CartoCSS Variable" String="&regexpr_variable;"/>
0222                                 <AnyChar attribute="Operator" String="&anychar_operator;" context="context_filter_rule"/>
0223                                 <WordDetect String="zoom" insensitive="true" attribute="Keyword"/>
0224                                 <DetectChar attribute="Data Field" char="&quot;" context="context_filter_attribute_doublequote"/>
0225                                 <DetectChar attribute="Data Field" char="'" context="context_filter_attribute_singlequote"/>
0226                                 <DetectChar attribute="Operator" char="]" context="#pop"/>
0227                         </context>
0228 
0229                         <context attribute="Data Field" lineEndContext="#pop" name="context_filter_attribute_doublequote">
0230                                 <DetectChar char="&quot;" context="#pop"/>
0231                         </context>
0232 
0233                         <context attribute="Data Field" lineEndContext="#pop" name="context_filter_attribute_singlequote">
0234                                 <DetectChar char="'" context="#pop"/>
0235                         </context>
0236 
0237                         <context attribute="Keyword" lineEndContext="#stay" name="context_filter_rule">
0238                                 <DetectSpaces/>
0239                                 <RegExpr attribute="Number" String="&regexpr_number;"/> <!-- This rule must be _before_ the “Operator” rule to make sure it is working. -->
0240                                 <AnyChar attribute="Operator" String="&anychar_operator;"/>
0241                                 <RegExpr attribute="CartoCSS Variable" String="&regexpr_variable;"/>
0242                                 <WordDetect String="zoom" insensitive="true" attribute="Keyword"/>
0243                                 <RegExpr attribute="Function" String="&regexpr_identifier;(?=\()"/>
0244                                 <RegExpr attribute="Color" String="&regexpr_color;"/>
0245                                 <keyword attribute="Color" context="#stay" String="list_colornames"/>
0246                                 <DetectChar attribute="Normal String" char="&quot;" context="context_normalstring_doublequote"/>
0247                                 <DetectChar attribute="Normal String" char="'" context="context_normalstring_singlequote"/>
0248                                 <DetectChar attribute="Operator" char="]" context="#pop#pop"/>
0249                         </context>
0250 
0251                         <context attribute="Comment" lineEndContext="#stay" name="context_comment_multiline">
0252                                 <Detect2Chars attribute="Comment" context="#pop" char="*" char1="/" endRegion="region_comment"/>
0253                                 <IncludeRules context="##Comments"/>
0254                         </context>
0255 
0256                         <context attribute="Comment" lineEndContext="#pop" name="context_comment_singleline">
0257                                 <IncludeRules context="##Comments"/>
0258                         </context>
0259 
0260                         <context attribute="Expression String" lineEndContext="#pop" name="context_expressionstring_doublequote">
0261                                 <DetectChar attribute="Expression String" char="&quot;" context="#pop"/>
0262                                 <RangeDetect char="[" char1="]" attribute="Data Field"/>
0263                                 <RegExpr attribute="Mapnik Render-Time Variable" String="&regexpr_variable;"/>
0264                                 <DetectChar attribute="Normal String" char="'" context="context_normalstring_singlequote"/>
0265                         </context>
0266 
0267                         <context attribute="Expression String" lineEndContext="#pop" name="context_expressionstring_singlequote">
0268                                 <DetectChar attribute="Expression String" char="'" context="#pop"/>
0269                                 <RangeDetect char="[" char1="]" attribute="Data Field"/>
0270                                 <RegExpr attribute="Mapnik Render-Time Variable" String="&regexpr_variable;"/>
0271                                 <DetectChar attribute="Normal String" char="&quot;" context="context_normalstring_doublequote"/>
0272                         </context>
0273 
0274                         <context attribute="Normal String" lineEndContext="#pop" name="context_include_escape_characters">
0275                                 <!-- Helper context. Can be included in other contexts to detect escape characters. -->
0276                                 <RegExpr attribute="Escape Sequenze" String="(\\[abfnrtv&quot;'\\])|(\\u[0-9a-fA-F]{4})|(\\U[0-9a-fA-F]{8})"/>
0277                                 <RegExpr attribute="Error" String="\\[uU]"/>
0278                         </context>
0279 
0280                         <context attribute="Normal String" lineEndContext="#pop" name="context_normalstring_doublequote">
0281                                 <DetectChar attribute="Normal String" char="&quot;" context="#pop"/>
0282                                 <IncludeRules context="context_include_escape_characters"/>
0283                         </context>
0284 
0285                         <context attribute="Normal String" lineEndContext="#pop" name="context_normalstring_singlequote">
0286                                 <DetectChar attribute="Normal String" char="'" context="#pop"/>
0287                                 <IncludeRules context="context_include_escape_characters"/>
0288                         </context>
0289 
0290                 </contexts>
0291 
0292                 <itemDatas>
0293                         <itemData name="Class"                       defStyleNum="dsNormal"        spellChecking="false"/>
0294                         <itemData name="Layer ID"                    defStyleNum="dsNormal"        spellChecking="false"/>
0295                         <itemData name="Attachment"                  defStyleNum="dsControlFlow"   spellChecking="false"/>
0296                         <itemData name="Named instances"             defStyleNum="dsDataType"      spellChecking="false"/>
0297                         <itemData name="Mapnik Symbolizer Parameter" defStyleNum="dsNormal"        spellChecking="false"/>
0298                         <itemData name="Operator"                    defStyleNum="dsOperator"      spellChecking="false"/>
0299                         <itemData name="Keyword"                     defStyleNum="dsKeyword"       spellChecking="false"/>
0300                         <itemData name="Function"                    defStyleNum="dsFunction"      spellChecking="false"/>
0301                         <itemData name="Number"                      defStyleNum="dsFloat"         spellChecking="false"/>
0302                         <itemData name="Color"                       defStyleNum="dsConstant"      spellChecking="false"/>
0303                         <itemData name="Expression String"           defStyleNum="dsSpecialString" spellChecking="false"/>
0304                         <!-- “Mapnik Render-Time Variable” work completly different from “CartoCSS Variable” and
0305                              has therefore a completly different color. -->
0306                         <itemData name="Mapnik Render-Time Variable" defStyleNum="dsSpecialChar"   spellChecking="false"/>
0307                         <itemData name="Normal String"               defStyleNum="dsString"        spellChecking="false"/>
0308                         <itemData name="Escape Sequenze"             defStyleNum="dsSpecialChar"   spellChecking="false"/>
0309                         <itemData name="Data Field"                  defStyleNum="dsVariable"      spellChecking="false"/>
0310                         <!-- “CartoCSS Variable”, inspite of its name, uses “dsPreprocessor” as default color.
0311                              This is appropriate because it actually behaves rather like a preprocessor: It is even
0312                              possible to define strings, and if escape sequences like “\n” are treated as such
0313                              is decided later, depending on the position of the actual usage of the variable. -->
0314                         <itemData name="CartoCSS Variable"           defStyleNum="dsPreprocessor"  spellChecking="false"/>
0315                         <itemData name="Comment"                     defStyleNum="dsComment"       spellChecking="true" />
0316                         <itemData name="Error"                       defStyleNum="dsError"         spellChecking="false"/>
0317                 </itemDatas>
0318 
0319         </highlighting>
0320 
0321         <general>
0322                 <comments>
0323                         <comment name="singleLine" start="//" position="afterwhitespace"/>
0324                         <comment name="multiLine" start="/*" end="*/" region="region_comment"/>
0325                 </comments>
0326                 <keywords casesensitive="true" weakDeliminator="-"/>
0327         </general>
0328 </language>
0329 <!-- kate: replace-tabs off; -->