{ "name": "SVG", "scopeName": "text.xml.svg", "patterns": [ { "include": "#main" } ], "repository": { "attr": { "name": "meta.attribute.${0:/downcase}.xml.svg", "begin": "[A-Za-z_:][-\\w.:]*", "end": "(?=\\s*(?:/?\u003e|[^\\s=]))|(?\u003c=[\"'])", "patterns": [ { "include": "#attrValueCSS" }, { "include": "#attrValuePlain" } ], "beginCaptures": { "0": { "patterns": [ { "include": "#attrName" } ] } } }, "attrName": { "patterns": [ { "match": "(?:^|\\G)([-\\w.]+)(:)(?=[-\\w.:])", "captures": { "1": { "name": "entity.other.attribute-name.namespace.xml.svg" }, "2": { "name": "punctuation.separator.namespace.xml.svg" } } }, { "name": "entity.other.attribute-name.localname.xml.svg", "match": "[A-Za-z_:][-\\w.:]*" } ] }, "attrValueCSS": { "begin": "(?i)(?\u003c=style)\\G\\s*(=)", "end": "(?=\\s*(?:[%?/]?\u003e))|(?\u003c=[\"'])([^\\s\u003e]*)|(?:\\G|^)\\s*([^\\s\"'\u003e]+)", "patterns": [ { "match": "(?:\\G|^)\\s+(?!/?\u003e)" }, { "name": "string.quoted.double.xml.svg", "begin": "\"", "end": "\"", "patterns": [ { "name": "source.css.style.xml.svg", "match": "[^\"]+", "captures": { "0": { "patterns": [ { "include": "#entity" }, { "include": "source.css#rule-list-innards" } ] } } } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.xml.svg" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.xml.svg" } } }, { "name": "string.quoted.single.xml.svg", "begin": "'", "end": "'", "patterns": [ { "name": "source.css.style.xml.svg", "match": "[^']+", "captures": { "0": { "patterns": [ { "include": "#entity" }, { "include": "source.css#rule-list-innards" } ] } } } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.xml.svg" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.xml.svg" } } } ], "beginCaptures": { "1": { "name": "punctuation.separator.key-value.xml.svg" } }, "endCaptures": { "1": { "name": "invalid.illegal.syntax.xml.svg" }, "2": { "name": "string.unquoted.xml.svg", "patterns": [ { "include": "source.css#rule-list-innards" } ] } } }, "attrValuePlain": { "begin": "\\s*(=)", "end": "(?=\\s*(?:[%?/]?\u003e))|(?\u003c=[\"'])([^\\s\u003e]*)|(?:\\G|^)\\s*([^\\s\"'\u003e]+)", "patterns": [ { "match": "(?:\\G|^)\\s+(?!/?\u003e)" }, { "name": "string.quoted.double.xml.svg", "begin": "\"", "end": "\"", "patterns": [ { "include": "#entity" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.xml.svg" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.xml.svg" } } }, { "name": "string.quoted.single.xml.svg", "begin": "'", "end": "'", "patterns": [ { "include": "#entity" } ], "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.xml.svg" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.xml.svg" } } } ], "beginCaptures": { "1": { "name": "punctuation.separator.key-value.xml.svg" } }, "endCaptures": { "1": { "name": "invalid.illegal.syntax.xml.svg" }, "2": { "name": "string.unquoted.xml.svg" } } }, "cdata": { "name": "string.unquoted.cdata.xml.svg", "begin": "\u003c!\\[CDATA\\[", "end": "\\]\\]\u003e", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.xml.svg" } }, "endCaptures": { "0": { "name": "punctuation.definition.string.end.xml.svg" } } }, "comment": { "name": "comment.block.xml.svg", "begin": "\u003c!--", "end": "--\u003e", "patterns": [ { "name": "invalid.illegal.bad-comment.xml.svg", "match": "--(?!\u003e)" } ], "beginCaptures": { "0": { "name": "punctuation.definition.comment.begin.xml.svg" } }, "endCaptures": { "0": { "name": "punctuation.definition.comment.end.xml.svg" } } }, "entity": { "patterns": [ { "include": "text.xml#entity" }, { "include": "text.xml#bare-ampersand" } ] }, "main": { "patterns": [ { "include": "#comment" }, { "include": "#cdata" }, { "include": "text.xml#EntityDecl" }, { "include": "text.xml#parameterEntity" }, { "include": "#entity" }, { "include": "#preprocessor" }, { "include": "#scriptTag" }, { "include": "#styleTag" }, { "include": "#tag" }, { "include": "#unmatchedTag" } ] }, "preprocessor": { "name": "meta.tag.preprocessor.xml.svg", "begin": "(\u003c\\?)\\s*", "end": "\\?\u003e", "patterns": [ { "begin": "\\G", "end": "([-\\w]+)|(?=\\s*\\?\u003e)", "endCaptures": { "1": { "name": "entity.name.tag.xml.svg" } } }, { "include": "#attr" } ], "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.xml.svg" } }, "endCaptures": { "0": { "name": "punctuation.definition.tag.end.xml.svg" } } }, "scriptTag": { "patterns": [ { "include": "#scriptTagPlain" }, { "include": "#scriptTagJS" } ] }, "scriptTagJS": { "name": "meta.tag.script.xml.svg", "begin": "(?i)(\u003c)(script)(?=$|\\s|/?\u003e)", "end": "(?i)(\u003c/)(script)\\s*(\u003e)|(/\u003e)", "patterns": [ { "include": "#tagAttr" }, { "contentName": "source.js.embedded.xml.svg", "begin": "(?\u003c=\u003e)", "end": "(?i)(?=\\s*\u003c/script\\s*\u003e)", "patterns": [ { "include": "source.js" }, { "include": "#entity" } ] } ], "beginCaptures": { "1": { "name": "punctuation.definition.tag.opening.begin.xml.svg" }, "2": { "patterns": [ { "include": "#tagName" } ] } }, "endCaptures": { "1": { "name": "punctuation.definition.tag.closing.begin.xml.svg" }, "2": { "patterns": [ { "include": "#tagName" } ] }, "3": { "name": "punctuation.definition.tag.closing.end.xml.svg" }, "4": { "name": "punctuation.definition.tag.self-closing.end.xml.svg" } } }, "scriptTagPlain": { "name": "meta.tag.script.xml.svg", "begin": "(?x)\n(\u003c)((?i)script)\n(\n\t\\s+[^\u003e]*?\n\t(?\u003c=\\s)(?i:type)\\s*=\\s*\n\t([\"'])?\n\t(?! module\n\t| application/(?:x-)?(?:ecma|java)script\n\t| text/\n\t\t(?: javascript(?:1.[0-5])?\n\t\t| (?:j|ecma|live)script\n\t\t| x-(?:ecma|java)script\n\t\t)\n\t)\n\t(?: (?\u003c=\")(?:[^\"\u003e]+)\"\n\t| (?\u003c=')(?:[^'\u003e]+)'\n\t| [^\\s\"'\u003e]+\n\t)\n\t(?=\\s|/?\u003e)\n)", "end": "(?i)(\u003c/)(script)\\s*(\u003e)|(/\u003e)", "patterns": [ { "include": "#tagAttr" }, { "include": "#main" } ], "beginCaptures": { "1": { "name": "punctuation.definition.tag.opening.begin.xml.svg" }, "2": { "patterns": [ { "include": "#tagName" } ] }, "3": { "patterns": [ { "include": "#attr" } ] } }, "endCaptures": { "1": { "name": "punctuation.definition.tag.closing.begin.xml.svg" }, "2": { "patterns": [ { "include": "#tagName" } ] }, "3": { "name": "punctuation.definition.tag.closing.end.xml.svg" }, "4": { "name": "punctuation.definition.tag.self-closing.end.xml.svg" } } }, "styleTag": { "name": "meta.tag.style.xml.svg", "begin": "(?i)(\u003c)(style)(?=$|\\s|/?\u003e)", "end": "(?i)(\u003c/)(style)\\s*(\u003e)|(/\u003e)", "patterns": [ { "include": "#tagAttr" }, { "contentName": "source.css.embedded.xml.svg", "begin": "(?\u003c=\u003e)", "end": "(?i)(?=\\s*\u003c/style\\s*\u003e)", "patterns": [ { "include": "source.css" }, { "include": "#entity" } ] } ], "beginCaptures": { "1": { "name": "punctuation.definition.tag.opening.begin.xml.svg" }, "2": { "patterns": [ { "include": "#tagName" } ] } }, "endCaptures": { "1": { "name": "punctuation.definition.tag.closing.begin.xml.svg" }, "2": { "patterns": [ { "include": "#tagName" } ] }, "3": { "name": "punctuation.definition.tag.closing.end.xml.svg" }, "4": { "name": "punctuation.definition.tag.self-closing.end.xml.svg" } } }, "tag": { "name": "meta.tag.${2:/downcase}.xml.svg", "begin": "(?i)(\u003c)([A-Za-z_:][-\\w.:]*)(?=$|\\s|/?\u003e)", "end": "(?i)(\u003c/)(\\2)\\s*(\u003e)|(/\u003e)", "patterns": [ { "include": "#tagAttr" }, { "include": "#main" } ], "beginCaptures": { "1": { "name": "punctuation.definition.tag.opening.begin.xml.svg" }, "2": { "patterns": [ { "include": "#tagName" } ] } }, "endCaptures": { "1": { "name": "punctuation.definition.tag.closing.begin.xml.svg" }, "2": { "patterns": [ { "include": "#tagName" } ] }, "3": { "name": "punctuation.definition.tag.closing.end.xml.svg" }, "4": { "name": "punctuation.definition.tag.self-closing.end.xml.svg" } } }, "tagAttr": { "begin": "\\G", "end": "\u003e|(?=\\s*/\u003e)", "patterns": [ { "include": "#attr" } ], "endCaptures": { "0": { "name": "punctuation.definition.tag.opening.end.xml.svg" } } }, "tagName": { "patterns": [ { "match": "(?:^|\\G)([A-Za-z_][-\\w.]*)(:)(?=[-\\w.:])", "captures": { "1": { "name": "entity.name.tag.namespace.xml.svg" }, "2": { "name": "punctuation.separator.namespace.xml.svg" } } }, { "name": "entity.name.tag.localname.xml.svg", "match": "[A-Za-z_:][-\\w.:]*" } ] }, "unmatchedTag": { "name": "invalid.illegal.unmatched-tag.xml.svg", "match": "(\u003c/)([A-Za-z_:][-\\w.:]*)\\s*(\u003e)" } } }