diff --git a/build/carto.tmbundle/Syntaxes/carto.tmLanguage b/build/carto.tmbundle/Syntaxes/carto.tmLanguage index dc28a09..87771a9 100644 --- a/build/carto.tmbundle/Syntaxes/carto.tmLanguage +++ b/build/carto.tmbundle/Syntaxes/carto.tmLanguage @@ -37,7 +37,7 @@ match \\. name - constant.character.escaped.css + constant.character.escaped.mss @@ -62,13 +62,20 @@ captures 1 + + name + punctuation.definition.entity.mss + + 2 name entity.other.attribute-name.class.mss match - (\.[a-zA-Z0-9_-]+)[\s,{;] + (\.)([a-zA-Z0-9_-]+) + name + meta.selector.class.mss begin @@ -78,27 +85,32 @@ end \) name - support.function.any-method.builtin.css + support.function.any-method.builtin.mss match (#)([0-9a-fA-F]{3}|[0-9a-fA-F]{6})\b name - constant.other.rgb-value.css + constant.other.rgb-value.mss captures - 0 + 1 + + name + punctuation.definition.entity.mss + + 2 name entity.other.attribute-name.id match - #[a-zA-Z0-9_-]+ + (#)([a-zA-Z0-9_-]+) name - meta.selector.css + meta.selector.id.mss begin @@ -106,19 +118,19 @@ end \*/ name - comment.block.css + comment.block.mss match (-|\+)?\s*[0-9]+(\.[0-9]+)? name - constant.numeric.css + constant.numeric.mss match - (?<=[\d])(px|pt|cm|mm|in|em|ex|pc)\b|% + (?<=[\d])(px)\b|% name - keyword.unit.css + keyword.unit.mss captures @@ -126,27 +138,18 @@ 1 name - punctuation.definition.entity.css + punctuation.definition.entity.mss - - match - (:+)\b(after|before|first-child|first-letter|first-line|selection)\b - name - entity.other.attribute-name.pseudo-element.css - - - captures - - 1 + 2 name - punctuation.definition.entity.css + entity.other.attachment.mss match - (:)\b(active|hover|link|visited|focus)\b + (::)([a-zA-Z0-9_/-]+)\b name - entity.other.attribute-name.pseudo-class.css + meta.selector.attachment.mss captures @@ -154,43 +157,63 @@ 1 name - punctuation.definition.entity.css + punctuation.definition.entity.mss + + 10 + + name + punctuation.definition.string.end.mss + + 11 + + name + punctuation.definition.entity.mss 2 name - entity.other.attribute-name.attribute.css + meta.tag.mss.zoomfilter 3 name - punctuation.separator.operator.css + variable.other.less 4 name - string.unquoted.attribute-value.css + punctuation.separator.operator.mss 5 name - string.quoted.double.attribute-value.css + constant.numeric.mss 6 name - punctuation.definition.string.begin.css + string.quoted.attribute-value.mss 7 name - punctuation.definition.string.end.css + punctuation.definition.string.begin.mss + + 8 + + name + punctuation.definition.string.end.mss + + 9 + + name + punctuation.definition.string.begin.mss match - (?i)(\[)\s*(-?[_a-z\\[[:^ascii:]]][_a-z0-9\-\\[[:^ascii:]]]*)(?:\s*([~|^$*]?=)\s*(?:(-?[_a-z\\[[:^ascii:]]][_a-z0-9\-\\[[:^ascii:]]]*)|((?>(['"])(?:[^\\]|\\.)*?(\6)))))?\s*(\]) + (\[)\s*(?:(zoom)|(\w+?))\s*(!?=|>=?|<=?)\s*(?:(\d+)|((")(?:[^"\\]|\\.)*(")|(')(?:[^'\\]|\\.)*(')|[a-zA-Z0-9_][a-zA-Z0-9_-]*))\s*(\]) name - meta.attribute-selector.css + meta.attribute-selector.mss captures @@ -198,18 +221,18 @@ 1 name - keyword.control.at-rule.import.css + keyword.control.at-rule.import.mss 2 name - punctuation.definition.keyword.css + punctuation.definition.keyword.mss match ^\s*((@)import\b) name - meta.at-rule.import.css + meta.at-rule.import.mss captures @@ -217,7 +240,7 @@ 1 name - support.type.property-name.css + support.type.property-name.mss match @@ -227,7 +250,7 @@ match \b(miter|round|bevel|butt|round|square|point|line|arrow|ellipse|png|jpg|svg|normal|grain_merge|grain_merge2|multiply|multiply2|divide|divide2|screen|hard_light|fast|bilinear|bilinear8|centroid|interior|point|line|vertex|interior|none|uppercase|lowercase)\b name - support.constant.property-value.css + support.constant.property-value.mss comment @@ -235,7 +258,7 @@ match \b(aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|grey|green|greenyellow|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen|transparent)\b name - support.constant.color.w3c-standard-color-name.css + support.constant.color.w3c-standard-color-name.mss match @@ -247,25 +270,7 @@ match \b(rgb|rgba|hsl|hsla|url)\b name - support.function.any-method.builtin.css - - - captures - - 1 - - name - support.function.any-method.vendor.css - - - match - (-(?:webkit|moz|khtml|o|icab)-(?:gradient|linear-gradient)) - - - match - \b(color-stop|from|to)\b - name - support.function.any-method.webkit.gradient.css + support.function.any-method.builtin.mss captures diff --git a/build/syntaxgenerate b/build/syntaxgenerate index 1ac3c3c..34eef5a 100755 --- a/build/syntaxgenerate +++ b/build/syntaxgenerate @@ -21,9 +21,9 @@ var keyword_names = _.reduce(carto.tree.Reference.data.symbolizers, }, []); fs.writeFile('carto.tmLanguage', _.template(tm_tmpl, { - color_names: color_names.join('|'), - keyword_names: keyword_names.join('|'), - property_names: property_names.join('|') + color_names: color_names.filter(function(a) { return a; }).join('|'), + keyword_names: keyword_names.filter(function(a) { return a; }).join('|'), + property_names: property_names.filter(function(a) { return a; }).join('|') }), function(err) { if (!err) console.log('tmLanguage created'); }); diff --git a/build/tmlanguage_template.js b/build/tmlanguage_template.js index 1dd25ad..dc930cf 100644 --- a/build/tmlanguage_template.js +++ b/build/tmlanguage_template.js @@ -4,112 +4,120 @@ foldingStartMarker = '/\*\*(?!\*)|\{\s*($|/\*(?!.*?\*/.*\S))'; foldingStopMarker = '(?=?|<=?)\s*(?:(\d+)|((")(?:[^"\\]|\\.)*(")|('')(?:[^''\\]|\\.)*('')|[a-zA-Z0-9_][a-zA-Z0-9_-]*))\s*(\])'; + captures = { + 1 = { name = 'punctuation.definition.entity.carto'; }; + 2 = { name = 'meta.tag.zoomfilter.carto'; }; + 3 = { name = 'variable.other.carto'; }; + 4 = { name = 'punctuation.definition.string.begin.carto'; }; + 5 = { name = 'punctuation.definition.string.end.carto'; }; + 6 = { name = 'punctuation.definition.string.begin.carto'; }; + 7 = { name = 'punctuation.definition.string.end.carto'; }; + 8 = { name = 'punctuation.separator.operator.carto'; }; + 9 = { name = 'constant.numeric.carto'; }; + 10 = { name = 'string.quoted.attribute-value.carto'; }; + 11 = { name = 'punctuation.definition.string.begin.carto'; }; + 12 = { name = 'punctuation.definition.string.end.carto'; }; + 13 = { name = 'punctuation.definition.string.begin.carto'; }; + 14 = { name = 'punctuation.definition.string.end.carto'; }; + 15 = { name = 'punctuation.definition.entity.carto'; }; + }; + }, + { name = 'support.function.any-method.builtin.carto'; contentName = 'variable.parameter.url'; begin = 'url\('; end = '\)'; }, - { name = 'constant.other.rgb-value.css'; + { name = 'constant.other.rgb-value.carto'; match = '(#)([0-9a-fA-F]{3}|[0-9a-fA-F]{6})\b'; }, - { name = 'meta.selector.css'; - match = '#[a-zA-Z0-9_-]+'; - captures = { 0 = { name = 'entity.other.attribute-name.id'; }; }; - }, - { name = 'comment.block.css'; + { name = 'comment.block.carto'; begin = '/\*'; end = '\*/'; }, - { name = 'constant.numeric.css'; + { name = 'constant.numeric.carto'; match = '(-|\+)?\s*[0-9]+(\.[0-9]+)?'; }, - { name = 'keyword.unit.css'; - match = '(?<=[\d])(px|pt|cm|mm|in|em|ex|pc)\b|%'; - }, - { name = 'entity.other.attribute-name.pseudo-element.css'; - match = '(:+)\b(after|before|first-child|first-letter|first-line|selection)\b'; - captures = { 1 = { name = 'punctuation.definition.entity.css'; }; }; + { name = 'keyword.unit.carto'; + match = '(?<=[\d])(px)\b|%'; }, - { name = 'entity.other.attribute-name.pseudo-class.css'; - match = '(:)\b(active|hover|link|visited|focus)\b'; - captures = { 1 = { name = 'punctuation.definition.entity.css'; }; }; - }, - { name = 'meta.attribute-selector.css'; - match = '(?i)(\[)\s*(-?[_a-z\\[[:^ascii:]]][_a-z0-9\-\\[[:^ascii:]]]*)(?:\s*([~|^$*]?=)\s*(?:(-?[_a-z\\[[:^ascii:]]][_a-z0-9\-\\[[:^ascii:]]]*)|((?>([''"])(?:[^\\]|\\.)*?(\6)))))?\s*(\])'; - captures = { - 1 = { name = 'punctuation.definition.entity.css'; }; - 2 = { name = 'entity.other.attribute-name.attribute.css'; }; - 3 = { name = 'punctuation.separator.operator.css'; }; - 4 = { name = 'string.unquoted.attribute-value.css'; }; - 5 = { name = 'string.quoted.double.attribute-value.css'; }; - 6 = { name = 'punctuation.definition.string.begin.css'; }; - 7 = { name = 'punctuation.definition.string.end.css'; }; - }; - }, - { name = 'meta.at-rule.import.css'; + { name = 'meta.at-rule.import.carto'; match = '^\s*((@)import\b)'; captures = { - 1 = { name = 'keyword.control.at-rule.import.css'; }; - 2 = { name = 'punctuation.definition.keyword.css'; }; + 1 = { name = 'keyword.control.at-rule.import.carto'; }; + 2 = { name = 'punctuation.definition.keyword.carto'; }; }; }, { match = '\b(<%= property_names %>)\s*:'; - captures = { 1 = { name = 'support.type.property-name.css'; }; }; + captures = { 1 = { name = 'support.type.property-name.carto'; }; }; }, - { name = 'support.constant.property-value.css'; + { name = 'meta.property-value.carto'; match = '\b(<%= keyword_names %>)\b'; }, - { name = 'support.constant.color.w3c-standard-color-name.css'; + { name = 'constant.color.w3c-standard-color-name.carto'; comment = 'http://www.w3.org/TR/CSS21/syndata.html#value-def-color'; match = '\b(<%= color_names %>)\b'; }, - { name = 'support.function.any-method.builtin.less'; + { name = 'support.function.any-method.builtin.carto'; match = '\b(saturate|desaturate|lighten|darken|grayscale)\b'; }, - { name = 'support.function.any-method.builtin.css'; + { name = 'support.function.any-method.builtin.carto'; match = '\b(rgb|rgba|hsl|hsla|url)\b'; }, - { match = '(-(?:webkit|moz|khtml|o|icab)-(?:gradient|linear-gradient))'; - captures = { 1 = { name = 'support.function.any-method.vendor.css'; }; }; - }, - { name = 'support.function.any-method.webkit.gradient.css'; - match = '\b(color-stop|from|to)\b'; - }, { match = '(\.[a-zA-Z0-9_-]+)\s*(;|\()'; - captures = { 1 = { name = 'support.function.less'; }; }; + captures = { 1 = { name = 'support.function.carto'; }; }; }, - { name = 'comment.line.double-slash.less'; + { name = 'comment.line.double-slash.carto'; begin = '//'; end = '$\n?'; }, - { name = 'variable.other.less'; + { name = 'variable.other.carto'; match = '@[a-zA-Z0-9_-][\w-]*'; }, - { name = 'keyword.operator.less'; + { name = 'keyword.operator.carto'; match = '\$|%|&|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|<=|>=|<<=|>>=|>>>=|<>|<|>|!|&&|\|\||\?\:|\*=|(?