From e5869f8a8e6a9b2e186d7ed7cb91f2974f114386 Mon Sep 17 00:00:00 2001 From: Dustin Wilson Date: Thu, 8 Jul 2021 16:18:10 -0500 Subject: [PATCH] Reorganized data folder --- data/graphql/graphql.json | 599 --- data/markdown/fixtures/fenced-code.json | 216 - data/markdown/injections/php.json | 119 - .../repositories/blocks/fenced-code.json | 37 - .../repositories/blocks/headings.json | 259 - data/markdown/repositories/blocks/hr.json | 17 - data/markdown/repositories/blocks/lists.json | 155 - data/markdown/repositories/blocks/quotes.json | 24 - .../repositories/flavors/criticmark.json | 120 - .../repositories/flavors/front-matter.json | 65 - .../repositories/flavors/github-blocks.json | 58 - .../repositories/flavors/github-inlines.json | 160 - .../repositories/flavors/ia-writer.json | 45 - .../repositories/flavors/markdown-extra.json | 30 - .../repositories/flavors/math-block.json | 25 - .../repositories/flavors/math-inline.json | 24 - .../markdown/repositories/flavors/pandoc.json | 23 - .../flavors/rmarkdown-attributes.json | 56 - .../repositories/flavors/rmarkdown.json | 52 - .../flavors/special-attribute-elements.json | 38 - .../flavors/special-attributes.json | 24 - data/markdown/repositories/inlines/code.json | 17 - .../repositories/inlines/comments.json | 18 - .../repositories/inlines/emphasis.json | 129 - .../repositories/inlines/entities.json | 45 - .../repositories/inlines/escapes.json | 9 - data/markdown/repositories/inlines/html.json | 12 - .../repositories/inlines/line-breaks.json | 13 - .../inlines/link-destination.json | 29 - .../repositories/inlines/link-label.json | 24 - .../repositories/inlines/link-text.json | 98 - .../repositories/inlines/link-title.json | 29 - data/markdown/repositories/inlines/links.json | 317 -- .../markdown/repositories/inlines/liquid.json | 8 - .../repositories/inlines/references.json | 14 - data/markdown/repositories/inlines/todo.json | 9 - data/markdown/repositories/markdown.json | 199 - ...plescript.json => source.applescript.json} | 0 data/{c/c.json => source.c.json} | 0 data/source.cake.json | 16 + .../coffeescript.json => source.coffee.json} | 0 data/{c/c++.json => source.cpp.json} | 0 data/source.cs.json | 4327 +++++++++++++++++ data/{css/css.json => source.css.json} | 0 data/source.css.less.json | 540 ++ data/source.css.scss.json | 1880 +++++++ data/source.csx.json | 16 + data/source.diff.json | 149 + data/source.gfm.json | 1926 ++++++++ data/source.git-config.json | 126 + data/source.go.json | 675 +++ data/source.gotemplate.json | 118 + ...rties.json => source.java-properties.json} | 0 ...language (el).json => source.java.el.json} | 0 data/{java/java.json => source.java.json} | 0 .../javascript.json => source.js.json} | 0 data/source.js.rails source.js.jquery.json | 48 + ...javascript).json => source.js.regexp.json} | 0 ...json => source.js.regexp.replacement.json} | 0 .../jsdoc.json => source.jsdoc.json} | 0 data/{json/json.json => source.json.json} | 0 ... (literate).json => source.litcoffee.json} | 0 .../{lua/grammar-lua.json => source.lua.json} | 0 data/source.makefile.json | 501 ++ data/source.mod.json | 63 + data/source.objc.json | 997 ++++ data/source.objcpp.json | 17 + data/source.perl.json | 2816 +++++++++++ data/source.perl6.json | 350 ++ data/{php/php.json => source.php.json} | 0 data/source.plist.json | 344 ++ .../python.json => source.python.json} | 0 ...python).json => source.regexp.python.json} | 0 .../gemfile.json => source.ruby.gemfile.json} | 0 data/{ruby/ruby.json => source.ruby.json} | 0 data/source.ruby.rails.json | 196 + data/source.ruby.rails.rjs.json | 12 + data/source.rust.json | 689 +++ data/source.sass.json | 1093 +++++ data/source.sassdoc.json | 348 ++ ...shell-unix-bash.json => source.shell.json} | 0 data/{sql/sql.json => source.sql.json} | 0 data/source.sql.mustache.json | 13 + data/source.sql.ruby.json | 29 + data/source.strings.json | 52 + data/source.sum.json | 19 + data/source.swift.json | 282 ++ .../TypeScript.json => source.ts.json} | 0 .../TypeScriptReact.json => source.tsx.json} | 0 data/source.yaml.json | 462 ++ data/text.git-commit.json | 162 + data/text.git-rebase.json | 48 + data/{html/html.json => text.html.basic.json} | 0 ...l (ruby - erb).json => text.html.erb.json} | 0 data/text.html.gohtml.json | 15 + ...er pages (jsp).json => text.html.jsp.json} | 0 data/text.html.mustache.json | 145 + data/{php/html.json => text.html.php.json} | 0 data/text.html.ruby.json | 50 + .../smarty.json => text.html.smarty.json} | 0 .../textile.json => text.html.textile.json} | 0 data/text.hyperlink.json | 18 + ...eport.json => text.junit-test-report.json} | 0 .../language-markdown.json => text.md.json} | 0 data/text.plain.json | 41 + ...-console.json => text.python.console.json} | 0 ...ceback.json => text.python.traceback.json} | 0 ...l-session.json => text.shell-session.json} | 0 data/text.todo.json | 19 + data/{xml/xml.json => text.xml.json} | 6 +- data/text.xml.plist.json | 691 +++ data/{xml/xsl.json => text.xml.xsl.json} | 0 lib/Grammar.php | 2 +- lib/Tokenizer.php | 3 +- run | 127 +- 115 files changed, 19367 insertions(+), 3180 deletions(-) delete mode 100644 data/graphql/graphql.json delete mode 100644 data/markdown/fixtures/fenced-code.json delete mode 100644 data/markdown/injections/php.json delete mode 100644 data/markdown/repositories/blocks/fenced-code.json delete mode 100644 data/markdown/repositories/blocks/headings.json delete mode 100644 data/markdown/repositories/blocks/hr.json delete mode 100644 data/markdown/repositories/blocks/lists.json delete mode 100644 data/markdown/repositories/blocks/quotes.json delete mode 100644 data/markdown/repositories/flavors/criticmark.json delete mode 100644 data/markdown/repositories/flavors/front-matter.json delete mode 100644 data/markdown/repositories/flavors/github-blocks.json delete mode 100644 data/markdown/repositories/flavors/github-inlines.json delete mode 100644 data/markdown/repositories/flavors/ia-writer.json delete mode 100644 data/markdown/repositories/flavors/markdown-extra.json delete mode 100644 data/markdown/repositories/flavors/math-block.json delete mode 100644 data/markdown/repositories/flavors/math-inline.json delete mode 100644 data/markdown/repositories/flavors/pandoc.json delete mode 100644 data/markdown/repositories/flavors/rmarkdown-attributes.json delete mode 100644 data/markdown/repositories/flavors/rmarkdown.json delete mode 100644 data/markdown/repositories/flavors/special-attribute-elements.json delete mode 100644 data/markdown/repositories/flavors/special-attributes.json delete mode 100644 data/markdown/repositories/inlines/code.json delete mode 100644 data/markdown/repositories/inlines/comments.json delete mode 100644 data/markdown/repositories/inlines/emphasis.json delete mode 100644 data/markdown/repositories/inlines/entities.json delete mode 100644 data/markdown/repositories/inlines/escapes.json delete mode 100644 data/markdown/repositories/inlines/html.json delete mode 100644 data/markdown/repositories/inlines/line-breaks.json delete mode 100644 data/markdown/repositories/inlines/link-destination.json delete mode 100644 data/markdown/repositories/inlines/link-label.json delete mode 100644 data/markdown/repositories/inlines/link-text.json delete mode 100644 data/markdown/repositories/inlines/link-title.json delete mode 100644 data/markdown/repositories/inlines/links.json delete mode 100644 data/markdown/repositories/inlines/liquid.json delete mode 100644 data/markdown/repositories/inlines/references.json delete mode 100644 data/markdown/repositories/inlines/todo.json delete mode 100644 data/markdown/repositories/markdown.json rename data/{applescript/applescript.json => source.applescript.json} (100%) rename data/{c/c.json => source.c.json} (100%) create mode 100644 data/source.cake.json rename data/{coffeescript/coffeescript.json => source.coffee.json} (100%) rename data/{c/c++.json => source.cpp.json} (100%) create mode 100644 data/source.cs.json rename data/{css/css.json => source.css.json} (100%) create mode 100644 data/source.css.less.json create mode 100644 data/source.css.scss.json create mode 100644 data/source.csx.json create mode 100644 data/source.diff.json create mode 100644 data/source.gfm.json create mode 100644 data/source.git-config.json create mode 100644 data/source.go.json create mode 100644 data/source.gotemplate.json rename data/{java/javaproperties.json => source.java-properties.json} (100%) rename data/{java/unified expression language (el).json => source.java.el.json} (100%) rename data/{java/java.json => source.java.json} (100%) rename data/{javascript/javascript.json => source.js.json} (100%) create mode 100644 data/source.js.rails source.js.jquery.json rename data/{javascript/regular expressions (javascript).json => source.js.regexp.json} (100%) rename data/{javascript/regular expression replacement (javascript).json => source.js.regexp.replacement.json} (100%) rename data/{javascript/jsdoc.json => source.jsdoc.json} (100%) rename data/{json/json.json => source.json.json} (100%) rename data/{coffeescript/coffeescript (literate).json => source.litcoffee.json} (100%) rename data/{lua/grammar-lua.json => source.lua.json} (100%) create mode 100644 data/source.makefile.json create mode 100644 data/source.mod.json create mode 100644 data/source.objc.json create mode 100644 data/source.objcpp.json create mode 100644 data/source.perl.json create mode 100644 data/source.perl6.json rename data/{php/php.json => source.php.json} (100%) create mode 100644 data/source.plist.json rename data/{python/python.json => source.python.json} (100%) rename data/{python/regular expressions (python).json => source.regexp.python.json} (100%) rename data/{ruby/gemfile.json => source.ruby.gemfile.json} (100%) rename data/{ruby/ruby.json => source.ruby.json} (100%) create mode 100644 data/source.ruby.rails.json create mode 100644 data/source.ruby.rails.rjs.json create mode 100644 data/source.rust.json create mode 100644 data/source.sass.json create mode 100644 data/source.sassdoc.json rename data/{shell/shell-unix-bash.json => source.shell.json} (100%) rename data/{sql/sql.json => source.sql.json} (100%) create mode 100644 data/source.sql.mustache.json create mode 100644 data/source.sql.ruby.json create mode 100644 data/source.strings.json create mode 100644 data/source.sum.json create mode 100644 data/source.swift.json rename data/{typescript/TypeScript.json => source.ts.json} (100%) rename data/{typescript/TypeScriptReact.json => source.tsx.json} (100%) create mode 100644 data/source.yaml.json create mode 100644 data/text.git-commit.json create mode 100644 data/text.git-rebase.json rename data/{html/html.json => text.html.basic.json} (100%) rename data/{ruby/html (ruby - erb).json => text.html.erb.json} (100%) create mode 100644 data/text.html.gohtml.json rename data/{java/java server pages (jsp).json => text.html.jsp.json} (100%) create mode 100644 data/text.html.mustache.json rename data/{php/html.json => text.html.php.json} (100%) create mode 100644 data/text.html.ruby.json rename data/{smarty/smarty.json => text.html.smarty.json} (100%) rename data/{textile/textile.json => text.html.textile.json} (100%) create mode 100644 data/text.hyperlink.json rename data/{java/junit test report.json => text.junit-test-report.json} (100%) rename data/{markdown/language-markdown.json => text.md.json} (100%) create mode 100644 data/text.plain.json rename data/{python/python-console.json => text.python.console.json} (100%) rename data/{python/python-traceback.json => text.python.traceback.json} (100%) rename data/{shell/shell-session.json => text.shell-session.json} (100%) create mode 100644 data/text.todo.json rename data/{xml/xml.json => text.xml.json} (99%) create mode 100644 data/text.xml.plist.json rename data/{xml/xsl.json => text.xml.xsl.json} (100%) diff --git a/data/graphql/graphql.json b/data/graphql/graphql.json deleted file mode 100644 index 29ec1fe..0000000 --- a/data/graphql/graphql.json +++ /dev/null @@ -1,599 +0,0 @@ -{ - "name": "GraphQL", - "scopeName": "source.graphql", - "foldingStartMarker": "(/\\*|{|\\()", - "foldingEndMarker": "(\\*/|\\}|\\))", - "fileTypes": [ - "prisma", - "graphqls", - "graphql", - "gql" - ], - "patterns": [ - { "include": "#graphql" } - ], - "repository": { - "graphql": { - "patterns": [ - { "include": "#graphql-fragment-definition" }, - { "include": "#graphql-type-interface" }, - { "include": "#graphql-enum" }, - { "include": "#graphql-scalar" }, - { "include": "#graphql-union" }, - { "include": "#graphql-schema" }, - { "include": "#graphql-operation-def" }, - { "include": "#graphql-comment" }, - { "include": "#graphql-directive" }, - { "include": "#graphql-blockstring-value"}, - { "include": "#graphql-string-value"} - ] - }, - "graphql-operation-def": { - "patterns": [ - { "include": "#graphql-query-mutation" }, - { "include": "#graphql-name" }, - { "include": "#graphql-variable-definitions" }, - { "include": "#graphql-directive" }, - { "include": "#graphql-selection-set" } - ] - }, - "graphql-fragment-definition": { - "name": "meta.fragment.graphql", - "begin": "\\s*(?:(\\bfragment\\b)\\s*(?!\\bon\\b)([_A-Za-z][_0-9A-Za-z]*)\\s*(?:(\\bon\\b)\\s*([_A-Za-z][_0-9A-Za-z]*)))", - "end": "(?<=})", - "captures": { - "1": { "name": "keyword.fragment.graphql" }, - "2": { "name": "entity.name.fragment.graphql" }, - "3": { "name": "keyword.on.graphql" }, - "4": { "name": "support.type.graphql" } - }, - "patterns": [ - { "include": "#graphql-comment" }, - { "include": "#graphql-selection-set" }, - { "include": "#graphql-directive" }, - { "include": "#graphql-skip-newlines" } - ] - }, - "graphql-query-mutation": { - "match": "\\s*\\b(query|mutation)\\b", - "captures": { - "1": { "name": "keyword.operation.graphql" } - } - }, - "graphql-type-interface": { - "name": "meta.type.interface.graphql", - "begin": "\\s*\\b(?:(extends)?\\b\\s*\\b(type)|(interface)|(input))\\b\\s*([_A-Za-z][_0-9A-Za-z]*)?", - "end": "(?<=})", - "captures": { - "1": { "name": "keyword.type.graphql"}, - "2": { "name": "keyword.type.graphql"}, - "3": { "name": "keyword.interface.graphql"}, - "4": { "name": "keyword.input.graphql"}, - "5": { "name": "support.type.graphql"} - }, - "patterns": [ - { - "match": "\\s*(?:\\b(implements)\\b|(&))\\s*([_A-Za-z][_0-9A-Za-z]*)", - "captures": { - "1": { "name": "keyword.implements.graphql" }, - "2": { "name": "keyword.implements.graphql" }, - "3": { "name": "support.type.graphql" } - } - }, - { "include": "#graphql-comment" }, - { "include": "#graphql-directive" }, - { "include": "#graphql-type-object" } - ] - }, - "graphql-type-object": { - "name": "meta.type.object.graphql", - "begin": "\\s*({)", - "end": "\\s*(})", - "beginCaptures": { - "1": { "name": "punctuation.operation.graphql"} - }, - "endCaptures": { - "1": { "name": "punctuation.operation.graphql"} - }, - "patterns": [ - { "include": "#graphql-object-type" }, - { "include": "#graphql-comment" }, - { "include": "#graphql-type-definition" }, - { "include": "#graphql-blockstring-value"}, - { "include": "#graphql-string-value"} - ] - }, - "graphql-type-definition": { - "comment": "key (optionalArgs): Type", - "begin": "\\s*([_A-Za-z][_0-9A-Za-z]*)(?=\\s*\\(|:)", - "end": "(?=\\s*(([_A-Za-z][_0-9A-Za-z]*)\\s*(\\(|:)|(})))|\\s*(,)", - "beginCaptures": { - "1": { "name": "variable.graphql" } - }, - "endCaptures": { - "5": { "name": "punctuation.comma.graphql" } - }, - "patterns": [ - { "include": "#graphql-directive" }, - { "include": "#graphql-comment" }, - { "include": "#graphql-variable-definitions" }, - { "include": "#graphql-type-object" }, - { "include": "#graphql-colon"}, - { "include": "#graphql-input-types"} - ] - }, - "graphql-schema": { - "begin": "\\s*\\b(schema)\\b", - "end": "(?<=})", - "beginCaptures": { - "1": { "name": "keyword.schema.graphql" } - }, - "patterns": [ - { - "begin": "\\s*({)", - "end": "\\s*(})", - "beginCaptures": { - "1": { "name": "punctuation.operation.graphql"} - }, - "endCaptures": { - "1": { "name": "punctuation.operation.graphql"} - }, - "patterns": [ - { - "begin": "\\s*([_A-Za-z][_0-9A-Za-z]*)(?=\\s*\\(|:)", - "end": "(?=\\s*(([_A-Za-z][_0-9A-Za-z]*)\\s*(\\(|:)|(})))|\\s*(,)", - "beginCaptures": { - "1": { "name": "variable.arguments.graphql" } - }, - "endCaptures": { - "5": { "name": "punctuation.comma.graphql" } - }, - "patterns": [ - { - "match": "\\s*([_A-Za-z][_0-9A-Za-z]*)", - "captures": { - "1": { "name": "support.type.graphql" } - } - }, - { "include": "#graphql-colon" }, - { "include": "#graphql-comment" }, - { "include": "#graphql-directive" }, - { "include": "#graphql-skip-newlines" } - ] - }, - { "include": "#graphql-comment" }, - { "include": "#graphql-skip-newlines" } - ] - }, - { "include": "#graphql-directive" }, - { "include": "#graphql-comment" }, - { "include": "#graphql-skip-newlines" } - ] - }, - "graphql-comment": { - "comment": "need to prefix comment space with a scope else Atom's reflow cmd doesn't work", - "name": "comment.line.graphql.js", - "match": "(\\s*)(#).*", - "captures": { - "1": { "name": "punctuation.whitespace.comment.leading.graphql" } - } - }, - "graphql-variable-definitions": { - "begin": "\\s*(\\()", - "end": "\\s*(\\))", - "captures": { - "1": { "name": "meta.brace.round.graphql"} - }, - "patterns": [ - { "include": "#graphql-comment" }, - { "include": "#graphql-variable-definition"}, - { "include": "#graphql-blockstring-value"}, - { "include": "#graphql-string-value"} - ] - }, - "graphql-variable-definition": { - "comment": "variable: type = value,.... which may be a list", - "name": "meta.variables.graphql", - "begin": "\\s*(\\$?[_A-Za-z][_0-9A-Za-z]*)(?=\\s*\\(|:)", - "end": "(?=\\s*((\\$?[_A-Za-z][_0-9A-Za-z]*)\\s*(\\(|:)|(}|\\))))|\\s*(,)", - "beginCaptures": { - "1": { "name": "variable.graphql" } - }, - "endCaptures": { - "5": { "name": "punctuation.comma.graphql" } - }, - "patterns": [ - { "include": "#graphql-comment" }, - { "include": "#graphql-colon" }, - { "include": "#graphql-input-types"}, - { "include": "#graphql-variable-assignment"}, - { "include": "#graphql-skip-newlines" } - ] - }, - "graphql-input-types": { - "patterns": [ - { "include": "#graphql-scalar-type" }, - { - "match": "\\s*([_A-Za-z][_0-9A-Za-z]*)(?:\\s*(!))?", - "captures": { - "1": { "name": "support.type.graphql" }, - "2": { "name": "keyword.operator.nulltype.graphql" } - } - }, - { - "name": "meta.type.list.graphql", - "begin": "\\s*(\\[)", - "end": "\\s*(\\])(?:\\s*(!))?", - "captures": { - "1": { "name": "meta.brace.squart.graphql" }, - "2": { "name": "keyword.operator.nulltype.graphql" } - }, - "patterns": [ - { "include": "#graphql-input-types" }, - { "include": "#graphql-comment" }, - { "include": "#graphql-comma" } - ] - } - ] - }, - "graphql-scalar": { - "match": "\\s*\\b(scalar)\\b\\s*([_A-Za-z][_0-9A-Za-z]*)", - "captures": { - "1": { "name": "keyword.scalar.graphql" }, - "2": { "name": "entity.scalar.graphql" } - } - }, - "graphql-scalar-type": { - "match": "\\s*\\b(Int|Float|String|Boolean|ID)\\b(?:\\s*(!))?", - "captures": { - "1": { "name": "support.type.builtin.graphql" }, - "2": { "name": "keyword.operator.nulltype.graphql" } - } - }, - "graphql-variable-assignment": { - "begin": "\\s(=)", - "end": "(?=.)", - "applyEndPatternLast": 1, - "beginCaptures": { - "1": { "name": "punctuation.assignment.graphql" } - }, - "patterns": [ - { "include": "#graphql-value" } - ] - }, - "graphql-comma": { - "match": "\\s*(,)", - "captures": { - "1": { "name": "punctuation.comma.graphql" } - } - }, - "graphql-colon": { - "match": "\\s*(:)", - "captures": { - "1": { "name": "punctuation.colon.graphql" } - } - }, - "graphql-union-mark": { - "match": "\\s*(\\|)", - "captures": { - "1": { "name": "punctuation.union.graphql" } - } - }, - "graphql-name": { - "match": "\\s*([_A-Za-z][_0-9A-Za-z]*)", - "captures": { - "1": { "name": "entity.name.function.graphql" } - } - }, - "graphql-directive": { - "begin": "\\s*((@)\\s*([_A-Za-z][_0-9A-Za-z]*))", - "end": "(?=.)", - "applyEndPatternLast": 1, - "beginCaptures": { - "1": { "name": "entity.name.function.directive.graphql" } - }, - "patterns": [ - { "include": "#graphql-arguments"}, - { "include": "#graphql-comment" }, - { "include": "#graphql-skip-newlines" } - ] - }, - "graphql-selection-set": { - "name": "meta.selectionset.graphql", - "begin": "\\s*({)", - "end": "\\s*(})", - "beginCaptures": { - "1": { "name": "punctuation.operation.graphql"} - }, - "endCaptures": { - "1": { "name": "punctuation.operation.graphql"} - }, - "patterns": [ - { "include": "#graphql-field" }, - { "include": "#graphql-fragment-spread" }, - { "include": "#graphql-inline-fragment" }, - { "include": "#graphql-comma" }, - { "include": "#graphql-comment" } - ] - }, - "graphql-field": { - "patterns": [ - { - "match": "\\s*([_A-Za-z][_0-9A-Za-z]*)\\s*(:)", - "captures": { - "1": { "name": "string.unquoted.alias.graphql" }, - "2": { "name": "punctuation.colon.graphql" } - } - }, - { - "match": "\\s*([_A-Za-z][_0-9A-Za-z]*)", - "captures": { - "1": { "name": "variable.graphql" } - } - }, - { "include": "#graphql-arguments" }, - { "include": "#graphql-directive" }, - { "include": "#graphql-selection-set" }, - { "include": "#graphql-skip-newlines" } - ] - }, - "graphql-fragment-spread": { - "begin": "\\s*(\\.\\.\\.)\\s*(?!\\bon\\b)([_A-Za-z][_0-9A-Za-z]*)", - "end": "(?=.)", - "applyEndPatternLast": 1, - "captures": { - "1": { "name": "keyword.operator.spread.graphql" }, - "2": { "name": "variable.fragment.graphql" } - }, - "patterns": [ - { "include": "#graphql-comment" }, - { "include": "#graphql-selection-set" }, - { "include": "#graphql-directive" }, - { "include": "#graphql-skip-newlines" } - ] - }, - "graphql-inline-fragment": { - "begin": "\\s*(\\.\\.\\.)\\s*(?:(\\bon\\b)\\s*([_A-Za-z][_0-9A-Za-z]*))?", - "end": "(?=.)", - "applyEndPatternLast": 1, - "captures": { - "1": { "name": "keyword.operator.spread.graphql" }, - "2": { "name": "keyword.on.graphql" }, - "3": { "name": "support.type.graphql" } - }, - "patterns": [ - { "include": "#graphql-comment" }, - { "include": "#graphql-selection-set" }, - { "include": "#graphql-directive" }, - { "include": "#graphql-skip-newlines" } - ] - }, - "graphql-arguments": { - "name": "meta.arguments.graphql", - "begin": "\\s*(\\()", - "end": "\\s*(\\))", - "beginCaptures": { - "1": { "name": "meta.brace.round.directive.graphql" } - }, - "endCaptures": { - "1": { "name": "meta.brace.round.directive.graphql" } - }, - "patterns": [ - { "include": "#graphql-comment" }, - { - "begin": "\\s*([_A-Za-z][_0-9A-Za-z]*)(?:\\s*(:))?", - "end": "(?=\\s*(?:(?:([_A-Za-z][_0-9A-Za-z]*)\\s*(:))|\\)))|\\s*(,)", - "beginCaptures": { - "1": { "name": "variable.arguments.graphql" }, - "2": { "name": "punctuation.colon.graphql" } - }, - "endCaptures": { - "3": { "name": "punctuation.comma.graphql" } - }, - "patterns": [ - { "include": "#graphql-value" }, - { "include": "#graphql-comment" }, - { "include": "#graphql-skip-newlines" } - ] - } - ] - }, - "graphql-variable-name": { - "match": "\\s*(\\$[_A-Za-z][_0-9A-Za-z]*)", - "captures": { - "1": { "name": "variable.graphql" } - } - }, - "graphql-int-value": { - "match": "\\s*((-)?(0|[1-9][0-9]*))", - "captures": { - "1": { "name": "constant.int.graphql" } - } - }, - "graphql-float-value": { - "match": "\\s*((-)?(0|([1-9]\\d*)(\\.\\d*)?((e|E)(\\+|-)?\\d*)?))", - "captures": { - "1": { "name": "constant.float.graphql" } - } - }, - "graphql-boolean-value": { - "match": "\\s*\\b(true|false)\\b", - "captures": { - "1": { "name": "constant.boolean.graphql" } - } - }, - "graphql-blockstring-value": { - "contentName": "string.quoted.block.graphql", - "begin": "\\s*+((\"\"\"))", - "end": "\\s*+(?:((\"\"\")))", - "beginCaptures": { - "1": { "name": "string.quoted.block.graphql" }, - "2": { "name": "punctuation.definition.string.begin.graphql" } - }, - "endCaptures": { - "1": { "name": "string.quoted.block.graphql" }, - "2": { "name": "punctuation.definition.string.end.graphql" } - }, - "patterns": [ - { "include": "#graphql-string-content" } - ] - }, - "graphql-string-value": { - "contentName": "string.quoted.double.graphql", - "begin": "\\s*+((\"))", - "end": "\\s*+(?:((\"))|(\n))", - "beginCaptures": { - "1": { "name": "string.quoted.double.graphql" }, - "2": { "name": "punctuation.definition.string.begin.graphql" } - }, - "endCaptures": { - "1": { "name": "string.quoted.double.graphql" }, - "2": { "name": "punctuation.definition.string.end.graphql" }, - "3": { "name": "invalid.illegal.newline.graphql" } - }, - "patterns": [ - { "include": "#graphql-string-content" } - ] - }, - "graphql-string-content": { - "patterns": [ - { "name": "constant.character.escape.graphql", - "match": "\\\\[/'\"\\\\nrtbf]" - }, - { "name": "constant.character.escape.graphql", - "match": "\\\\u([0-9a-fA-F]{4})" - } - ] - }, - "graphql-enum": { - "name": "meta.enum.graphql", - "begin": "\\s*+\\b(enum)\\b\\s*([_A-Za-z][_0-9A-Za-z]*)", - "end": "(?<=})", - "beginCaptures": { - "1": { "name": "keyword.enum.graphql" }, - "2": { "name": "support.type.enum.graphql" } - }, - "patterns": [ - { - "name": "meta.type.object.graphql", - "begin": "\\s*({)", - "end": "\\s*(})", - "beginCaptures": { - "1": { "name": "punctuation.operation.graphql"} - }, - "endCaptures": { - "1": { "name": "punctuation.operation.graphql"} - }, - "patterns": [ - { "include": "#graphql-object-type" }, - { "include": "#graphql-comment" }, - { "include": "#graphql-enum-value" }, - { "include": "#graphql-blockstring-value"}, - { "include": "#graphql-string-value"} - ] - } - ] - }, - "graphql-enum-value": { - "name": "constant.character.enum.graphql", - "match":"\\s*(?!=\\b(true|false|null)\\b)([_A-Za-z][_0-9A-Za-z]*)" - }, - "graphql-value":{ - "patterns": [ - { "include": "#graphql-variable-name" }, - { "include": "#graphql-float-value" }, - { "include": "#graphql-int-value" }, - { "include": "#graphql-blockstring-value" }, - { "include": "#graphql-string-value" }, - { "include": "#graphql-boolean-value" }, - { "include": "#graphql-enum-value" }, - { "include": "#graphql-list-value" }, - { "include": "#graphql-object-value" }, - { "include": "#graphql-comment" }, - { "include": "#literal-quasi-embedded" } - ] - }, - "graphql-list-value": { - "patterns": [ - { - "name": "meta.listvalues.graphql", - "begin": "\\s*+(\\[)", - "end": "\\s*(\\])", - "endCaptures": { - "1": { "name": "meta.brace.square.graphql" } - }, - "beginCaptures": { - "1": { "name": "meta.brace.square.graphql" } - }, - "patterns": [ - { "include": "#graphql-value" } - ] - } - ] - }, - "graphql-object-value": { - "patterns": [ - { - "name": "meta.objectvalues.graphql", - "begin": "\\s*+({)", - "end": "\\s*(})", - "endCaptures": { - "1": { "name": "meta.brace.curly.graphql" } - }, - "beginCaptures": { - "1": { "name": "meta.brace.curly.graphql" } - }, - "patterns": [ - { "include": "#graphql-object-field" }, - { "include": "#graphql-value" } - ] - } - ] - }, - "graphql-object-field": { - "match": "\\s*(([_A-Za-z][_0-9A-Za-z]*))\\s*(:)", - "captures": { - "1": { "name": "constant.object.key.graphql" }, - "2": { "name": "string.unquoted.graphql" }, - "3": { "name": "punctuation.graphql" } - } - }, - "graphql-union": { - "begin": "\\s*\\b(union)\\b\\s*([_A-Za-z][_0-9A-Za-z]*)", - "end": "(?=.)", - "applyEndPatternLast": 1, - "captures": { - "1": { "name": "keyword.union.graphql" }, - "2": { "name": "support.type.graphql" } - }, - "patterns": [ - { - "begin": "\\s*(=)\\s*([_A-Za-z][_0-9A-Za-z]*)", - "end": "(?=.)", - "applyEndPatternLast": 1, - "captures": { - "1": { "name": "punctuation.assignment.graphql" }, - "2": { "name": "support.type.graphql" } - }, - "patterns": [ - { "include": "#graphql-skip-newlines" }, - { "include": "#graphql-comment" }, - { - "match": "\\s*(\\|)\\s*([_A-Za-z][_0-9A-Za-z]*)", - "captures": { - "1": { "name": "punctuation.or.graphql" }, - "2": { "name": "support.type.graphql" } - } - } - ] - }, - { "include": "#graphql-skip-newlines" }, - { "include": "#graphql-comment" }, - { "include": "#literal-quasi-embedded" } - ] - }, - "graphql-skip-newlines": { - "match": "\\s*\n" - } - } -} diff --git a/data/markdown/fixtures/fenced-code.json b/data/markdown/fixtures/fenced-code.json deleted file mode 100644 index 8dfe6dd..0000000 --- a/data/markdown/fixtures/fenced-code.json +++ /dev/null @@ -1,216 +0,0 @@ -{ - "scopeName": "fenced-code.md", - "list": [ - { - "pattern": "apib|apiblueprint", - "include": "text.html.markdown.source.gfm.apib", - "contentName": "source.embedded.gfm.apib" - }, - { - "pattern": "ass" - }, - { - "pattern": "babel", - "include": "source.js.jsx", - "contentName": "source.embedded.js.jsx" - }, - { - "pattern": "coffee|coffeescript|coffee-script", - "include": "source.coffee", - "contentName": "source.embedded.coffee" - }, - { - "pattern": "c" - }, - { - "pattern": "clean" - }, - { - "pattern": "clojure" - }, - { - "pattern": "cpp|c\\+\\+", - "include": "source.cpp", - "contentName": "source.embedded.cpp" - }, - { - "pattern": "cr|crystal", - "include": "source.crystal", - "contentName": "source.embedded.crystal" - }, - { - "pattern": "cs|csharp", - "include": "source.cs", - "contentName": "source.embedded.cs" - }, - { - "pattern": "css" - }, - { - "pattern": "diff|patch|rej", - "include": "source.diff", - "contentName": "source.embedded.diff" - }, - { - "pattern": "elixir" - }, - { - "pattern": "elm" - }, - { - "pattern": "erlang" - }, - { - "pattern": "go|golang", - "include": "source.go", - "contentName": "source.embedded.go" - }, - { - "pattern": "haskell" - }, - { - "pattern": "hcl" - }, - { - "pattern": "html", - "include": "text.html.basic", - "contentName": "source.embedded.html" - }, - { - "pattern": "idris" - }, - { - "pattern": "java" - }, - { - "pattern": "javascript|js|jsx", - "include": "source.js", - "contentName": "source.embedded.js" - }, - { - "pattern": "json|har", - "include": "source.json", - "contentName": "source.embedded.json" - }, - { - "pattern": "julia|julia-repl", - "include": "source.julia", - "contentName": "source.embedded.julia" - }, - { - "pattern": "kotlin|kt|kts", - "include": "source.kotlin", - "contentName": "source.embedded.kotlin" - }, - { - "pattern": "latex|tex", - "include": "text.tex.latex", - "contentName": "text.embedded.latex" - }, - { - "pattern": "less", - "include": "source.css.less", - "contentName": "source.embedded.css.less" - }, - { - "pattern": "lua" - }, - { - "pattern": "make|makefile", - "include": "source.makefile", - "contentName": "source.embedded.makefile" - }, - { - "pattern": "markdown|mdown|md", - "include": "text.md", - "contentName": "text.embedded.md" - }, - { - "pattern": "m|mathematica", - "include": "source.mathematica", - "contentName": "source.embedded.mathematica" - }, - { - "pattern": "mermaid" - }, - { - "pattern": "mson", - "include": "text.html.markdown.source.gfm.mson", - "contentName": "source.embedded.mson" - }, - { - "pattern": "objc|objective-c", - "include": "source.objc", - "contentName": "source.embedded.objc" - }, - { - "pattern": "php", - "include": "text.html.php", - "contentName": "source.embedded.text.html.php" - }, - { - "pattern": "py|python", - "include": "source.python", - "contentName": "source.embedded.python" - }, - { - "pattern": "r" - }, - { - "pattern": "ruby" - }, - { - "pattern": "rust|rs", - "include": "source.rust", - "contentName": "source.embedded.rust" - }, - { - "pattern": "sas" - }, - { - "pattern": "sass" - }, - { - "pattern": "scss", - "include": "source.css.scss", - "contentName": "source.embedded.css.scss" - }, - { - "pattern": "sh|bash", - "include": "source.shell", - "contentName": "source.embedded.shell" - }, - { - "pattern": "shellsession|console", - "include": "text.shell-session", - "contentName": "text.embedded.shell-session" - }, - { - "pattern": "sql" - }, - { - "pattern": "stata" - }, - { - "pattern": "swift" - }, - { - "pattern": "ts|typescript", - "include": "source.ts", - "contentName": "source.embedded.ts" - }, - { - "pattern": "xml", - "include": "text.xml", - "contentName": "text.embedded.xml" - }, - { - "pattern": "yaml" - }, - { - "pattern": "[a-zA-Z0-9-_]+", - "include": "source", - "contentName": "source.embedded" - } - ] -} diff --git a/data/markdown/injections/php.json b/data/markdown/injections/php.json deleted file mode 100644 index b196258..0000000 --- a/data/markdown/injections/php.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "key": "source.embedded.text.html.php - (meta.embedded | meta.tag), L:source.embedded.text.html.php meta.tag, L:embedded.source.js.embedded.html", - "patterns": [ - { - "begin": "(^\\s*)(?=<\\?(?![^?]*\\?>))", - "beginCaptures": { - "0": { - "name": "punctuation.whitespace.embedded.leading.php" - } - }, - "end": "(?!\\G)(\\s*$)?", - "endCaptures": { - "0": { - "name": "punctuation.whitespace.embedded.trailing.php" - } - }, - "patterns": [ - { - "begin": "<\\?(?i:php|=)?", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.php" - } - }, - "contentName": "source.php", - "end": "(\\?)>", - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.php" - }, - "1": { - "name": "source.php" - } - }, - "name": "meta.embedded.block.php", - "patterns": [ - { - "include": "text.html.php#language" - } - ] - } - ] - }, - { - "begin": "<\\?(?i:php|=)?(?![^?]*\\?>)", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.php" - } - }, - "contentName": "source.php", - "end": "(\\G)>", - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.php" - }, - "1": { - "name": "source.php" - } - }, - "name": "meta.embedded.block.php", - "patterns": [ - { - "include": "text.html.php#language" - } - ] - }, - { - "begin": "<\\?(?i:php|=)?", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.php" - } - }, - "end": ">", - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.php" - } - }, - "name": "meta.embedded.line.php", - "patterns": [ - { - "captures": { - "1": { - "name": "source.php" - }, - "2": { - "name": "punctuation.section.embedded.end.php" - }, - "3": { - "name": "source.php" - } - }, - "match": "\\G(\\s*)((\\?))(?=>)", - "name": "meta.special.empty-tag.php" - }, - { - "begin": "\\G", - "contentName": "source.php", - "end": "(\\?)(?=>)", - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.php" - }, - "1": { - "name": "source.php" - } - }, - "patterns": [ - { - "include": "text.html.php#language" - } - ] - } - ] - } - ] -} diff --git a/data/markdown/repositories/blocks/fenced-code.json b/data/markdown/repositories/blocks/fenced-code.json deleted file mode 100644 index 7552576..0000000 --- a/data/markdown/repositories/blocks/fenced-code.json +++ /dev/null @@ -1,37 +0,0 @@ -{ - "key": "fenced-code", - "patterns": [ - { - "begin": "^\\s{0,3}([`]{3,})$", - "beginCaptures": { - "1": { - "name": "punctuation.md" - } - }, - "end": "^\\s{0,3}(\\1)$", - "endCaptures": { - "1": { - "name": "punctuation.md" - } - }, - "name": "fenced.code.md", - "contentName": "source.embedded" - }, - { - "begin": "^\\s{0,3}([~]{3,})$", - "beginCaptures": { - "1": { - "name": "punctuation.md" - } - }, - "end": "^\\s{0,3}(\\1)$", - "endCaptures": { - "1": { - "name": "punctuation.md" - } - }, - "name": "fenced.code.md", - "contentName": "source.embedded" - } - ] -} diff --git a/data/markdown/repositories/blocks/headings.json b/data/markdown/repositories/blocks/headings.json deleted file mode 100644 index f70c449..0000000 --- a/data/markdown/repositories/blocks/headings.json +++ /dev/null @@ -1,259 +0,0 @@ -{ - "key": "headings", - "patterns": [ - { - "match": "^(?:[ ]{0,3})((?:#{1,6})\\s*(?:#*)\\s*)$", - "name": "empty.heading.markup.md", - "captures": { - "1": { - "patterns": [ - { - "match": "^(#{6})\\s*(#*)\\s*$", - "name": "heading-6.md", - "captures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "name": "punctuation.md" - } - } - }, - { - "match": "^(#{5})\\s*(#*)\\s*$", - "name": "heading-5.md", - "captures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "name": "punctuation.md" - } - } - }, - { - "match": "^(#{4})\\s*(#*)\\s*$", - "name": "heading-4.md", - "captures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "name": "punctuation.md" - } - } - }, - { - "match": "^(#{3})\\s*(#*)\\s*$", - "name": "heading-3.md", - "captures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "name": "punctuation.md" - } - } - }, - { - "match": "^(#{2})\\s*(#*)\\s*$", - "name": "heading-2.md", - "captures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "name": "punctuation.md" - } - } - }, - { - "match": "^(#{1})\\s*(#*)\\s*$", - "name": "heading-1.md", - "captures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "name": "punctuation.md" - } - } - } - ] - } - } - }, - { - "match": "^((?: {0,3})(?:#{1,6})(?: +)(?:.+))$", - "name": "heading.markup.md", - "captures": { - "1": { - "patterns": [ - { - "begin": "^(?: {0,3})(#{1})(?: +)", - "end": "(?: ){1}(#*)(?:\\s*)(?:(\\{[[:ascii:]]*\\}))?$", - "name": "heading-1.md", - "beginCaptures": { - "1": { - "name": "punctuation.md" - } - }, - "endCaptures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "patterns": [ - { - "include": "#special-attributes" - } - ] - } - }, - "patterns": [ - { - "include": "#inlines-in-blocks" - } - ] - }, - { - "begin": "^(?: {0,3})(#{2})(?: +)", - "end": "(?: ){1}(#*)(?:\\s*)(?:(\\{[[:ascii:]]*\\}))?$", - "name": "heading-2.md", - "beginCaptures": { - "1": { - "name": "punctuation.md" - } - }, - "endCaptures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "patterns": [ - { - "include": "#special-attributes" - } - ] - } - }, - "patterns": [ - { - "include": "#inlines-in-blocks" - } - ] - }, - { - "begin": "^(?: {0,3})(#{3})(?: +)", - "end": "(?: ){1}(#*)(?:\\s*)(?:(\\{[[:ascii:]]*\\}))?$", - "name": "heading-3.md", - "beginCaptures": { - "1": { - "name": "punctuation.md" - } - }, - "endCaptures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "patterns": [ - { - "include": "#special-attributes" - } - ] - } - }, - "patterns": [ - { - "include": "#inlines-in-blocks" - } - ] - }, - { - "begin": "^(?: {0,3})(#{4})(?: +)", - "end": "(?: ){1}(#*)(?:\\s*)(?:(\\{[[:ascii:]]*\\}))?$", - "name": "heading-4.md", - "beginCaptures": { - "1": { - "name": "punctuation.md" - } - }, - "endCaptures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "patterns": [ - { - "include": "#special-attributes" - } - ] - } - }, - "patterns": [ - { - "include": "#inlines-in-blocks" - } - ] - }, - { - "begin": "^(?: {0,3})(#{5})(?: +)", - "end": "(?: ){1}(#*)(?:\\s*)(?:(\\{[[:ascii:]]*\\}))?$", - "name": "heading-5.md", - "beginCaptures": { - "1": { - "name": "punctuation.md" - } - }, - "endCaptures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "patterns": [ - { - "include": "#special-attributes" - } - ] - } - }, - "patterns": [ - { - "include": "#inlines-in-blocks" - } - ] - }, - { - "begin": "^(?: {0,3})(#{6})(?: +)", - "end": "(?: ){1}(#*)(?:\\s*)(?:(\\{[[:ascii:]]*\\}))?$", - "name": "heading-6.md", - "beginCaptures": { - "1": { - "name": "punctuation.md" - } - }, - "endCaptures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "patterns": [ - { - "include": "#special-attributes" - } - ] - } - }, - "patterns": [ - { - "include": "#inlines-in-blocks" - } - ] - } - ] - } - } - } - ] -} diff --git a/data/markdown/repositories/blocks/hr.json b/data/markdown/repositories/blocks/hr.json deleted file mode 100644 index c4930da..0000000 --- a/data/markdown/repositories/blocks/hr.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "key": "hr", - "patterns": [ - { - "name": "hr.constant.md", - "match": "^[ ]{0,3}[-]{1,} *[-]{1,} *[-]{1,}[ -]*$" - }, - { - "name": "hr.constant.md", - "match": "^[ ]{0,3}[*]{1,} *[*]{1,} *[*]{1,}[ *]*$" - }, - { - "name": "hr.constant.md", - "match": "^[ ]{0,3}[_]{1,} *[_]{1,} *[_]{1,}[ _]*$" - } - ] -} diff --git a/data/markdown/repositories/blocks/lists.json b/data/markdown/repositories/blocks/lists.json deleted file mode 100644 index bfa7d9d..0000000 --- a/data/markdown/repositories/blocks/lists.json +++ /dev/null @@ -1,155 +0,0 @@ -{ - "key": "lists", - "patterns": [ - { - "match": "^(?:\\s*)([-+\\*] \\[ \\]\\s?)$", - "name": "empty.task.unordered.list.markup.md", - "captures": { - "1": { - "name": "punctuation.md" - } - } - }, - { - "match": "^(?:\\s*)([0-9]{1,9}[\\.\\)] \\[ \\]\\s)$", - "name": "empty.task.ordered.list.markup.md", - "captures": { - "1": { - "name": "punctuation.md" - } - } - }, - { - "match": "^(?:\\s*)([-+\\*]{1}\\s?)$", - "name": "empty.unordered.list.markup.md", - "captures": { - "1": { - "name": "punctuation.md" - } - } - }, - { - "match": "^(?:\\s*)([0-9]{1,9}[\\.\\)]\\s?)$", - "name": "empty.ordered.list.markup.md", - "captures": { - "1": { - "name": "punctuation.md" - } - } - }, - { - "match": "^(?:\\s*)([-+\\*] \\[ \\]\\s)(.*)$", - "name": "task.unordered.list.markup.md", - "captures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "patterns": [ - { - "include": "#blocks" - }, - { - "include": "#inlines-in-blocks" - } - ] - } - } - }, - { - "match": "^(?:\\s*)([0-9]{1,9}[\\.\\)] \\[ \\]\\s)(.*)$", - "name": "task.ordered.list.markup.md", - "captures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "patterns": [ - { - "include": "#blocks" - }, - { - "include": "#inlines-in-blocks" - } - ] - } - } - }, - { - "match": "^(?:\\s*)([-+\\*] \\[[xX]\\]\\s)(.*)$", - "name": "completed.task.unordered.list.markup.md", - "captures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "patterns": [ - { - "include": "#blocks" - }, - { - "include": "#inlines-in-blocks" - } - ] - } - } - }, - { - "match": "^(?:\\s*)([0-9]{1,9}[\\.\\)] \\[[xX]\\]\\s)(.*)$", - "name": "completed.task.ordered.list.markup.md", - "captures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "patterns": [ - { - "include": "#blocks" - }, - { - "include": "#inlines-in-blocks" - } - ] - } - } - }, - { - "match": "^(?:\\s*)([-+\\*]{1}\\s)(.*)$", - "name": "unordered.list.markup.md", - "captures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "patterns": [ - { - "include": "#blocks" - }, - { - "include": "#inlines-in-blocks" - } - ] - } - } - }, - { - "match": "^(?:\\s*)([0-9]{1,9}[\\.\\)]\\s)(.*)$", - "name": "ordered.list.markup.md", - "captures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "patterns": [ - { - "include": "#blocks" - }, - { - "include": "#inlines-in-blocks" - } - ] - } - } - } - ] -} diff --git a/data/markdown/repositories/blocks/quotes.json b/data/markdown/repositories/blocks/quotes.json deleted file mode 100644 index efd2385..0000000 --- a/data/markdown/repositories/blocks/quotes.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "key": "quotes", - "patterns": [ - { - "match": "^(?: {0,3})(>){1}(?: ){0,1}(.*)$", - "name": "quote.markup.md", - "captures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "patterns": [ - { - "include": "#blocks" - }, - { - "include": "#inlines-in-blocks" - } - ] - } - } - } - ] -} diff --git a/data/markdown/repositories/flavors/criticmark.json b/data/markdown/repositories/flavors/criticmark.json deleted file mode 100644 index 44b662d..0000000 --- a/data/markdown/repositories/flavors/criticmark.json +++ /dev/null @@ -1,120 +0,0 @@ -{ - "key": "criticmark", - "patterns": [ - { - "name": "addition.critic.inserted.markup.md", - "begin": "({\\+\\+)", - "beginCaptures": { - "1": { - "name": "punctuation.md" - } - }, - "end": "(\\+\\+})", - "endCaptures": { - "1": { - "name": "punctuation.md" - } - }, - "patterns": [ - { - "include": "#emphasis" - } - ] - }, - { - "name": "deletion.critic.deleted.markup.md", - "begin": "({--)", - "beginCaptures": { - "1": { - "name": "punctuation.md" - } - }, - "end": "(--})", - "endCaptures": { - "1": { - "name": "punctuation.md" - } - }, - "patterns": [ - { - "include": "#emphasis" - } - ] - }, - { - "name": "highlight.critic.changed.markup.md", - "begin": "({==)", - "beginCaptures": { - "1": { - "name": "punctuation.md" - } - }, - "end": "(==})", - "endCaptures": { - "1": { - "name": "punctuation.md" - } - }, - "patterns": [ - { - "include": "#emphasis" - } - ] - }, - { - "name": "comment.critic.markup.md", - "begin": "({>>)", - "beginCaptures": { - "1": { - "name": "punctuation.md" - } - }, - "patterns": [ - { - "match": "(?<=[\\s|>])((@)(\\w[-\\w:]*))(?=[\\s|:|<])", - "captures": { - "1": { - "name": "username.reference.variable.md" - }, - "2": { - "name": "punctuation.md" - } - } - }, - { - "include": "#emphasis" - } - ], - "end": "(<<})", - "endCaptures": { - "1": { - "name": "punctuation.md" - } - } - }, - { - "name": "substitution.critic.inserted.markup.md", - "begin": "({~~)", - "beginCaptures": { - "1": { - "name": "punctuation.md" - } - }, - "end": "(~~})", - "endCaptures": { - "1": { - "name": "punctuation.md" - } - }, - "patterns": [ - { - "match": "~>", - "name": "punctuation.md" - }, - { - "include": "#emphasis" - } - ] - } - ] -} diff --git a/data/markdown/repositories/flavors/front-matter.json b/data/markdown/repositories/flavors/front-matter.json deleted file mode 100644 index fc2a2d9..0000000 --- a/data/markdown/repositories/flavors/front-matter.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "key": "front-matter", - "patterns": [ - { - "begin": "\\A---$", - "beginCaptures": { - "0": { - "name": "hr.constant.md" - } - }, - "end": "^(---|\\.\\.\\.)$", - "endCaptures": { - "1": { - "name": "hr.constant.md" - } - }, - "name": "front-matter.yaml.source.md", - "patterns": [ - { - "include": "source.yaml" - } - ] - }, - { - "begin": "\\A\\+\\+\\+$", - "beginCaptures": { - "0": { - "name": "hr.constant.md" - } - }, - "end": "^\\+\\+\\+$", - "endCaptures": { - "0": { - "name": "hr.constant.md" - } - }, - "name": "front-matter.toml.source.md", - "patterns": [ - { - "include": "source.toml" - } - ] - }, - { - "begin": "\\A;{3}$", - "beginCaptures": { - "0": { - "name": "hr.constant.md" - } - }, - "end": "^;{3}$", - "endCaptures": { - "0": { - "name": "hr.constant.md" - } - }, - "name": "front-matter.json.source.md", - "patterns": [ - { - "include": "source.json" - } - ] - } - ] -} diff --git a/data/markdown/repositories/flavors/github-blocks.json b/data/markdown/repositories/flavors/github-blocks.json deleted file mode 100644 index e56b753..0000000 --- a/data/markdown/repositories/flavors/github-blocks.json +++ /dev/null @@ -1,58 +0,0 @@ -{ - "key": "github-blocks", - "patterns": [ - { - "name": "table.storage.md", - "match": "^(\\|(?= |:|-)[ |:-]*?)(\\|?)$", - "captures": { - "1": { - "patterns": [ - { - "match": "(\\|)(?: ?)(:?)(-+)(:?)(?: ?)(?=\\|| |$)", - "captures": { - "1": { - "name": "vertical.punctuation.md" - }, - "2": { - "name": "alignment.punctuation.md" - }, - "3": { - "name": "horizontal.punctuation.md" - }, - "4": { - "name": "alignment.punctuation.md" - } - } - } - ] - }, - "2": { - "name": "vertical.punctuation.md" - } - } - }, - { - "name": "table.storage.md", - "match": "^(\\|)(?= )(.+)$", - "captures": { - "1": { - "name": "vertical.punctuation.md" - }, - "2": { - "patterns": [ - { - "match": "(?<= )\\|(?=$| )", - "name": "vertical.punctuation.md" - }, - { - "include": "#inlines-in-blocks" - } - ] - }, - "3": { - "name": "punctuation.md" - } - } - } - ] -} diff --git a/data/markdown/repositories/flavors/github-inlines.json b/data/markdown/repositories/flavors/github-inlines.json deleted file mode 100644 index 5e3d0c3..0000000 --- a/data/markdown/repositories/flavors/github-inlines.json +++ /dev/null @@ -1,160 +0,0 @@ -{ - "key": "github-inlines", - "patterns": [ - { - "match": "(?<=^|\\s|\"|'|\\(|\\[)((#|GH-)(\\d+))(?=[\\s\"'\\.,;:\\)\\]]|$)", - "captures": { - "1": { - "name": "reference.gfm.variable.md" - }, - "2": { - "name": "punctuation.md" - }, - "3": { - "name": "issue.gfm.md" - } - } - }, - { - "match": "(?)", - "captures": { - "1": { - "name": "punctuation.md" - }, - "3": { - "name": "punctuation.md" - } - } - } - ] -} diff --git a/data/markdown/repositories/inlines/emphasis.json b/data/markdown/repositories/inlines/emphasis.json deleted file mode 100644 index 18c786d..0000000 --- a/data/markdown/repositories/inlines/emphasis.json +++ /dev/null @@ -1,129 +0,0 @@ -{ - "key": "emphasis", - "patterns": [ - { - "match": "(?)$", - "captures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "name": "markup.underline.link" - }, - "3": { - "name": "punctuation.md" - } - } - }, - { - "name": "destination.link.md", - "match": "(.+)", - "captures": { - "1": { - "name": "markup.underline.link" - } - } - } - ] -} diff --git a/data/markdown/repositories/inlines/link-label.json b/data/markdown/repositories/inlines/link-label.json deleted file mode 100644 index d44a690..0000000 --- a/data/markdown/repositories/inlines/link-label.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "key": "link-label", - "patterns": [ - { - "name": "label.link.string.md", - "match": "^(\\*?\\[\\^?)(.*)(\\])$", - "captures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "patterns": [ - { - "include": "#references" - } - ] - }, - "3": { - "name": "punctuation.md" - } - } - } - ] -} diff --git a/data/markdown/repositories/inlines/link-text.json b/data/markdown/repositories/inlines/link-text.json deleted file mode 100644 index ce711e5..0000000 --- a/data/markdown/repositories/inlines/link-text.json +++ /dev/null @@ -1,98 +0,0 @@ -{ - "key": "link-text", - "patterns": [ - { - "name": "text.link.string.md", - "match": "(?x) ^(\\[) ( ( (?:!\\[) (?:[^\\[\\]]*) (?:\\]) ) (\\() ([^ [:cntrl:]]+)? (?: (?:\\s+) ( (?:[\"'\\(]) .*? (?:[\"'\\)]) ) (?:\\s*) )? (\\)) (\\{[[:ascii:]]*\\})? ) (\\])", - "captures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "name": "link.markup.md" - }, - "3": { - "patterns": [ - { - "include": "#link-text" - } - ] - }, - "4": { - "name": "punctuation.md" - }, - "5": { - "patterns": [ - { - "include": "#link-destination" - } - ] - }, - "6": { - "patterns": [ - { - "include": "#link-title" - } - ] - }, - "7": { - "name": "punctuation.md" - }, - "8": { - "patterns": [ - { - "include": "#special-attributes" - } - ] - }, - "9": { - "name": "punctuation.md" - } - } - }, - { - "name": "image.link.string.md", - "match": "^(!\\[)(.*)(\\])$", - "captures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "patterns": [ - { - "include": "#emphasis" - }, - { - "include": "#code" - } - ] - }, - "3": { - "name": "punctuation.md" - } - } - }, - { - "name": "text.link.string.md", - "match": "^(\\[)(.*)(\\])$", - "captures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "patterns": [ - { - "include": "#emphasis" - }, - { - "include": "#code" - } - ] - }, - "3": { - "name": "punctuation.md" - } - } - } - ] -} diff --git a/data/markdown/repositories/inlines/link-title.json b/data/markdown/repositories/inlines/link-title.json deleted file mode 100644 index b7a4669..0000000 --- a/data/markdown/repositories/inlines/link-title.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "key": "link-title", - "patterns": [ - { - "name": "title.link.md", - "match": "^(['|\"])(.*)(\\1)$", - "captures": { - "1": { - "name": "punctuation.md" - }, - "3": { - "name": "punctuation.md" - } - } - }, - { - "name": "title.link.md", - "match": "^(\\()(.*)(\\))$", - "captures": { - "1": { - "name": "punctuation.md" - }, - "3": { - "name": "punctuation.md" - } - } - } - ] -} diff --git a/data/markdown/repositories/inlines/links.json b/data/markdown/repositories/inlines/links.json deleted file mode 100644 index 1b913f9..0000000 --- a/data/markdown/repositories/inlines/links.json +++ /dev/null @@ -1,317 +0,0 @@ -{ - "key": "links", - "patterns": [ - { - "name": "reference.footnote.link.markup.md", - "match": "((?:\\[\\^)(?:[^\\[\\]]+)(?:\\]))(?!:)", - "captures": { - "1": { - "patterns": [ - { - "include": "#link-label" - } - ] - } - } - }, - { - "name": "definition.footnote.link.markup.md", - "match": "((?:\\[\\^)(?:[^\\[\\]]+)(?:\\]))(:)", - "captures": { - "1": { - "patterns": [ - { - "include": "#link-label" - } - ] - }, - "2": { - "name": "punctuation.md" - } - } - }, - { - "name": "link.markup.md", - "match": "(?x) ( (?:\\[) (?: (?: (?:!\\[) (?:[^\\[\\]]*) (?:\\]) ) (?:\\() (?:[^ [:cntrl:]]+)? (?: (?:\\s+) (?: (?:[\"'\\(]) .*? (?:[\"'\\)]) ) (?:\\s*) )? (?:\\)) (?:\\{[[:ascii:]]*\\})? ) (?:\\]) ) (\\() ([^ [:cntrl:]]+)? (?: (?:\\s+) ( (?:[\"'\\(]) .*? (?:[\"'\\)]) ) (?:\\s*) )? (\\)) (\\{[^}]*\\})?", - "captures": { - "1": { - "patterns": [ - { - "include": "#link-text" - } - ] - }, - "2": { - "name": "punctuation.md" - }, - "3": { - "patterns": [ - { - "include": "#link-destination" - } - ] - }, - "4": { - "patterns": [ - { - "include": "#link-title" - } - ] - }, - "5": { - "name": "punctuation.md" - }, - "6": { - "patterns": [ - { - "include": "#special-attributes" - } - ] - } - } - }, - { - "name": "link.markup.md", - "match": "(?x) ( (?:!?\\[) (?:[^\\[\\]]*) (?:\\]) ) (\\() ([^ [:cntrl:]()]+)? (?: (?:\\s+) ( (?:[\"'\\(]) .*? (?:[\"'\\)]) ) (?:\\s*) )? (\\)) (\\{[^}]*\\})?", - "captures": { - "1": { - "patterns": [ - { - "include": "#link-text" - } - ] - }, - "2": { - "name": "punctuation.md" - }, - "3": { - "patterns": [ - { - "include": "#link-destination" - } - ] - }, - "4": { - "patterns": [ - { - "include": "#link-title" - } - ] - }, - "5": { - "name": "punctuation.md" - }, - "6": { - "patterns": [ - { - "include": "#special-attributes" - } - ] - } - } - }, - { - "name": "link.markup.md", - "match": "(?x) ( (?:!?\\[) (?:[^\\[\\]]*) (?:\\]) ) (\\() (<[^[:cntrl:]]*>) (?: (?:\\s+) ( (?:[\"'\\(]) .*? (?:[\"'\\)]) ) (?:\\s*) )? (\\)) (\\{[^}]*\\})?", - "captures": { - "1": { - "patterns": [ - { - "include": "#link-text" - } - ] - }, - "2": { - "name": "punctuation.md" - }, - "3": { - "patterns": [ - { - "include": "#link-destination" - } - ] - }, - "4": { - "patterns": [ - { - "include": "#link-title" - } - ] - }, - "5": { - "name": "punctuation.md" - }, - "6": { - "patterns": [ - { - "include": "#special-attributes" - } - ] - } - } - }, - { - "name": "link.markup.md", - "match": "(?x) ( (?:\\[) (?: (?: (?:!\\[) (?:[^\\[\\]]*) (?:\\]) ) (?:\\() (?:[^ [:cntrl:]]+)? (?: (?:\\s+) (?: (?:[\"'\\(]) .*? (?:[\"'\\)]) ) (?:\\s*) )? (?:\\)) (?:\\{[[:ascii:]]*\\})? ) (?:\\]) ) ( (?:\\[) (?:[^\\[\\]]*) (?:\\]) ) (\\{[^}]*\\})?", - "captures": { - "1": { - "patterns": [ - { - "include": "#link-text" - } - ] - }, - "2": { - "patterns": [ - { - "include": "#link-label" - } - ] - }, - "3": { - "patterns": [ - { - "include": "#special-attributes" - } - ] - } - } - }, - { - "name": "link.markup.md", - "match": "(?x) ( (?:!?\\[) (?:[^\\[\\]]*) (?:\\]) ) ( (?:\\[) (?:[^\\[\\]]*) (?:\\]) ) (\\{[^}]*\\})?", - "captures": { - "1": { - "patterns": [ - { - "include": "#link-text" - } - ] - }, - "2": { - "patterns": [ - { - "include": "#link-label" - } - ] - }, - "3": { - "patterns": [ - { - "include": "#special-attributes" - } - ] - } - } - }, - { - "name": "link.markup.md", - "match": "(?x) ( (?:!\\[) (?:[^\\[\\]]*) (?:\\]) ) (\\{[^}]*\\})?", - "captures": { - "1": { - "patterns": [ - { - "include": "#link-text" - } - ] - }, - "2": { - "patterns": [ - { - "include": "#special-attributes" - } - ] - } - } - }, - { - "name": "reference.link.markup.md", - "match": "(?x) ((?:\\[)(?:[^\\[\\]]*)(?:\\])) (:) (?:\\s) ([^ [:cntrl:]]+) (?:(?:\\s)((?:\")(?:.*?)(?:\")))? (?:(?:\\s)(\\{[[:ascii:]]*\\}))?", - "captures": { - "1": { - "patterns": [ - { - "include": "#link-label" - } - ] - }, - "2": { - "name": "punctuation.md" - }, - "3": { - "patterns": [ - { - "include": "#link-destination" - } - ] - }, - "4": { - "patterns": [ - { - "include": "#link-title" - } - ] - }, - "5": { - "patterns": [ - { - "include": "#special-attributes" - } - ] - } - } - }, - { - "match": "(?x) ( (?:\\[) (?:[^\\[\\]]*) (?:\\]) ) (?!:) (\\{[^}]*\\})?", - "captures": { - "1": { - "patterns": [ - { - "include": "#link-label" - } - ] - }, - "2": { - "patterns": [ - { - "include": "#special-attributes" - } - ] - } - } - }, - { - "name": "auto.link.markup.md", - "match": "(?i:(<)((coap|doi|javascript|aaa|aaas|about|acap|cap|cid|crid|data|dav|dict|dns|file|ftp|geo|go|gopher|h323|http|https|iax|icap|im|imap|info|ipp|iris|iris.beep|iris.xpc|iris.xpcs|iris.lwz|ldap|mailto|mid|msrp|msrps|mtqp|mupdate|news|nfs|ni|nih|nntp|opaquelocktoken|pop|pres|rtsp|service|session|shttp|sieve|sip|sips|sms|snmp|soap.beep|soap.beeps|tag|tel|telnet|tftp|thismessage|tn3270|tip|tv|urn|vemmi|ws|wss|xcon|xcon-userid|xmlrpc.beep|xmlrpc.beeps|xmpp|z39.50r|z39.50s|adiumxtra|afp|afs|aim|apt|attachment|aw|beshare|bitcoin|bolo|callto|chrome|chrome-extension|com-eventbrite-attendee|content|cvs|dlna-playsingle|dlna-playcontainer|dtn|dvb|ed2k|facetime|feed|finger|fish|gg|git|gizmoproject|gtalk|hcp|icon|ipn|irc|irc6|ircs|itms|jar|jms|keyparc|lastfm|ldaps|magnet|maps|market|message|mms|ms-help|msnim|mumble|mvn|notes|oid|palm|paparazzi|platform|proxy|psyc|query|res|resource|rmi|rsync|rtmp|secondlife|sftp|sgn|skype|smb|soldat|spotify|ssh|steam|svn|teamspeak|things|udp|unreal|ut2004|ventrilo|view-source|webcal|wtai|wyciwyg|xfire|xri|ymsgr):(?:[^ [:cntrl:]<>]+))(>))", - "captures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "name": "markup.underline.link" - }, - "4": { - "name": "punctuation.md" - } - } - }, - { - "name": "email.auto.link.markup.md", - "match": "(<)(([a-zA-Z0-9\\.!#$%&'\\*\\+/=?^_`{\\|}~-]+)(@)([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*))(>)", - "captures": { - "1": { - "name": "punctuation.md" - }, - "2": { - "name": "markup.underline.link" - }, - "4": { - "name": "punctuation.md" - }, - "6": { - "name": "punctuation.md" - } - } - } - ] -} diff --git a/data/markdown/repositories/inlines/liquid.json b/data/markdown/repositories/inlines/liquid.json deleted file mode 100644 index 034398e..0000000 --- a/data/markdown/repositories/inlines/liquid.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "key": "liquid", - "patterns": [ - { - "include": "text.html.liquid" - } - ] -} diff --git a/data/markdown/repositories/inlines/references.json b/data/markdown/repositories/inlines/references.json deleted file mode 100644 index 6da00b3..0000000 --- a/data/markdown/repositories/inlines/references.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "key": "references", - "patterns": [ - { - "match": "(?x) (?<=^|\\s|\"|'|\\(|\\[) ( (-?@) ( [a-zA-Z0-9_] [a-zA-Z0-9_:.#$%&+?<>~/-]* (?|/|-]) ) )", - "captures": { - "2": { - "name": "punctuation.md" - } - }, - "name": "reference.variable.md" - } - ] -} diff --git a/data/markdown/repositories/inlines/todo.json b/data/markdown/repositories/inlines/todo.json deleted file mode 100644 index 3e10bf4..0000000 --- a/data/markdown/repositories/inlines/todo.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "key": "todo", - "patterns": [ - { - "match": "(?\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s+\n(\\g)\\s*\n(<([^<>]+)>)?\\s*\n(?=\\()", + "beginCaptures": { + "1": { + "name": "keyword.other.delegate.cs" + }, + "2": { + "patterns": [ + { + "include": "#type" + } + ] + }, + "7": { + "name": "entity.name.type.delegate.cs" + }, + "8": { + "patterns": [ + { + "include": "#type-parameter-list" + } + ] + } + }, + "end": "(?=;)", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#parenthesized-parameter-list" + }, + { + "include": "#generic-constraints" + } + ] + }, + "enum-declaration": { + "begin": "(?=\\benum\\b)", + "end": "(?<=\\})", + "patterns": [ + { + "begin": "(?=enum)", + "end": "(?=\\{)", + "patterns": [ + { + "include": "#comment" + }, + { + "match": "(enum)\\s+(@?[_[:alpha:]][_[:alnum:]]*)", + "captures": { + "1": { + "name": "keyword.other.enum.cs" + }, + "2": { + "name": "entity.name.type.enum.cs" + } + } + }, + { + "begin": ":", + "beginCaptures": { + "0": { + "name": "punctuation.separator.colon.cs" + } + }, + "end": "(?=\\{)", + "patterns": [ + { + "include": "#type" + } + ] + } + ] + }, + { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.curlybrace.open.cs" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.curlybrace.close.cs" + } + }, + "patterns": [ + { + "include": "#preprocessor" + }, + { + "include": "#comment" + }, + { + "include": "#attribute-section" + }, + { + "include": "#punctuation-comma" + }, + { + "begin": "@?[_[:alpha:]][_[:alnum:]]*", + "beginCaptures": { + "0": { + "name": "entity.name.variable.enum-member.cs" + } + }, + "end": "(?=(,|\\}))", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#variable-initializer" + } + ] + } + ] + }, + { + "include": "#preprocessor" + }, + { + "include": "#comment" + } + ] + }, + "interface-declaration": { + "begin": "(?=\\binterface\\b)", + "end": "(?<=\\})", + "patterns": [ + { + "begin": "(?x)\n(interface)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)", + "beginCaptures": { + "1": { + "name": "keyword.other.interface.cs" + }, + "2": { + "name": "entity.name.type.interface.cs" + } + }, + "end": "(?=\\{)", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#type-parameter-list" + }, + { + "include": "#base-types" + }, + { + "include": "#generic-constraints" + } + ] + }, + { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.curlybrace.open.cs" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.curlybrace.close.cs" + } + }, + "patterns": [ + { + "include": "#interface-members" + } + ] + }, + { + "include": "#preprocessor" + }, + { + "include": "#comment" + } + ] + }, + "struct-declaration": { + "begin": "(?=\\bstruct\\b)", + "end": "(?<=\\})", + "patterns": [ + { + "begin": "(?x)\n(struct)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)", + "beginCaptures": { + "1": { + "name": "keyword.other.struct.cs" + }, + "2": { + "name": "entity.name.type.struct.cs" + } + }, + "end": "(?=\\{)", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#type-parameter-list" + }, + { + "include": "#base-types" + }, + { + "include": "#generic-constraints" + } + ] + }, + { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.curlybrace.open.cs" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.curlybrace.close.cs" + } + }, + "patterns": [ + { + "include": "#class-or-struct-members" + } + ] + }, + { + "include": "#preprocessor" + }, + { + "include": "#comment" + } + ] + }, + "type-parameter-list": { + "begin": "\\<", + "beginCaptures": { + "0": { + "name": "punctuation.definition.typeparameters.begin.cs" + } + }, + "end": "\\>", + "endCaptures": { + "0": { + "name": "punctuation.definition.typeparameters.end.cs" + } + }, + "patterns": [ + { + "match": "\\b(in|out)\\b", + "captures": { + "1": { + "name": "storage.modifier.cs" + } + } + }, + { + "match": "(@?[_[:alpha:]][_[:alnum:]]*)\\b", + "captures": { + "1": { + "name": "entity.name.type.type-parameter.cs" + } + } + }, + { + "include": "#comment" + }, + { + "include": "#punctuation-comma" + }, + { + "include": "#attribute-section" + } + ] + }, + "base-types": { + "begin": ":", + "beginCaptures": { + "0": { + "name": "punctuation.separator.colon.cs" + } + }, + "end": "(?=\\{|where)", + "patterns": [ + { + "include": "#type" + }, + { + "include": "#punctuation-comma" + }, + { + "include": "#preprocessor" + } + ] + }, + "generic-constraints": { + "begin": "(where)\\s+(@?[_[:alpha:]][_[:alnum:]]*)\\s*(:)", + "beginCaptures": { + "1": { + "name": "keyword.other.where.cs" + }, + "2": { + "name": "entity.name.type.type-parameter.cs" + }, + "3": { + "name": "punctuation.separator.colon.cs" + } + }, + "end": "(?=\\{|where|;|=>)", + "patterns": [ + { + "name": "keyword.other.class.cs", + "match": "\\bclass\\b" + }, + { + "name": "keyword.other.struct.cs", + "match": "\\bstruct\\b" + }, + { + "match": "(new)\\s*(\\()\\s*(\\))", + "captures": { + "1": { + "name": "keyword.other.new.cs" + }, + "2": { + "name": "punctuation.parenthesis.open.cs" + }, + "3": { + "name": "punctuation.parenthesis.close.cs" + } + } + }, + { + "include": "#type" + }, + { + "include": "#punctuation-comma" + }, + { + "include": "#generic-constraints" + } + ] + }, + "field-declaration": { + "begin": "(?x)\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s+\n(\\g)\\s* # first field name\n(?!=>|==)(?=,|;|=|$)", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#type" + } + ] + }, + "6": { + "name": "variable.other.cs" + } + }, + "end": "(?=;)", + "patterns": [ + { + "name": "variable.other.cs", + "match": "@?[_[:alpha:]][_[:alnum:]]*" + }, + { + "include": "#punctuation-comma" + }, + { + "include": "#comment" + }, + { + "include": "#variable-initializer" + }, + { + "include": "#class-or-struct-members" + } + ] + }, + "property-declaration": { + "begin": "(?x)\n\n# The negative lookahead below ensures that we don't match nested types\n# or other declarations as properties.\n(?![[:word:][:space:]]*\\b(?:class|interface|struct|enum|event)\\b)\n\n(?\n (?\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\\s+\n)\n(?\\g\\s*\\.\\s*)?\n(?\\g)\\s*\n(?=\\{|=>|$)", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#type" + } + ] + }, + "7": { + "patterns": [ + { + "include": "#type" + }, + { + "include": "#punctuation-accessor" + } + ] + }, + "8": { + "name": "variable.other.cs" + } + }, + "end": "(?<=\\})|(?=;)", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#property-accessors" + }, + { + "include": "#expression-body" + }, + { + "include": "#variable-initializer" + }, + { + "include": "#class-or-struct-members" + } + ] + }, + "indexer-declaration": { + "begin": "(?x)\n(?\n (?\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\\s+\n)\n(?\\g\\s*\\.\\s*)?\n(?this)\\s*\n(?=\\[)", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#type" + } + ] + }, + "7": { + "patterns": [ + { + "include": "#type" + }, + { + "include": "#punctuation-accessor" + } + ] + }, + "8": { + "name": "keyword.other.this.cs" + } + }, + "end": "(?<=\\})|(?=;)", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#bracketed-parameter-list" + }, + { + "include": "#property-accessors" + }, + { + "include": "#expression-body" + }, + { + "include": "#variable-initializer" + } + ] + }, + "event-declaration": { + "begin": "(?x)\n\\b(event)\\b\\s*\n(?\n (?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\\s+\n)\n(?\\g\\s*\\.\\s*)?\n(?\\g(?:\\s*,\\s*\\g)*)\\s*\n(?=\\{|;|$)", + "beginCaptures": { + "1": { + "name": "keyword.other.event.cs" + }, + "2": { + "patterns": [ + { + "include": "#type" + } + ] + }, + "8": { + "patterns": [ + { + "include": "#type" + }, + { + "include": "#punctuation-accessor" + } + ] + }, + "9": { + "patterns": [ + { + "name": "entity.name.variable.event.cs", + "match": "@?[_[:alpha:]][_[:alnum:]]*" + }, + { + "include": "#punctuation-comma" + } + ] + } + }, + "end": "(?<=\\})|(?=;)", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#event-accessors" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "property-accessors": { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.curlybrace.open.cs" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.curlybrace.close.cs" + } + }, + "patterns": [ + { + "name": "storage.modifier.cs", + "match": "\\b(private|protected|internal)\\b" + }, + { + "name": "keyword.other.get.cs", + "match": "\\b(get)\\b" + }, + { + "name": "keyword.other.set.cs", + "match": "\\b(set)\\b" + }, + { + "include": "#comment" + }, + { + "include": "#attribute-section" + }, + { + "include": "#expression-body" + }, + { + "include": "#block" + }, + { + "include": "#punctuation-semicolon" + } + ] + }, + "event-accessors": { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.curlybrace.open.cs" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.curlybrace.close.cs" + } + }, + "patterns": [ + { + "name": "keyword.other.add.cs", + "match": "\\b(add)\\b" + }, + { + "name": "keyword.other.remove.cs", + "match": "\\b(remove)\\b" + }, + { + "include": "#comment" + }, + { + "include": "#attribute-section" + }, + { + "include": "#expression-body" + }, + { + "include": "#block" + }, + { + "include": "#punctuation-semicolon" + } + ] + }, + "method-declaration": { + "begin": "(?x)\n(?\n (?\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\\s+\n)\n(?\\g\\s*\\.\\s*)?\n(\\g)\\s*\n(<([^<>]+)>)?\\s*\n(?=\\()", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#type" + } + ] + }, + "7": { + "patterns": [ + { + "include": "#type" + }, + { + "include": "#punctuation-accessor" + } + ] + }, + "8": { + "name": "entity.name.function.cs" + }, + "9": { + "patterns": [ + { + "include": "#type-parameter-list" + } + ] + } + }, + "end": "(?<=\\})|(?=;)", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#parenthesized-parameter-list" + }, + { + "include": "#generic-constraints" + }, + { + "include": "#expression-body" + }, + { + "include": "#block" + } + ] + }, + "constructor-declaration": { + "begin": "(?=@?[_[:alpha:]][_[:alnum:]]*\\s*\\()", + "end": "(?<=\\})|(?=;)", + "patterns": [ + { + "match": "(@?[_[:alpha:]][_[:alnum:]]*)\\b", + "captures": { + "1": { + "name": "entity.name.function.cs" + } + } + }, + { + "begin": "(:)", + "beginCaptures": { + "1": { + "name": "punctuation.separator.colon.cs" + } + }, + "end": "(?=\\{|=>)", + "patterns": [ + { + "include": "#constructor-initializer" + } + ] + }, + { + "include": "#parenthesized-parameter-list" + }, + { + "include": "#preprocessor" + }, + { + "include": "#comment" + }, + { + "include": "#expression-body" + }, + { + "include": "#block" + } + ] + }, + "constructor-initializer": { + "begin": "\\b(?:(base)|(this))\\b\\s*(?=\\()", + "beginCaptures": { + "1": { + "name": "keyword.other.base.cs" + }, + "2": { + "name": "keyword.other.this.cs" + } + }, + "end": "(?<=\\))", + "patterns": [ + { + "include": "#argument-list" + } + ] + }, + "destructor-declaration": { + "begin": "(~)(@?[_[:alpha:]][_[:alnum:]]*)\\s*(?=\\()", + "beginCaptures": { + "1": { + "name": "punctuation.tilde.cs" + }, + "2": { + "name": "entity.name.function.cs" + } + }, + "end": "(?<=\\})|(?=;)", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#parenthesized-parameter-list" + }, + { + "include": "#expression-body" + }, + { + "include": "#block" + } + ] + }, + "operator-declaration": { + "begin": "(?x)\n(?\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s*\n(?(?:\\b(?:operator)))\\s*\n(?(?:\\+|-|\\*|/|%|&|\\||\\^|\\<\\<|\\>\\>|==|!=|\\>|\\<|\\>=|\\<=|!|~|\\+\\+|--|true|false))\\s*\n(?=\\()", + "beginCaptures": { + "1": { + "patterns": [ + { + "include": "#type" + } + ] + }, + "6": { + "name": "keyword.other.operator-decl.cs" + }, + "7": { + "name": "entity.name.function.cs" + } + }, + "end": "(?<=\\})|(?=;)", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#parenthesized-parameter-list" + }, + { + "include": "#expression-body" + }, + { + "include": "#block" + } + ] + }, + "conversion-operator-declaration": { + "begin": "(?x)\n(?(?:\\b(?:explicit|implicit)))\\s*\n(?(?:\\b(?:operator)))\\s*\n(?\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref return\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s*\n(?=\\()", + "beginCaptures": { + "1": { + "patterns": [ + { + "match": "\\b(explicit)\\b", + "captures": { + "1": { + "name": "keyword.other.explicit.cs" + } + } + }, + { + "match": "\\b(implicit)\\b", + "captures": { + "1": { + "name": "keyword.other.implicit.cs" + } + } + } + ] + }, + "2": { + "name": "keyword.other.operator-decl.cs" + }, + "3": { + "patterns": [ + { + "include": "#type" + } + ] + } + }, + "end": "(?<=\\})|(?=;)", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#parenthesized-parameter-list" + }, + { + "include": "#expression-body" + }, + { + "include": "#block" + } + ] + }, + "block": { + "begin": "\\{", + "beginCaptures": { + "0": { + "name": "punctuation.curlybrace.open.cs" + } + }, + "end": "\\}", + "endCaptures": { + "0": { + "name": "punctuation.curlybrace.close.cs" + } + }, + "patterns": [ + { + "include": "#statement" + } + ] + }, + "variable-initializer": { + "begin": "(?)", + "beginCaptures": { + "1": { + "name": "keyword.operator.assignment.cs" + } + }, + "end": "(?=[,\\)\\];}])", + "patterns": [ + { + "include": "#ref-modifier" + }, + { + "include": "#expression" + } + ] + }, + "expression-body": { + "begin": "=>", + "beginCaptures": { + "0": { + "name": "keyword.operator.arrow.cs" + } + }, + "end": "(?=[,\\);}])", + "patterns": [ + { + "include": "#ref-modifier" + }, + { + "include": "#expression" + } + ] + }, + "goto-statement": { + "begin": "(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\n)\\s+\n(\\g)\\s+\n\\b(in)\\b", + "captures": { + "1": { + "name": "keyword.other.var.cs" + }, + "2": { + "patterns": [ + { + "include": "#type" + } + ] + }, + "7": { + "name": "variable.other.cs" + }, + "8": { + "name": "keyword.control.loop.in.cs" + } + } + }, + { + "match": "(?x) # match foreach (var (x, y) in ...)\n(?:\\b(var)\\b\\s*)?\n(?\\((?:[^\\(\\)]|\\g)+\\))\\s+\n\\b(in)\\b", + "captures": { + "1": { + "name": "keyword.other.var.cs" + }, + "2": { + "patterns": [ + { + "include": "#tuple-declaration-deconstruction-element-list" + } + ] + }, + "3": { + "name": "keyword.control.loop.in.cs" + } + } + }, + { + "include": "#expression" + } + ] + }, + { + "include": "#statement" + } + ] + }, + "try-statement": { + "patterns": [ + { + "include": "#try-block" + }, + { + "include": "#catch-clause" + }, + { + "include": "#finally-clause" + } + ] + }, + "try-block": { + "begin": "(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s*\n(?:(\\g)\\b)?", + "captures": { + "1": { + "patterns": [ + { + "include": "#type" + } + ] + }, + "6": { + "name": "variable.other.cs" + } + } + } + ] + }, + { + "include": "#when-clause" + }, + { + "include": "#comment" + }, + { + "include": "#block" + } + ] + }, + "when-clause": { + "begin": "(?\n (?:\n (?:ref\\s+(?:readonly\\s+)?)? # ref local\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\n)\\s+\n(\\g)\\s*\n(?=,|;|=|\\))", + "beginCaptures": { + "1": { + "name": "storage.modifier.cs" + }, + "2": { + "name": "storage.modifier.cs" + }, + "3": { + "name": "keyword.other.var.cs" + }, + "4": { + "patterns": [ + { + "include": "#type" + } + ] + }, + "9": { + "name": "variable.other.cs" + } + }, + "end": "(?=;|\\))", + "patterns": [ + { + "name": "variable.other.cs", + "match": "@?[_[:alpha:]][_[:alnum:]]*" + }, + { + "include": "#punctuation-comma" + }, + { + "include": "#comment" + }, + { + "include": "#variable-initializer" + } + ] + }, + "local-constant-declaration": { + "begin": "(?x)\n(?\\b(?:const)\\b)\\s*\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s+\n(\\g)\\s*\n(?=,|;|=)", + "beginCaptures": { + "1": { + "name": "storage.modifier.cs" + }, + "2": { + "patterns": [ + { + "include": "#type" + } + ] + }, + "7": { + "name": "variable.other.cs" + } + }, + "end": "(?=;)", + "patterns": [ + { + "name": "variable.other.cs", + "match": "@?[_[:alpha:]][_[:alnum:]]*" + }, + { + "include": "#punctuation-comma" + }, + { + "include": "#comment" + }, + { + "include": "#variable-initializer" + } + ] + }, + "local-tuple-var-deconstruction": { + "begin": "(?x) # e.g. var (x, y) = GetPoint();\n(?:\\b(var)\\b\\s*)\n(?\\((?:[^\\(\\)]|\\g)+\\))\\s*\n(?=;|=|\\))", + "beginCaptures": { + "1": { + "name": "keyword.other.var.cs" + }, + "2": { + "patterns": [ + { + "include": "#tuple-declaration-deconstruction-element-list" + } + ] + } + }, + "end": "(?=;|\\))", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#variable-initializer" + } + ] + }, + "tuple-deconstruction-assignment": { + "match": "(?x)\n(?\\s*\\((?:[^\\(\\)]|\\g)+\\))\\s*\n(?!=>|==)(?==)", + "captures": { + "1": { + "patterns": [ + { + "include": "#tuple-deconstruction-element-list" + } + ] + } + } + }, + "tuple-declaration-deconstruction-element-list": { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.parenthesis.open.cs" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.parenthesis.close.cs" + } + }, + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#tuple-declaration-deconstruction-element-list" + }, + { + "include": "#declaration-expression-tuple" + }, + { + "include": "#punctuation-comma" + }, + { + "match": "(?x) # e.g. x\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*\n(?=[,)])", + "captures": { + "1": { + "name": "entity.name.variable.tuple-element.cs" + } + } + } + ] + }, + "tuple-deconstruction-element-list": { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.parenthesis.open.cs" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.parenthesis.close.cs" + } + }, + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#tuple-deconstruction-element-list" + }, + { + "include": "#declaration-expression-tuple" + }, + { + "include": "#punctuation-comma" + }, + { + "match": "(?x) # e.g. x\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*\n(?=[,)])", + "captures": { + "1": { + "name": "variable.other.readwrite.cs" + } + } + } + ] + }, + "declaration-expression-local": { + "match": "(?x) # e.g. int x OR var x\n(?:\n \\b(var)\\b|\n (?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\n)\\s+\n(\\g)\\b\\s*\n(?=[,)\\]])", + "captures": { + "1": { + "name": "keyword.other.var.cs" + }, + "2": { + "patterns": [ + { + "include": "#type" + } + ] + }, + "7": { + "name": "variable.other.cs" + } + } + }, + "declaration-expression-tuple": { + "match": "(?x) # e.g. int x OR var x\n(?:\n \\b(var)\\b|\n (?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n )\n)\\s+\n(\\g)\\b\\s*\n(?=[,)])", + "captures": { + "1": { + "name": "keyword.other.var.cs" + }, + "2": { + "patterns": [ + { + "include": "#type" + } + ] + }, + "7": { + "name": "entity.name.variable.tuple-element.cs" + } + } + }, + "checked-unchecked-expression": { + "begin": "(?>=|\\|=" + }, + { + "name": "keyword.operator.bitwise.shift.cs", + "match": "<<|>>" + }, + { + "name": "keyword.operator.comparison.cs", + "match": "==|!=" + }, + { + "name": "keyword.operator.relational.cs", + "match": "<=|>=|<|>" + }, + { + "name": "keyword.operator.logical.cs", + "match": "\\!|&&|\\|\\|" + }, + { + "name": "keyword.operator.bitwise.cs", + "match": "\\&|~|\\^|\\|" + }, + { + "name": "keyword.operator.assignment.cs", + "match": "\\=" + }, + { + "name": "keyword.operator.decrement.cs", + "match": "--" + }, + { + "name": "keyword.operator.increment.cs", + "match": "\\+\\+" + }, + { + "name": "keyword.operator.arithmetic.cs", + "match": "%|\\*|/|-|\\+" + }, + { + "name": "keyword.operator.null-coalescing.cs", + "match": "\\?\\?" + } + ] + }, + "conditional-operator": { + "begin": "(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s*\n(\\))(?=\\s*@?[_[:alnum:]\\(])", + "captures": { + "1": { + "name": "punctuation.parenthesis.open.cs" + }, + "2": { + "patterns": [ + { + "include": "#type" + } + ] + }, + "7": { + "name": "punctuation.parenthesis.close.cs" + } + } + }, + "as-expression": { + "match": "(?x)\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)?", + "captures": { + "1": { + "name": "keyword.other.as.cs" + }, + "2": { + "patterns": [ + { + "include": "#type" + } + ] + } + } + }, + "is-expression": { + "match": "(?x)\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)?", + "captures": { + "1": { + "name": "keyword.other.is.cs" + }, + "2": { + "patterns": [ + { + "include": "#type" + } + ] + } + } + }, + "this-or-base-expression": { + "match": "\\b(?:(base)|(this))\\b", + "captures": { + "1": { + "name": "keyword.other.base.cs" + }, + "2": { + "name": "keyword.other.this.cs" + } + } + }, + "invocation-expression": { + "begin": "(?x)\n(?:(\\?)\\s*)? # preceding null-conditional operator?\n(?:(\\.)\\s*)? # preceding dot?\n(@?[_[:alpha:]][_[:alnum:]]*)\\s* # method name\n(?\\s*<([^<>]|\\g)+>\\s*)?\\s* # type arguments\n(?=\\() # open paren of argument list", + "beginCaptures": { + "1": { + "name": "keyword.operator.null-conditional.cs" + }, + "2": { + "name": "punctuation.accessor.cs" + }, + "3": { + "name": "entity.name.function.cs" + }, + "4": { + "patterns": [ + { + "include": "#type-arguments" + } + ] + } + }, + "end": "(?<=\\))", + "patterns": [ + { + "include": "#argument-list" + } + ] + }, + "element-access-expression": { + "begin": "(?x)\n(?:(\\?)\\s*)? # preceding null-conditional operator?\n(?:(\\.)\\s*)? # preceding dot?\n(?:(@?[_[:alpha:]][_[:alnum:]]*)\\s*)? # property name\n(?:(\\?)\\s*)? # null-conditional operator?\n(?=\\[) # open bracket of argument list", + "beginCaptures": { + "1": { + "name": "keyword.operator.null-conditional.cs" + }, + "2": { + "name": "punctuation.accessor.cs" + }, + "3": { + "name": "variable.other.object.property.cs" + }, + "4": { + "name": "keyword.operator.null-conditional.cs" + } + }, + "end": "(?<=\\])(?!\\s*\\[)", + "patterns": [ + { + "include": "#bracketed-argument-list" + } + ] + }, + "member-access-expression": { + "patterns": [ + { + "match": "(?x)\n(?:(\\?)\\s*)? # preceding null-conditional operator?\n(\\.)\\s* # preceding dot\n(@?[_[:alpha:]][_[:alnum:]]*)\\s* # property name\n(?![_[:alnum:]]|\\(|(\\?)?\\[|<) # next character is not alpha-numeric, nor a (, [, or <. Also, test for ?[", + "captures": { + "1": { + "name": "keyword.operator.null-conditional.cs" + }, + "2": { + "name": "punctuation.accessor.cs" + }, + "3": { + "name": "variable.other.object.property.cs" + } + } + }, + { + "match": "(?x)\n(\\.)?\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\n(?\\s*<([^<>]|\\g)+>\\s*)\n(?=\n (\\s*\\?)?\n \\s*\\.\\s*@?[_[:alpha:]][_[:alnum:]]*\n)", + "captures": { + "1": { + "name": "punctuation.accessor.cs" + }, + "2": { + "name": "variable.other.object.cs" + }, + "3": { + "patterns": [ + { + "include": "#type-arguments" + } + ] + } + } + }, + { + "match": "(?x)\n(@?[_[:alpha:]][_[:alnum:]]*)\n(?=\n (\\s*\\?)?\n \\s*\\.\\s*@?[_[:alpha:]][_[:alnum:]]*\n)", + "captures": { + "1": { + "name": "variable.other.object.cs" + } + } + } + ] + }, + "object-creation-expression": { + "patterns": [ + { + "include": "#object-creation-expression-with-parameters" + }, + { + "include": "#object-creation-expression-with-no-parameters" + } + ] + }, + "object-creation-expression-with-parameters": { + "begin": "(?x)\n(new)\\s+\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s*\n(?=\\()", + "beginCaptures": { + "1": { + "name": "keyword.other.new.cs" + }, + "2": { + "patterns": [ + { + "include": "#type" + } + ] + } + }, + "end": "(?<=\\))", + "patterns": [ + { + "include": "#argument-list" + } + ] + }, + "object-creation-expression-with-no-parameters": { + "match": "(?x)\n(new)\\s+\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s*\n(?=\\{|$)", + "captures": { + "1": { + "name": "keyword.other.new.cs" + }, + "2": { + "patterns": [ + { + "include": "#type" + } + ] + } + } + }, + "array-creation-expression": { + "begin": "(?x)\n\\b(new|stackalloc)\\b\\s*\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)?\\s*\n(?=\\[)", + "beginCaptures": { + "1": { + "name": "keyword.other.new.cs" + }, + "2": { + "patterns": [ + { + "include": "#type" + } + ] + } + }, + "end": "(?<=\\])", + "patterns": [ + { + "include": "#bracketed-argument-list" + } + ] + }, + "anonymous-object-creation-expression": { + "begin": "\\b(new)\\b\\s*(?=\\{|$)", + "beginCaptures": { + "1": { + "name": "keyword.other.new.cs" + } + }, + "end": "(?<=\\})", + "patterns": [ + { + "include": "#initializer-expression" + } + ] + }, + "bracketed-parameter-list": { + "begin": "(?=(\\[))", + "beginCaptures": { + "1": { + "name": "punctuation.squarebracket.open.cs" + } + }, + "end": "(?=(\\]))", + "endCaptures": { + "1": { + "name": "punctuation.squarebracket.close.cs" + } + }, + "patterns": [ + { + "begin": "(?<=\\[)", + "end": "(?=\\])", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#attribute-section" + }, + { + "include": "#parameter" + }, + { + "include": "#punctuation-comma" + }, + { + "include": "#variable-initializer" + } + ] + } + ] + }, + "parenthesized-parameter-list": { + "begin": "(\\()", + "beginCaptures": { + "0": { + "name": "punctuation.parenthesis.open.cs" + } + }, + "end": "(\\))", + "endCaptures": { + "0": { + "name": "punctuation.parenthesis.close.cs" + } + }, + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#attribute-section" + }, + { + "include": "#parameter" + }, + { + "include": "#punctuation-comma" + }, + { + "include": "#variable-initializer" + } + ] + }, + "parameter": { + "match": "(?x)\n(?:(?:\\b(ref|params|out|in|this)\\b)\\s+)?\n(?\n (?:\n (?:ref\\s+)? # ref return\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s+\n(\\g)", + "captures": { + "1": { + "name": "storage.modifier.cs" + }, + "2": { + "patterns": [ + { + "include": "#type" + } + ] + }, + "7": { + "name": "variable.parameter.function.cs" + } + } + }, + "argument-list": { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.parenthesis.open.cs" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.parenthesis.close.cs" + } + }, + "patterns": [ + { + "include": "#named-argument" + }, + { + "include": "#argument" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "bracketed-argument-list": { + "begin": "\\[", + "beginCaptures": { + "0": { + "name": "punctuation.squarebracket.open.cs" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.squarebracket.close.cs" + } + }, + "patterns": [ + { + "include": "#named-argument" + }, + { + "include": "#argument" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "named-argument": { + "begin": "(@?[_[:alpha:]][_[:alnum:]]*)\\s*(:)", + "beginCaptures": { + "1": { + "name": "variable.parameter.function.cs" + }, + "2": { + "name": "punctuation.separator.colon.cs" + } + }, + "end": "(?=(,|\\)|\\]))", + "patterns": [ + { + "include": "#argument" + } + ] + }, + "argument": { + "patterns": [ + { + "name": "storage.modifier.cs", + "match": "\\b(ref|out|in)\\b" + }, + { + "include": "#declaration-expression-local" + }, + { + "include": "#expression" + } + ] + }, + "query-expression": { + "begin": "(?x)\n\\b(from)\\b\\s*\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)?\n\\s+(\\g)\\b\\s*\n\\b(in)\\b\\s*", + "beginCaptures": { + "1": { + "name": "keyword.query.from.cs" + }, + "2": { + "patterns": [ + { + "include": "#type" + } + ] + }, + "7": { + "name": "entity.name.variable.range-variable.cs" + }, + "8": { + "name": "keyword.query.in.cs" + } + }, + "end": "(?=;|\\))", + "patterns": [ + { + "include": "#query-body" + }, + { + "include": "#expression" + } + ] + }, + "query-body": { + "patterns": [ + { + "include": "#let-clause" + }, + { + "include": "#where-clause" + }, + { + "include": "#join-clause" + }, + { + "include": "#orderby-clause" + }, + { + "include": "#select-clause" + }, + { + "include": "#group-clause" + } + ] + }, + "let-clause": { + "begin": "(?x)\n\\b(let)\\b\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*\n(=)\\s*", + "beginCaptures": { + "1": { + "name": "keyword.query.let.cs" + }, + "2": { + "name": "entity.name.variable.range-variable.cs" + }, + "3": { + "name": "keyword.operator.assignment.cs" + } + }, + "end": "(?=;|\\))", + "patterns": [ + { + "include": "#query-body" + }, + { + "include": "#expression" + } + ] + }, + "where-clause": { + "begin": "(?x)\n\\b(where)\\b\\s*", + "beginCaptures": { + "1": { + "name": "keyword.query.where.cs" + } + }, + "end": "(?=;|\\))", + "patterns": [ + { + "include": "#query-body" + }, + { + "include": "#expression" + } + ] + }, + "join-clause": { + "begin": "(?x)\n\\b(join)\\b\\s*\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)?\n\\s+(\\g)\\b\\s*\n\\b(in)\\b\\s*", + "beginCaptures": { + "1": { + "name": "keyword.query.join.cs" + }, + "2": { + "patterns": [ + { + "include": "#type" + } + ] + }, + "7": { + "name": "entity.name.variable.range-variable.cs" + }, + "8": { + "name": "keyword.query.in.cs" + } + }, + "end": "(?=;|\\))", + "patterns": [ + { + "include": "#join-on" + }, + { + "include": "#join-equals" + }, + { + "include": "#join-into" + }, + { + "include": "#query-body" + }, + { + "include": "#expression" + } + ] + }, + "join-on": { + "match": "\\b(on)\\b\\s*", + "captures": { + "1": { + "name": "keyword.query.on.cs" + } + } + }, + "join-equals": { + "match": "\\b(equals)\\b\\s*", + "captures": { + "1": { + "name": "keyword.query.equals.cs" + } + } + }, + "join-into": { + "match": "(?x)\n\\b(into)\\b\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*", + "captures": { + "1": { + "name": "keyword.query.into.cs" + }, + "2": { + "name": "entity.name.variable.range-variable.cs" + } + } + }, + "orderby-clause": { + "begin": "\\b(orderby)\\b\\s*", + "beginCaptures": { + "1": { + "name": "keyword.query.orderby.cs" + } + }, + "end": "(?=;|\\))", + "patterns": [ + { + "include": "#ordering-direction" + }, + { + "include": "#query-body" + }, + { + "include": "#expression" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "ordering-direction": { + "match": "\\b(?:(ascending)|(descending))\\b", + "captures": { + "1": { + "name": "keyword.query.ascending.cs" + }, + "2": { + "name": "keyword.query.descending.cs" + } + } + }, + "select-clause": { + "begin": "\\b(select)\\b\\s*", + "beginCaptures": { + "1": { + "name": "keyword.query.select.cs" + } + }, + "end": "(?=;|\\))", + "patterns": [ + { + "include": "#query-body" + }, + { + "include": "#expression" + } + ] + }, + "group-clause": { + "begin": "\\b(group)\\b\\s*", + "beginCaptures": { + "1": { + "name": "keyword.query.group.cs" + } + }, + "end": "(?=;|\\))", + "patterns": [ + { + "include": "#group-by" + }, + { + "include": "#group-into" + }, + { + "include": "#query-body" + }, + { + "include": "#expression" + } + ] + }, + "group-by": { + "match": "\\b(by)\\b\\s*", + "captures": { + "1": { + "name": "keyword.query.by.cs" + } + } + }, + "group-into": { + "match": "(?x)\n\\b(into)\\b\\s*\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*", + "captures": { + "1": { + "name": "keyword.query.into.cs" + }, + "2": { + "name": "entity.name.variable.range-variable.cs" + } + } + }, + "anonymous-method-expression": { + "patterns": [ + { + "begin": "(?x)\n(?:\\b(async)\\b\\s*)?\n(@?[_[:alpha:]][_[:alnum:]]*)\\b\\s*\n(=>)", + "beginCaptures": { + "1": { + "name": "storage.modifier.cs" + }, + "2": { + "name": "variable.parameter.function.cs" + }, + "3": { + "name": "keyword.operator.arrow.cs" + } + }, + "end": "(?=\\)|;|}|,)", + "patterns": [ + { + "include": "#block" + }, + { + "include": "#ref-modifier" + }, + { + "include": "#expression" + } + ] + }, + { + "begin": "(?x)\n(?:\\b(async)\\b\\s*)?\n(\\(.*?\\))\\s*\n(=>)", + "beginCaptures": { + "1": { + "name": "storage.modifier.cs" + }, + "2": { + "patterns": [ + { + "include": "#lambda-parameter-list" + } + ] + }, + "3": { + "name": "keyword.operator.arrow.cs" + } + }, + "end": "(?=\\)|;|}|,)", + "patterns": [ + { + "include": "#block" + }, + { + "include": "#ref-modifier" + }, + { + "include": "#expression" + } + ] + }, + { + "begin": "(?x)\n(?:\\b(async)\\b\\s*)?\n(?:\\b(delegate)\\b\\s*)", + "beginCaptures": { + "1": { + "name": "storage.modifier.cs" + }, + "2": { + "name": "keyword.other.delegate.cs" + } + }, + "end": "(?=\\)|;|}|,)", + "patterns": [ + { + "include": "#parenthesized-parameter-list" + }, + { + "include": "#block" + }, + { + "include": "#expression" + } + ] + } + ] + }, + "lambda-parameter-list": { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.parenthesis.open.cs" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.parenthesis.close.cs" + } + }, + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#attribute-section" + }, + { + "include": "#lambda-parameter" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "lambda-parameter": { + "match": "(?x)\n(?:\\b(ref|out|in)\\b)?\\s*\n(?:(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\\s+)?\n(\\g)\\b\\s*\n(?=[,)])", + "captures": { + "1": { + "name": "storage.modifier.cs" + }, + "2": { + "patterns": [ + { + "include": "#type" + } + ] + }, + "7": { + "name": "variable.parameter.function.cs" + } + } + }, + "type": { + "name": "meta.type.cs", + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#ref-modifier" + }, + { + "include": "#readonly-modifier" + }, + { + "include": "#tuple-type" + }, + { + "include": "#type-builtin" + }, + { + "include": "#type-name" + }, + { + "include": "#type-arguments" + }, + { + "include": "#type-array-suffix" + }, + { + "include": "#type-nullable-suffix" + } + ] + }, + "ref-modifier": { + "name": "storage.modifier.cs", + "match": "\\b(ref)\\b" + }, + "readonly-modifier": { + "name": "storage.modifier.cs", + "match": "\\b(readonly)\\b" + }, + "tuple-type": { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.parenthesis.open.cs" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.parenthesis.close.cs" + } + }, + "patterns": [ + { + "include": "#tuple-element" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "tuple-element": { + "match": "(?x)\n(?\n (?:\n (?:\n (?:(?@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)? # alias-qualification\n (? # identifier + type arguments (if any)\n \\g\\s*\n (?\\s*<(?:[^<>]|\\g)+>\\s*)?\n )\n (?:\\s*\\.\\s*\\g)* | # Are there any more names being dotted into?\n (?\\s*\\((?:[^\\(\\)]|\\g)+\\))\n )\n (?:\\s*\\?\\s*)? # nullable suffix?\n (?:\\s*\\[(?:\\s*,\\s*)*\\]\\s*)* # array suffix?\n )\n)\n(?:(?\\g)\\b)?", + "captures": { + "1": { + "patterns": [ + { + "include": "#type" + } + ] + }, + "6": { + "name": "entity.name.variable.tuple-element.cs" + } + } + }, + "type-builtin": { + "match": "\\b(bool|byte|char|decimal|double|float|int|long|object|sbyte|short|string|uint|ulong|ushort|void|dynamic)\\b", + "captures": { + "1": { + "name": "keyword.type.cs" + } + } + }, + "type-name": { + "patterns": [ + { + "match": "(@?[_[:alpha:]][_[:alnum:]]*)\\s*(\\:\\:)", + "captures": { + "1": { + "name": "entity.name.type.alias.cs" + }, + "2": { + "name": "punctuation.separator.coloncolon.cs" + } + } + }, + { + "match": "(@?[_[:alpha:]][_[:alnum:]]*)\\s*(\\.)", + "captures": { + "1": { + "name": "storage.type.cs" + }, + "2": { + "name": "punctuation.accessor.cs" + } + } + }, + { + "match": "(\\.)\\s*(@?[_[:alpha:]][_[:alnum:]]*)", + "captures": { + "1": { + "name": "punctuation.accessor.cs" + }, + "2": { + "name": "storage.type.cs" + } + } + }, + { + "name": "entity.name.type.cs", + "match": "@?[_[:alpha:]][_[:alnum:]]*" + } + ] + }, + "type-arguments": { + "begin": "<", + "beginCaptures": { + "0": { + "name": "punctuation.definition.typeparameters.begin.cs" + } + }, + "end": ">", + "endCaptures": { + "0": { + "name": "punctuation.definition.typeparameters.end.cs" + } + }, + "patterns": [ + { + "include": "#comment" + }, + { + "include": "#type" + }, + { + "include": "#punctuation-comma" + } + ] + }, + "type-array-suffix": { + "begin": "\\[", + "beginCaptures": { + "0": { + "name": "punctuation.squarebracket.open.cs" + } + }, + "end": "\\]", + "endCaptures": { + "0": { + "name": "punctuation.squarebracket.close.cs" + } + }, + "patterns": [ + { + "include": "#punctuation-comma" + } + ] + }, + "type-nullable-suffix": { + "match": "\\?", + "captures": { + "0": { + "name": "punctuation.separator.question-mark.cs" + } + } + }, + "operator-assignment": { + "name": "keyword.operator.assignment.cs", + "match": "(?)", + "endCaptures": { + "1": { + "name": "punctuation.definition.tag.cs" + } + }, + "patterns": [ + { + "include": "#xml-attribute" + } + ] + }, + "xml-attribute": { + "patterns": [ + { + "match": "(?x)\n(?:^|\\s+)\n(\n (?:\n ([-_[:alnum:]]+)\n (:)\n )?\n ([-_[:alnum:]]+)\n)\n(=)", + "captures": { + "1": { + "name": "entity.other.attribute-name.cs" + }, + "2": { + "name": "entity.other.attribute-name.namespace.cs" + }, + "3": { + "name": "punctuation.separator.colon.cs" + }, + "4": { + "name": "entity.other.attribute-name.localname.cs" + }, + "5": { + "name": "punctuation.separator.equals.cs" + } + } + }, + { + "include": "#xml-string" + } + ] + }, + "xml-cdata": { + "name": "string.unquoted.cdata.cs", + "begin": "", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.cs" + } + } + }, + "xml-string": { + "patterns": [ + { + "name": "string.quoted.single.cs", + "begin": "\\'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.cs" + } + }, + "end": "\\'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.cs" + } + }, + "patterns": [ + { + "include": "#xml-character-entity" + } + ] + }, + { + "name": "string.quoted.double.cs", + "begin": "\\\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.cs" + } + }, + "end": "\\\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.cs" + } + }, + "patterns": [ + { + "include": "#xml-character-entity" + } + ] + } + ] + }, + "xml-character-entity": { + "patterns": [ + { + "name": "constant.character.entity.cs", + "match": "(?x)\n(&)\n(\n (?:[[:alpha:]:_][[:alnum:]:_.-]*)|\n (?:\\#[[:digit:]]+)|\n (?:\\#x[[:xdigit:]]+)\n)\n(;)", + "captures": { + "1": { + "name": "punctuation.definition.constant.cs" + }, + "3": { + "name": "punctuation.definition.constant.cs" + } + } + }, + { + "name": "invalid.illegal.bad-ampersand.cs", + "match": "&" + } + ] + }, + "xml-comment": { + "name": "comment.block.cs", + "begin": "", + "endCaptures": { + "0": { + "name": "punctuation.definition.comment.cs" + } + } + } + } +} diff --git a/data/css/css.json b/data/source.css.json similarity index 100% rename from data/css/css.json rename to data/source.css.json diff --git a/data/source.css.less.json b/data/source.css.less.json new file mode 100644 index 0000000..fe69204 --- /dev/null +++ b/data/source.css.less.json @@ -0,0 +1,540 @@ +{ + "name": "Less", + "scopeName": "source.css.less", + "fileTypes": [ + "less", + "less.erb" + ], + "patterns": [ + { + "include": "#strings" + }, + { + "captures": { + "1": { + "name": "entity.other.attribute-name.class.mixin.css" + } + }, + "match": "(\\.[_a-zA-Z][a-zA-Z0-9_-]*(?=\\())" + }, + { + "captures": { + "1": { + "name": "entity.other.attribute-name.class.css" + }, + "2": { + "name": "punctuation.definition.entity.css" + }, + "4": { + "name": "variable.other.interpolation.less" + } + }, + "match": "((\\.)([_a-zA-Z]|(@{[a-zA-Z0-9_-]+}))[a-zA-Z0-9_-]*)" + }, + { + "captures": { + "0": { + "name": "entity.other.attribute-name.parent-selector.css" + }, + "1": { + "name": "punctuation.definition.entity.css" + } + }, + "match": "(&)[a-zA-Z0-9_-]*" + }, + { + "begin": "(format|local|url|attr|counter|counters)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "support.function.misc.css" + }, + "2": { + "name": "punctuation.section.function.css" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.section.function.css" + } + }, + "patterns": [ + { + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.css" + } + }, + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.css" + } + }, + "name": "string.quoted.single.css", + "patterns": [ + { + "match": "\\\\.", + "name": "constant.character.escape.css" + } + ] + }, + { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.css" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.css" + } + }, + "name": "string.quoted.double.css", + "patterns": [ + { + "match": "\\\\(\\d{1,6}|.)", + "name": "constant.character.escape.css" + } + ] + }, + { + "match": "[^'\") \\t]+", + "name": "variable.parameter.misc.css" + } + ] + }, + { + "match": "(#)([0-9a-fA-F]{3}|[0-9a-fA-F]{6})\\b(?!.*?(?(['\"])(?:[^\\\\]|\\\\.)*?(\\6)))))?\\s*(\\])", + "name": "meta.attribute-selector.css" + }, + { + "begin": "((@)import\\b)", + "beginCaptures": { + "1": { + "name": "keyword.control.at-rule.import.less" + }, + "2": { + "name": "punctuation.definition.keyword.less" + } + }, + "end": ";", + "endCaptures": { + "0": { + "name": "punctuation.terminator.rule.css" + } + }, + "name": "meta.at-rule.import.css", + "patterns": [ + { + "match": "(?<=\\(|,|\\s)\\b(reference|optional|once|multiple|less|inline)\\b(?=\\)|,)", + "name": "keyword.control.import.option.less" + }, + { + "include": "#brace_round" + }, + { + "include": "source.css#commas" + }, + { + "include": "#strings" + } + ] + }, + { + "captures": { + "1": { + "name": "keyword.control.at-rule.fontface.css" + }, + "2": { + "name": "punctuation.definition.keyword.css" + } + }, + "match": "^\\s*((@)font-face\\b)", + "name": "meta.at-rule.fontface.css" + }, + { + "captures": { + "1": { + "name": "keyword.control.at-rule.media.css" + }, + "2": { + "name": "punctuation.definition.keyword.css" + } + }, + "match": "^\\s*((@)media\\b)", + "name": "meta.at-rule.media.css" + }, + { + "include": "source.css#media-features" + }, + { + "match": "\\b(tv|tty|screen|projection|print|handheld|embossed|braille|aural|all)\\b", + "name": "support.constant.media-type.media.css" + }, + { + "match": "\\b(portrait|landscape)\\b", + "name": "support.constant.property-value.media-property.media.css" + }, + { + "captures": { + "1": { + "name": "support.function.less" + } + }, + "match": "(\\.[a-zA-Z0-9_-]+)\\s*(;|\\()" + }, + { + "begin": "(^[ \\t]+)?(?=//)", + "beginCaptures": { + "1": { + "name": "punctuation.whitespace.comment.leading.less" + } + }, + "end": "(?!\\G)", + "patterns": [ + { + "begin": "//", + "beginCaptures": { + "0": { + "name": "punctuation.definition.comment.less" + } + }, + "end": "\\n", + "name": "comment.line.double-slash.less" + } + ] + }, + { + "match": "(@|\\-\\-)[\\w-]+(?=\\s*)", + "name": "variable.other.less", + "captures": { + "1": { + "name": "punctuation.definition.variable.less" + } + } + }, + { + "include": "#variable_interpolation" + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.section.property-list.begin.bracket.curly.css" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.section.property-list.end.bracket.curly.css" + } + }, + "name": "meta.property-list.css", + "patterns": [ + { + "include": "source.css#pseudo-elements" + }, + { + "include": "source.css#pseudo-classes" + }, + { + "include": "source.css#tag-names" + }, + { + "include": "source.css#commas" + }, + { + "include": "#variable_interpolation" + }, + { + "include": "source.css#property-names" + }, + { + "include": "#property_values" + }, + { + "include": "$self" + } + ] + }, + { + "match": "\\!\\s*important", + "name": "keyword.other.important.css" + }, + { + "match": "\\*|\\/|\\-|\\+|~|=|<=|>=|<|>", + "name": "keyword.operator.less" + }, + { + "match": "\\b(not|and|when)\\b", + "name": "keyword.control.logical.operator.less" + }, + { + "include": "source.css#tag-names" + }, + { + "match": "(?=|<|>|from|to|through)", + "name": "keyword.control.operator" + }, + { + "include": "#variable" + }, + { + "include": "#property_values" + }, + { + "include": "$self" + } + ] + }, + "at_rule_forward": { + "begin": "\\s*((@)forward\\b)\\s*", + "captures": { + "1": { + "name": "keyword.control.at-rule.forward.scss" + }, + "2": { + "name": "punctuation.definition.keyword.scss" + } + }, + "end": "\\s*(?=;)", + "name": "meta.at-rule.forward.scss", + "patterns": [ + { + "match": "\\b(as|hide|show)\\b", + "name": "keyword.control.operator" + }, + { + "match": "\\b([\\w-]+)(\\*)", + "captures": { + "1": { + "name": "entity.other.attribute-name.module.scss" + }, + "2": { + "name": "punctuation.definition.wildcard.scss" + } + } + }, + { + "match": "\\b[\\w-]+\\b", + "name": "entity.name.function.scss" + }, + { + "include": "#variable" + }, + { + "include": "#string_single" + }, + { + "include": "#string_double" + }, + { + "include": "#comment_line" + }, + { + "include": "#comment_block" + } + ] + }, + "at_rule_function": { + "patterns": [ + { + "begin": "\\s*((@)function\\b)\\s*", + "captures": { + "1": { + "name": "keyword.control.at-rule.function.scss" + }, + "2": { + "name": "punctuation.definition.keyword.scss" + }, + "3": { + "name": "entity.name.function.scss" + } + }, + "end": "\\s*(?={)", + "name": "meta.at-rule.function.scss", + "patterns": [ + { + "include": "#function_attributes" + } + ] + }, + { + "captures": { + "1": { + "name": "keyword.control.at-rule.function.scss" + }, + "2": { + "name": "punctuation.definition.keyword.scss" + }, + "3": { + "name": "entity.name.function.scss" + } + }, + "match": "\\s*((@)function\\b)\\s*", + "name": "meta.at-rule.function.scss" + } + ] + }, + "at_rule_if": { + "begin": "\\s*((@)if\\b)\\s*", + "captures": { + "1": { + "name": "keyword.control.if.scss" + }, + "2": { + "name": "punctuation.definition.keyword.scss" + } + }, + "end": "\\s*(?={)", + "name": "meta.at-rule.if.scss", + "patterns": [ + { + "include": "#conditional_operators" + }, + { + "include": "#variable" + }, + { + "include": "#property_values" + } + ] + }, + "at_rule_import": { + "begin": "\\s*((@)import\\b)\\s*", + "captures": { + "1": { + "name": "keyword.control.at-rule.import.scss" + }, + "2": { + "name": "punctuation.definition.keyword.scss" + } + }, + "end": "\\s*((?=;)|(?=}))", + "name": "meta.at-rule.import.scss", + "patterns": [ + { + "include": "#variable" + }, + { + "include": "#string_single" + }, + { + "include": "#string_double" + }, + { + "include": "#functions" + }, + { + "include": "#comment_line" + } + ] + }, + "at_rule_include": { + "patterns": [ + { + "begin": "(?<=@include)\\s+(?:([\\w-]+)\\s*(\\.))?([\\w-]+)\\s*(\\()", + "beginCaptures": { + "1": { + "name": "variable.scss" + }, + "2": { + "name": "punctuation.access.module.scss" + }, + "3": { + "name": "entity.name.function.scss" + }, + "4": { + "name": "punctuation.definition.parameters.begin.bracket.round.scss" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.parameters.end.bracket.round.scss" + } + }, + "name": "meta.at-rule.include.scss", + "patterns": [ + { + "include": "#function_attributes" + } + ] + }, + { + "match": "(?<=@include)\\s+(?:([\\w-]+)\\s*(\\.))?([\\w-]+)", + "captures": { + "0": { + "name": "meta.at-rule.include.scss" + }, + "1": { + "name": "variable.scss" + }, + "2": { + "name": "punctuation.access.module.scss" + }, + "3": { + "name": "entity.name.function.scss" + } + } + }, + { + "match": "((@)include)\\b", + "captures": { + "0": { + "name": "meta.at-rule.include.scss" + }, + "1": { + "name": "keyword.control.at-rule.include.scss" + }, + "2": { + "name": "punctuation.definition.keyword.scss" + } + } + } + ] + }, + "at_rule_keyframes": { + "begin": "(?<=^|\\s)(@)(?:-(?:webkit|moz)-)?keyframes\\b", + "beginCaptures": { + "0": { + "name": "keyword.control.at-rule.keyframes.scss" + }, + "1": { + "name": "punctuation.definition.keyword.scss" + } + }, + "end": "(?<=})", + "name": "meta.at-rule.keyframes.scss", + "patterns": [ + { + "match": "(?<=@keyframes)\\s+((?:[_A-Za-z][-\\w]|-[_A-Za-z])[-\\w]*)", + "captures": { + "1": { + "name": "entity.name.function.scss" + } + } + }, + { + "begin": "(?<=@keyframes)\\s+(\")", + "beginCaptures": { + "1": { + "name": "punctuation.definition.string.begin.scss" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.scss" + } + }, + "name": "string.quoted.double.scss", + "contentName": "entity.name.function.scss", + "patterns": [ + { + "match": "\\\\(\\h{1,6}|.)", + "name": "constant.character.escape.scss" + }, + { + "include": "#interpolation" + } + ] + }, + { + "begin": "(?<=@keyframes)\\s+(')", + "beginCaptures": { + "1": { + "name": "punctuation.definition.string.begin.scss" + } + }, + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.scss" + } + }, + "name": "string.quoted.single.scss", + "contentName": "entity.name.function.scss", + "patterns": [ + { + "match": "\\\\(\\h{1,6}|.)", + "name": "constant.character.escape.scss" + }, + { + "include": "#interpolation" + } + ] + }, + { + "begin": "{", + "beginCaptures": { + "0": { + "name": "punctuation.section.keyframes.begin.scss" + } + }, + "end": "}", + "endCaptures": { + "0": { + "name": "punctuation.section.keyframes.end.scss" + } + }, + "patterns": [ + { + "match": "\\b(?:(?:100|[1-9]\\d|\\d)%|from|to)(?=\\s*{)", + "name": "entity.other.attribute-name.scss" + }, + { + "include": "#flow_control" + }, + { + "include": "#interpolation" + }, + { + "include": "#property_list" + }, + { + "include": "#rules" + } + ] + } + ] + }, + "at_rule_media": { + "patterns": [ + { + "begin": "^\\s*((@)media)\\b", + "beginCaptures": { + "1": { + "name": "keyword.control.at-rule.media.scss" + }, + "2": { + "name": "punctuation.definition.keyword.scss" + } + }, + "end": "\\s*(?={)", + "name": "meta.at-rule.media.scss", + "patterns": [ + { + "include": "#comment_docblock" + }, + { + "include": "#comment_block" + }, + { + "include": "#comment_line" + }, + { + "match": "\\b(only)\\b", + "name": "keyword.control.operator.css.scss" + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.media-query.begin.bracket.round.scss" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.media-query.end.bracket.round.scss" + } + }, + "name": "meta.property-list.media-query.scss", + "patterns": [ + { + "begin": "(?=|<|>", + "name": "keyword.operator.comparison.scss" + }, + "logical_operators": { + "match": "\\b(not|or|and)\\b", + "name": "keyword.operator.logical.scss" + }, + "map": { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.map.begin.bracket.round.scss" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.map.end.bracket.round.scss" + } + }, + "name": "meta.definition.variable.map.scss", + "patterns": [ + { + "include": "#comment_docblock" + }, + { + "include": "#comment_block" + }, + { + "include": "#comment_line" + }, + { + "match": "\\b([\\w-]+)\\s*(:)", + "captures": { + "1": { + "name": "support.type.map.key.scss" + }, + "2": { + "name": "punctuation.separator.key-value.scss" + } + } + }, + { + "match": ",", + "name": "punctuation.separator.delimiter.scss" + }, + { + "include": "#map" + }, + { + "include": "#variable" + }, + { + "include": "#property_values" + } + ] + }, + "operators": { + "match": "[-+*/](?!\\s*[-+*/])", + "name": "keyword.operator.css" + }, + "parameters": { + "patterns": [ + { + "include": "#variable" + }, + { + "begin": "\\(", + "beginCaptures": { + "0": { + "name": "punctuation.definition.begin.bracket.round.scss" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.end.bracket.round.scss" + } + }, + "patterns": [ + { + "include": "#function_attributes" + } + ] + }, + { + "include": "#property_values" + }, + { + "include": "#comment_block" + }, + { + "match": "[^'\",) \\t]+", + "name": "variable.parameter.url.scss" + }, + { + "match": ",", + "name": "punctuation.separator.delimiter.scss" + } + ] + }, + "properties": { + "patterns": [ + { + "begin": "(?+~|] # - Another selector\n | \\.[^$] # - Class selector, negating module variable\n | /\\* # - A block comment\n | ; # - A semicolon\n)", + "name": "entity.other.attribute-name.class.css", + "captures": { + "1": { + "name": "punctuation.definition.entity.css" + }, + "2": { + "patterns": [ + { + "include": "#interpolation" + }, + { + "match": "\\\\([0-9a-fA-F]{1,6}|.)", + "name": "constant.character.escape.scss" + }, + { + "match": "\\$|}", + "name": "invalid.illegal.scss" + } + ] + } + } + }, + "selector_custom": { + "match": "\\b([a-zA-Z0-9]+(-[a-zA-Z0-9]+)+)(?=\\.|\\s++[^:]|\\s*[,\\[{]|:(link|visited|hover|active|focus|target|lang|disabled|enabled|checked|indeterminate|root|nth-(child|last-child|of-type|last-of-type)|first-child|last-child|first-of-type|last-of-type|only-child|only-of-type|empty|not|valid|invalid)(\\([0-9A-Za-z]*\\))?)", + "name": "entity.name.tag.custom.scss" + }, + "selector_id": { + "match": "(?x)\n(\\#) # Valid id-name\n(\n (?: [-a-zA-Z_0-9]|[^\\x00-\\x7F] # Valid identifier characters\n | \\\\(?:[0-9a-fA-F]{1,6}|.) # Escape sequence\n | \\#\\{ # Interpolation (escaped to avoid Coffeelint errors)\n | \\.?\\$ # Possible start of interpolation variable\n | } # Possible end of interpolation\n )+\n) # Followed by either:\n(?= $ # - End of the line\n | [\\s,\\#)\\[:{>+~|] # - Another selector\n | \\.[^$] # - Class selector, negating module variable\n | /\\* # - A block comment\n)", + "name": "entity.other.attribute-name.id.css", + "captures": { + "1": { + "name": "punctuation.definition.entity.css" + }, + "2": { + "patterns": [ + { + "include": "#interpolation" + }, + { + "match": "\\\\([0-9a-fA-F]{1,6}|.)", + "name": "constant.character.escape.scss" + }, + { + "match": "\\$|}", + "name": "invalid.illegal.identifier.scss" + } + ] + } + } + }, + "selector_placeholder": { + "match": "(?x)\n(%) # Valid placeholder-name\n(\n (?: [-a-zA-Z_0-9]|[^\\x00-\\x7F] # Valid identifier characters\n | \\\\(?:[0-9a-fA-F]{1,6}|.) # Escape sequence\n | \\#\\{ # Interpolation (escaped to avoid Coffeelint errors)\n | \\.\\$ # Possible start of interpolation module scope variable\n | \\$ # Possible start of interpolation variable\n | } # Possible end of interpolation\n )+\n) # Followed by either:\n(?= ; # - End of statement\n | $ # - End of the line\n | [\\s,\\#)\\[:{>+~|] # - Another selector\n | \\.[^$] # - Class selector, negating module variable\n | /\\* # - A block comment\n)", + "name": "entity.other.attribute-name.placeholder.css", + "captures": { + "1": { + "name": "punctuation.definition.entity.css" + }, + "2": { + "patterns": [ + { + "include": "#interpolation" + }, + { + "match": "\\\\([0-9a-fA-F]{1,6}|.)", + "name": "constant.character.escape.scss" + }, + { + "match": "\\$|}", + "name": "invalid.illegal.identifier.scss" + } + ] + } + } + }, + "parent_selector_suffix": { + "match": "(?x)\n(?<=&)\n(\n (?: [-a-zA-Z_0-9]|[^\\x00-\\x7F] # Valid identifier characters\n | \\\\(?:[0-9a-fA-F]{1,6}|.) # Escape sequence\n | \\#\\{ # Interpolation (escaped to avoid Coffeelint errors)\n | \\$ # Possible start of interpolation variable\n | } # Possible end of interpolation\n )+\n) # Followed by either:\n(?= $ # - End of the line\n | [\\s,.\\#)\\[:{>+~|] # - Another selector\n | /\\* # - A block comment\n)", + "name": "entity.other.attribute-name.parent-selector-suffix.css", + "captures": { + "1": { + "name": "punctuation.definition.entity.css" + }, + "2": { + "patterns": [ + { + "include": "#interpolation" + }, + { + "match": "\\\\([0-9a-fA-F]{1,6}|.)", + "name": "constant.character.escape.scss" + }, + { + "match": "\\$|}", + "name": "invalid.illegal.identifier.scss" + } + ] + } + } + }, + "selector_pseudo_class": { + "patterns": [ + { + "begin": "((:)\\bnth-(?:child|last-child|of-type|last-of-type))(\\()", + "beginCaptures": { + "1": { + "name": "entity.other.attribute-name.pseudo-class.css" + }, + "2": { + "name": "punctuation.definition.entity.css" + }, + "3": { + "name": "punctuation.definition.pseudo-class.begin.bracket.round.css" + } + }, + "end": "\\)", + "endCaptures": { + "0": { + "name": "punctuation.definition.pseudo-class.end.bracket.round.css" + } + }, + "patterns": [ + { + "include": "#interpolation" + }, + { + "match": "\\d+", + "name": "constant.numeric.css" + }, + { + "match": "(?<=\\d)n\\b|\\b(n|even|odd)\\b", + "name": "constant.other.scss" + }, + { + "match": "\\w+", + "name": "invalid.illegal.scss" + } + ] + }, + { + "include": "source.css#pseudo-classes" + }, + { + "include": "source.css#pseudo-elements" + }, + { + "include": "source.css#functional-pseudo-classes" + } + ] + }, + "selectors": { + "patterns": [ + { + "include": "source.css#tag-names" + }, + { + "include": "#selector_custom" + }, + { + "include": "#selector_class" + }, + { + "include": "#selector_id" + }, + { + "include": "#selector_pseudo_class" + }, + { + "include": "#tag_wildcard" + }, + { + "include": "#tag_parent_reference" + }, + { + "include": "source.css#pseudo-elements" + }, + { + "include": "#selector_attribute" + }, + { + "include": "#selector_placeholder" + }, + { + "include": "#parent_selector_suffix" + } + ] + }, + "string_double": { + "begin": "\"", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.scss" + } + }, + "end": "\"", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.scss" + } + }, + "name": "string.quoted.double.scss", + "patterns": [ + { + "match": "\\\\(\\h{1,6}|.)", + "name": "constant.character.escape.scss" + }, + { + "include": "#interpolation" + } + ] + }, + "string_single": { + "begin": "'", + "beginCaptures": { + "0": { + "name": "punctuation.definition.string.begin.scss" + } + }, + "end": "'", + "endCaptures": { + "0": { + "name": "punctuation.definition.string.end.scss" + } + }, + "name": "string.quoted.single.scss", + "patterns": [ + { + "match": "\\\\(\\h{1,6}|.)", + "name": "constant.character.escape.scss" + }, + { + "include": "#interpolation" + } + ] + }, + "tag_parent_reference": { + "match": "&", + "name": "entity.name.tag.reference.scss" + }, + "tag_wildcard": { + "match": "\\*", + "name": "entity.name.tag.wildcard.scss" + }, + "variable": { + "patterns": [ + { + "include": "#variables" + }, + { + "include": "#interpolation" + } + ] + }, + "variable_setting": { + "begin": "(?=\\$[\\w-]+\\s*:)", + "end": ";", + "endCaptures": { + "0": { + "name": "punctuation.terminator.rule.scss" + } + }, + "contentName": "meta.definition.variable.scss", + "patterns": [ + { + "match": "\\$[\\w-]+(?=\\s*:)", + "name": "variable.scss" + }, + { + "begin": ":", + "beginCaptures": { + "0": { + "name": "punctuation.separator.key-value.scss" + } + }, + "end": "(?=;)", + "patterns": [ + { + "include": "#comment_docblock" + }, + { + "include": "#comment_block" + }, + { + "include": "#comment_line" + }, + { + "include": "#map" + }, + { + "include": "#property_values" + }, + { + "include": "#variable" + }, + { + "match": ",", + "name": "punctuation.separator.delimiter.scss" + } + ] + } + ] + }, + "variables": { + "patterns": [ + { + "match": "\\b([\\w-]+)(\\.)(\\$[\\w-]+)\\b", + "captures": { + "1": { + "name": "variable.scss" + }, + "2": { + "name": "punctuation.access.module.scss" + }, + "3": { + "name": "variable.scss" + } + } + }, + { + "match": "(\\$|\\-\\-)[A-Za-z0-9_-]+\\b", + "name": "variable.scss" + } + ] + } + } +} diff --git a/data/source.csx.json b/data/source.csx.json new file mode 100644 index 0000000..38e0a0c --- /dev/null +++ b/data/source.csx.json @@ -0,0 +1,16 @@ +{ + "scopeName": "source.csx", + "name": "C# Script File", + "fileTypes": [ + "csx" + ], + "patterns": [ + { + "include": "source.cs" + }, + { + "match": "^#(load|r)", + "name": "preprocessor.source.csx" + } + ] +} diff --git a/data/source.diff.json b/data/source.diff.json new file mode 100644 index 0000000..ab7ea53 --- /dev/null +++ b/data/source.diff.json @@ -0,0 +1,149 @@ +{ + "fileTypes": [ + "diff", + "patch", + "rej" + ], + "firstLineMatch": "(?x)^\n\t\t(===\\ modified\\ file\n\t\t|==== \\s* // .+ \\s - \\s .+ \\s+ ====\n\t\t|Index:\\ \n\t\t|---\\ [^%\\n]\n\t\t|\\*\\*\\*.*\\d{4}\\s*$\n\t\t|\\d+(,\\d+)* (a|d|c) \\d+(,\\d+)* $\n\t\t|diff\\ --git\\ \n\t\t|commit\\ [0-9a-f]{40}$\n\t\t)", + "name": "Diff", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.separator.diff" + } + }, + "match": "^((\\*{15})|(={67})|(-{3}))$\\n?", + "name": "meta.separator.diff" + }, + { + "match": "^\\d+(,\\d+)*(a|d|c)\\d+(,\\d+)*$\\n?", + "name": "meta.diff.range.normal" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.range.diff" + }, + "2": { + "name": "meta.toc-list.coordinates.diff" + }, + "3": { + "name": "punctuation.definition.range.diff" + } + }, + "match": "^(@@)\\s*(.+?)\\s*(@@)($\\n?)?", + "name": "meta.diff.range.unified" + }, + { + "captures": { + "3": { + "name": "punctuation.definition.range.diff" + }, + "4": { + "name": "punctuation.definition.range.diff" + }, + "6": { + "name": "punctuation.definition.range.diff" + }, + "7": { + "name": "punctuation.definition.range.diff" + } + }, + "match": "^(((\\-{3}) .+ (\\-{4}))|((\\*{3}) .+ (\\*{4})))$\\n?", + "name": "meta.diff.range.context" + }, + { + "match": "^diff --git a/.*$\\n?", + "name": "meta.diff.header.git" + }, + { + "match": "^diff (-|\\S+\\s+\\S+).*$\\n?", + "name": "meta.diff.header.command" + }, + { + "captures": { + "4": { + "name": "punctuation.definition.from-file.diff" + }, + "6": { + "name": "punctuation.definition.from-file.diff" + }, + "7": { + "name": "punctuation.definition.from-file.diff" + } + }, + "match": "(^(((-{3}) .+)|((\\*{3}) .+))$\\n?|^(={4}) .+(?= - ))", + "name": "meta.diff.header.from-file" + }, + { + "captures": { + "2": { + "name": "punctuation.definition.to-file.diff" + }, + "3": { + "name": "punctuation.definition.to-file.diff" + }, + "4": { + "name": "punctuation.definition.to-file.diff" + } + }, + "match": "(^(\\+{3}) .+$\\n?| (-) .* (={4})$\\n?)", + "name": "meta.diff.header.to-file" + }, + { + "captures": { + "3": { + "name": "punctuation.definition.inserted.diff" + }, + "6": { + "name": "punctuation.definition.inserted.diff" + } + }, + "match": "^(((>)( .*)?)|((\\+).*))$\\n?", + "name": "markup.inserted.diff" + }, + { + "captures": { + "1": { + "name": "punctuation.definition.changed.diff" + } + }, + "match": "^(!).*$\\n?", + "name": "markup.changed.diff" + }, + { + "captures": { + "3": { + "name": "punctuation.definition.deleted.diff" + }, + "6": { + "name": "punctuation.definition.deleted.diff" + } + }, + "match": "^(((<)( .*)?)|((-).*))$\\n?", + "name": "markup.deleted.diff" + }, + { + "match": "^index [0-9a-f]{7,40}\\.\\.[0-9a-f]{7,40}.*$\\n?", + "name": "meta.diff.index.git" + }, + { + "captures": { + "1": { + "name": "punctuation.separator.key-value.diff" + }, + "2": { + "name": "meta.toc-list.file-name.diff" + } + }, + "match": "^Index(:) (.+)$\\n?", + "name": "meta.diff.index" + }, + { + "match": "^Only in .*: .*$\\n?", + "name": "meta.diff.only-in" + } + ], + "scopeName": "source.diff" +} diff --git a/data/source.gfm.json b/data/source.gfm.json new file mode 100644 index 0000000..3eda2fe --- /dev/null +++ b/data/source.gfm.json @@ -0,0 +1,1926 @@ +{ + "name": "GitHub Markdown", + "scopeName": "source.gfm", + "limitLineLength": false, + "fileTypes": [ + "markdown", + "md", + "mdown", + "mdwn", + "mkd", + "mkdn", + "mkdown", + "rmd", + "ron", + "workbook" + ], + "patterns": [ + { + "include": "#blocks" + }, + { + "include": "#inlines" + }, + { + "include": "#flavors" + } + ], + "repository": { + "blocks": { + "patterns": [ + { + "include": "#headings" + }, + { + "include": "#fenced-code-blocks" + }, + { + "include": "#fenced-code" + }, + { + "include": "#comments" + }, + { + "include": "#front-matter" + }, + { + "include": "#hr" + }, + { + "include": "#lists" + }, + { + "include": "#quotes" + }, + { + "include": "#github-blocks" + } + ] + }, + "inlines": { + "patterns": [ + { + "include": "#escapes" + }, + { + "include": "#code" + }, + { + "include": "#links" + }, + { + "include": "#emphasis" + }, + { + "include": "#line-breaks" + }, + { + "include": "#entities" + }, + { + "include": "#github-inlines" + } + ] + }, + "flavors": { + "patterns": [ + { + "include": "#criticmark" + }, + { + "include": "#github-inlines" + } + ] + }, + "inlines-in-blocks": { + "patterns": [ + { + "include": "#escapes" + }, + { + "include": "#code" + }, + { + "include": "#entities" + }, + { + "include": "#links" + }, + { + "include": "#emphasis" + }, + { + "include": "#flavors" + } + ] + }, + "inlines-in-inlines": { + "patterns": [ + { + "include": "#escapes" + }, + { + "include": "#code" + }, + { + "include": "#entities" + }, + { + "include": "#links" + }, + { + "include": "#emphasis" + }, + { + "include": "#github-inlines" + }, + { + "include": "#criticmark" + } + ] + }, + "headings": { + "patterns": [ + { + "begin": "^(#{6})(\\s*)", + "end": "$", + "name": "markup.heading.heading-6.gfm", + "captures": { + "1": { + "name": "markup.heading.marker.gfm" + }, + "2": { + "name": "markup.heading.space.gfm" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "begin": "^(#{5})(\\s*)", + "end": "$", + "name": "markup.heading.heading-5.gfm", + "captures": { + "1": { + "name": "markup.heading.marker.gfm" + }, + "2": { + "name": "markup.heading.space.gfm" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "begin": "^(#{4})(\\s*)", + "end": "$", + "name": "markup.heading.heading-4.gfm", + "captures": { + "1": { + "name": "markup.heading.marker.gfm" + }, + "2": { + "name": "markup.heading.space.gfm" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "begin": "^(#{3})(\\s*)", + "end": "$", + "name": "markup.heading.heading-3.gfm", + "captures": { + "1": { + "name": "markup.heading.marker.gfm" + }, + "2": { + "name": "markup.heading.space.gfm" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "begin": "^(#{2})(\\s*)", + "end": "$", + "name": "markup.heading.heading-2.gfm", + "captures": { + "1": { + "name": "markup.heading.marker.gfm" + }, + "2": { + "name": "markup.heading.space.gfm" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + }, + { + "begin": "^(#{1})(\\s*)", + "end": "$", + "name": "markup.heading.heading-1.gfm", + "captures": { + "1": { + "name": "markup.heading.marker.gfm" + }, + "2": { + "name": "markup.heading.space.gfm" + } + }, + "patterns": [ + { + "include": "$self" + } + ] + } + ] + }, + "comments": { + "patterns": [ + { + "begin": ")\n\t\t|\\{\\s*($|\\?>\\s*$|//|/\\*(.*\\*/\\s*$|(?!.*?\\*/)))\n\t\t)", + "foldingStopMarker": "(?x)\n\t\t(\n\t\t|^\\s*-->\n\t\t|(^|\\s)\\}\n\t\t)", + "patterns": [ + { + "begin": "<%+#", + "captures": { + "0": { + "name": "punctuation.definition.comment.erb" + } + }, + "end": "%>", + "name": "comment.block.erb" + }, + { + "begin": "<%+(?!>)[-=]?", + "captures": { + "0": { + "name": "punctuation.section.embedded.ruby" + } + }, + "end": "-?%>", + "name": "source.ruby.rails.embedded.html", + "patterns": [ + { + "captures": { + "1": { + "name": "punctuation.definition.comment.ruby" + } + }, + "match": "(#).*?(?=-?%>)", + "name": "comment.line.number-sign.ruby" + }, + { + "include": "source.ruby.rails" + } + ] + }, + { + "include": "text.html.basic" + } + ] +} diff --git a/data/smarty/smarty.json b/data/text.html.smarty.json similarity index 100% rename from data/smarty/smarty.json rename to data/text.html.smarty.json diff --git a/data/textile/textile.json b/data/text.html.textile.json similarity index 100% rename from data/textile/textile.json rename to data/text.html.textile.json diff --git a/data/text.hyperlink.json b/data/text.hyperlink.json new file mode 100644 index 0000000..8a718b5 --- /dev/null +++ b/data/text.hyperlink.json @@ -0,0 +1,18 @@ +{ + "scopeName": "text.hyperlink", + "injectionSelector": "text - string.regexp, string - string.regexp, comment, source.gfm", + "patterns": [ + { + "match": "(?x)\\b(https?|s?ftp|ftps|file|smb|afp|nfs|(?:x-)?man(?:-page)?|gopher|txmt|issue|atom)://((?!(\\#[[:word:]]*\\#))(?:[-:@[:word:].,~%+_/?=&#;|!]|\\((?:(?!(\\#[[:word:]]*\\#))[-:@[:word:].,~%+_/?=&#;|!])*\\)))+(?", + "name": "storage.type.class.radar" + } + ] +} diff --git a/data/xml/xml.json b/data/text.xml.json similarity index 99% rename from data/xml/xml.json rename to data/text.xml.json index 036bc80..24a2ac5 100644 --- a/data/xml/xml.json +++ b/data/text.xml.json @@ -431,9 +431,9 @@ { "begin": "<%--", "captures": { - "0": { - "name": "punctuation.definition.comment.xml" - } + "0": { + "name": "punctuation.definition.comment.xml" + } }, "end": "--%>", "name": "comment.block.xml" diff --git a/data/text.xml.plist.json b/data/text.xml.plist.json new file mode 100644 index 0000000..791c57e --- /dev/null +++ b/data/text.xml.plist.json @@ -0,0 +1,691 @@ +{ + "fileTypes": [ + "plist", + "dict", + "scriptSuite", + "scriptTerminology", + "savedSearch", + "wflow" + ], + "firstLineMatch": "\\s*<\\?xml .*\\n\\s*))", + "patterns": [ + { + "begin": "(?<=)\\s*(?:(version)(=)(?:((\").*?(\"))|((').*?('))))?", + "beginCaptures": { + "1": { + "name": "entity.other.attribute-name.version.xml.plist" + }, + "2": { + "name": "punctuation.separator.key-value.xml.plist" + }, + "3": { + "name": "string.quoted.double.xml.plist" + }, + "4": { + "name": "punctuation.definition.string.begin.xml.plist" + }, + "5": { + "name": "punctuation.definition.string.end.xml.plist" + }, + "6": { + "name": "string.quoted.single.xml.plist" + }, + "7": { + "name": "punctuation.definition.string.begin.xml.plist" + }, + "8": { + "name": "punctuation.definition.string.end.xml.plist" + } + }, + "end": "(?=>)", + "name": "meta.tag.plist.xml.plist" + }, + { + "captures": { + "1": { + "name": "meta.tag.plist.xml.plist" + }, + "2": { + "name": "punctuation.definition.tag.xml.plist" + }, + "3": { + "name": "meta.scope.between-tag-pair.xml.plist" + } + }, + "comment": "Tag with no content", + "match": "((>(<)))(?=/plist)" + }, + { + "begin": "((>))(?!", + "name": "comment.block.xml.plist", + "patterns": [ + { + "match": "-(?=-->)|--", + "name": "invalid.illegal.double-dash-not-allowed.xml.plist" + } + ] + }, + "xml_innertag": { + "patterns": [ + { + "match": "&([a-zA-Z0-9_-]+|#[0-9]+|#x[0-9a-fA-F]+);", + "name": "constant.character.entity.xml.plist" + }, + { + "match": "&", + "name": "invalid.illegal.bad-ampersand.xml.plist" + } + ] + }, + "xml_invalid": { + "captures": { + "1": { + "name": "meta.tag.boolean.xml.plist" + }, + "2": { + "name": "punctuation.definition.tag.xml.plist" + }, + "3": { + "name": "invalid.illegal.tag-not-recognized.xml.plist" + }, + "4": { + "name": "punctuation.definition.tag.xml.plist" + } + }, + "comment": "Invalid tag", + "match": "((<)/?(\\w+).*?(>))" + }, + "xml_stray-char": { + "match": "\\S", + "name": "invalid.illegal.character-data-not-allowed-here.xml.plist" + }, + "xml_tags": { + "patterns": [ + { + "captures": { + "1": { + "name": "meta.tag.dict.xml.plist" + }, + "2": { + "name": "punctuation.definition.tag.xml.plist" + }, + "3": { + "name": "entity.name.tag.xml.plist" + }, + "4": { + "name": "entity.name.tag.localname.xml.plist" + }, + "5": { + "name": "punctuation.definition.tag.xml.plist" + }, + "6": { + "name": "meta.tag.dict.xml.plist" + }, + "7": { + "name": "punctuation.definition.tag.xml.plist" + }, + "8": { + "name": "meta.scope.between-tag-pair.xml.plist" + }, + "9": { + "name": "entity.name.tag.xml.plist" + }, + "10": { + "name": "entity.name.tag.localname.xml.plist" + }, + "11": { + "name": "punctuation.definition.tag.xml.plist" + } + }, + "comment": "Empty tag: Dictionary", + "match": "((<)((dict))(>))(((<)/)((dict))(>))" + }, + { + "captures": { + "1": { + "name": "meta.tag.array.xml.plist" + }, + "2": { + "name": "punctuation.definition.tag.xml.plist" + }, + "3": { + "name": "entity.name.tag.xml.plist" + }, + "4": { + "name": "entity.name.tag.localname.xml.plist" + }, + "5": { + "name": "punctuation.definition.tag.xml.plist" + }, + "6": { + "name": "meta.tag.array.xml.plist" + }, + "7": { + "name": "punctuation.definition.tag.xml.plist" + }, + "8": { + "name": "meta.scope.between-tag-pair.xml.plist" + }, + "9": { + "name": "entity.name.tag.xml.plist" + }, + "10": { + "name": "entity.name.tag.localname.xml.plist" + }, + "11": { + "name": "punctuation.definition.tag.xml.plist" + } + }, + "comment": "Empty tag: Array", + "match": "((<)((array))(>))(((<)/)((array))(>))" + }, + { + "captures": { + "1": { + "name": "meta.tag.string.xml.plist" + }, + "2": { + "name": "punctuation.definition.tag.xml.plist" + }, + "3": { + "name": "entity.name.tag.xml.plist" + }, + "4": { + "name": "entity.name.tag.localname.xml.plist" + }, + "5": { + "name": "punctuation.definition.tag.xml.plist" + }, + "6": { + "name": "meta.tag.string.xml.plist" + }, + "7": { + "name": "punctuation.definition.tag.xml.plist" + }, + "8": { + "name": "meta.scope.between-tag-pair.xml.plist" + }, + "9": { + "name": "entity.name.tag.xml.plist" + }, + "10": { + "name": "entity.name.tag.localname.xml.plist" + }, + "11": { + "name": "punctuation.definition.tag.xml.plist" + } + }, + "comment": "Empty tag: String", + "match": "((<)((string))(>))(((<)/)((string))(>))" + }, + { + "begin": "((<)((key))(>))", + "captures": { + "1": { + "name": "meta.tag.key.xml.plist" + }, + "2": { + "name": "punctuation.definition.tag.xml.plist" + }, + "3": { + "name": "entity.name.tag.xml.plist" + }, + "4": { + "name": "entity.name.tag.localname.xml.plist" + }, + "5": { + "name": "punctuation.definition.tag.xml.plist" + } + }, + "comment": "the extra captures are required to duplicate the effect of the namespace parsing in the XML syntax", + "contentName": "constant.other.name.xml.plist", + "end": "(())", + "patterns": [ + { + "begin": "" + } + ] + }, + { + "captures": { + "1": { + "name": "meta.tag.dict.xml.plist" + }, + "2": { + "name": "punctuation.definition.tag.xml.plist" + }, + "3": { + "name": "entity.name.tag.xml.plist" + }, + "4": { + "name": "entity.name.tag.localname.xml.plist" + }, + "5": { + "name": "punctuation.definition.tag.xml.plist" + } + }, + "comment": "Self-closing Dictionary", + "match": "((<)((dict))\\s*?/(>))" + }, + { + "captures": { + "1": { + "name": "meta.tag.array.xml.plist" + }, + "2": { + "name": "punctuation.definition.tag.xml.plist" + }, + "3": { + "name": "entity.name.tag.xml.plist" + }, + "4": { + "name": "entity.name.tag.localname.xml.plist" + }, + "5": { + "name": "punctuation.definition.tag.xml.plist" + } + }, + "comment": "Self-closing Array", + "match": "((<)((array))\\s*?/(>))" + }, + { + "captures": { + "1": { + "name": "meta.tag.string.xml.plist" + }, + "2": { + "name": "punctuation.definition.tag.xml.plist" + }, + "3": { + "name": "entity.name.tag.xml.plist" + }, + "4": { + "name": "entity.name.tag.localname.xml.plist" + }, + "5": { + "name": "punctuation.definition.tag.xml.plist" + } + }, + "comment": "Self-closing String", + "match": "((<)((string))\\s*?/(>))" + }, + { + "captures": { + "1": { + "name": "meta.tag.key.xml.plist" + }, + "2": { + "name": "punctuation.definition.tag.xml.plist" + }, + "3": { + "name": "entity.name.tag.xml.plist" + }, + "4": { + "name": "entity.name.tag.localname.xml.plist" + }, + "5": { + "name": "punctuation.definition.tag.xml.plist" + } + }, + "comment": "Self-closing Key", + "match": "((<)((key))\\s*?/(>))" + }, + { + "begin": "((<)((dict))(>))", + "captures": { + "1": { + "name": "meta.tag.dict.xml.plist" + }, + "2": { + "name": "punctuation.definition.tag.xml.plist" + }, + "3": { + "name": "entity.name.tag.xml.plist" + }, + "4": { + "name": "entity.name.tag.localname.xml.plist" + }, + "5": { + "name": "punctuation.definition.tag.xml.plist" + } + }, + "comment": "Dictionary", + "end": "(())", + "patterns": [ + { + "include": "#xml_tags" + } + ] + }, + { + "begin": "((<)((array))(>))", + "captures": { + "1": { + "name": "meta.tag.array.xml.plist" + }, + "2": { + "name": "punctuation.definition.tag.xml.plist" + }, + "3": { + "name": "entity.name.tag.xml.plist" + }, + "4": { + "name": "entity.name.tag.localname.xml.plist" + }, + "5": { + "name": "punctuation.definition.tag.xml.plist" + } + }, + "comment": "Array", + "end": "(())", + "patterns": [ + { + "include": "#xml_tags" + } + ] + }, + { + "begin": "((<)((string))(>))", + "captures": { + "1": { + "name": "meta.tag.string.xml.plist" + }, + "2": { + "name": "punctuation.definition.tag.xml.plist" + }, + "3": { + "name": "entity.name.tag.xml.plist" + }, + "4": { + "name": "entity.name.tag.localname.xml.plist" + }, + "5": { + "name": "punctuation.definition.tag.xml.plist" + } + }, + "comment": "Strings", + "contentName": "string.quoted.other.xml.plist", + "end": "(())", + "patterns": [ + { + "include": "#xml_innertag" + }, + { + "begin": "", + "name": "string.unquoted.cdata.xml" + } + ] + }, + { + "begin": "((<)((real))(>))", + "captures": { + "1": { + "name": "meta.tag.real.xml.plist" + }, + "2": { + "name": "punctuation.definition.tag.xml.plist" + }, + "3": { + "name": "entity.name.tag.xml.plist" + }, + "4": { + "name": "entity.name.tag.localname.xml.plist" + }, + "5": { + "name": "punctuation.definition.tag.xml.plist" + } + }, + "comment": "Numeric", + "end": "(())", + "patterns": [ + { + "begin": "()", + "patterns": [ + { + "match": "[-+]?\\d+(\\.\\d*)?(E[-+]\\d+)?", + "name": "constant.numeric.real.xml.plist" + }, + { + "match": ".", + "name": "invalid.illegal.not-a-number.xml.plist" + } + ] + }, + { + "match": "[-+]?\\d+(\\.\\d*)?(E[-+]\\d+)?", + "name": "constant.numeric.real.xml.plist" + }, + { + "match": ".", + "name": "invalid.illegal.not-a-number.xml.plist" + } + ] + }, + { + "begin": "((<)((integer))(>))", + "captures": { + "1": { + "name": "meta.tag.integer.xml.plist" + }, + "2": { + "name": "punctuation.definition.tag.xml.plist" + }, + "3": { + "name": "entity.name.tag.xml.plist" + }, + "4": { + "name": "entity.name.tag.localname.xml.plist" + }, + "5": { + "name": "punctuation.definition.tag.xml.plist" + } + }, + "comment": "Integer", + "end": "(())", + "patterns": [ + { + "match": "[-+]?\\d+", + "name": "constant.numeric.integer.xml.plist" + }, + { + "match": ".", + "name": "invalid.illegal.not-a-number.xml.plist" + } + ] + }, + { + "captures": { + "1": { + "name": "meta.tag.boolean.xml.plist" + }, + "2": { + "name": "punctuation.definition.tag.xml.plist" + }, + "3": { + "name": "entity.name.tag.xml.plist" + }, + "4": { + "name": "entity.name.tag.localname.xml.plist" + }, + "5": { + "name": "punctuation.definition.tag.xml.plist" + } + }, + "comment": "Boolean", + "match": "((<)((true|false))\\s*?(/>))" + }, + { + "begin": "((<)((data))(>))", + "captures": { + "1": { + "name": "meta.tag.data.xml.plist" + }, + "2": { + "name": "punctuation.definition.tag.xml.plist" + }, + "3": { + "name": "entity.name.tag.xml.plist" + }, + "4": { + "name": "entity.name.tag.localname.xml.plist" + }, + "5": { + "name": "punctuation.definition.tag.xml.plist" + } + }, + "comment": "Data", + "end": "(())", + "patterns": [ + { + "match": "[A-Za-z0-9+/]", + "name": "constant.numeric.base64.xml.plist" + }, + { + "match": "=", + "name": "constant.numeric.base64.xml.plist" + }, + { + "match": "[^ \\n\\t]", + "name": "invalid.illegal.invalid-character.xml.plist" + } + ] + }, + { + "begin": "((<)((date))(>))", + "captures": { + "1": { + "name": "meta.tag.date.xml.plist" + }, + "2": { + "name": "punctuation.definition.tag.xml.plist" + }, + "3": { + "name": "entity.name.tag.xml.plist" + }, + "4": { + "name": "entity.name.tag.localname.xml.plist" + }, + "5": { + "name": "punctuation.definition.tag.xml.plist" + } + }, + "comment": "Date", + "end": "(())", + "patterns": [ + { + "match": "(?x)\n\t\t\t\t\t\t\t\t\t\t[0-9]{4}\t\t\t\t\t\t# Year\n\t\t\t\t\t\t\t\t\t\t-\t\t\t\t\t\t\t\t# Divider\n\t\t\t\t\t\t\t\t\t\t(0[1-9]|1[012])\t\t\t\t\t# Month\n\t\t\t\t\t\t\t\t\t\t-\t\t\t\t\t\t\t\t# Divider\n\t\t\t\t\t\t\t\t\t\t(?!00|3[2-9])[0-3][0-9]\t\t\t# Day\n\t\t\t\t\t\t\t\t\t\tT\t\t\t\t\t\t\t\t# Separator\n\t\t\t\t\t\t\t\t\t\t(?!2[5-9])[0-2][0-9]\t\t\t# Hour\n\t\t\t\t\t\t\t\t\t\t:\t\t\t\t\t\t\t\t# Divider\n\t\t\t\t\t\t\t\t\t\t[0-5][0-9]\t\t\t\t\t\t# Minute\n\t\t\t\t\t\t\t\t\t\t:\t\t\t\t\t\t\t\t# Divider\n\t\t\t\t\t\t\t\t\t\t(?!6[1-9])[0-6][0-9]\t\t\t# Second\n\t\t\t\t\t\t\t\t\t\tZ\t\t\t\t\t\t\t\t# Zulu\n\t\t\t\t\t\t\t\t\t", + "name": "constant.other.date.xml.plist" + } + ] + }, + { + "include": "#xml_invalid" + }, + { + "include": "#xml_comment" + }, + { + "include": "#xml_stray-char" + } + ] + } + }, + "scopeName": "text.xml.plist" +} diff --git a/data/xml/xsl.json b/data/text.xml.xsl.json similarity index 100% rename from data/xml/xsl.json rename to data/text.xml.xsl.json diff --git a/lib/Grammar.php b/lib/Grammar.php index c2df3d5..2f3517b 100644 --- a/lib/Grammar.php +++ b/lib/Grammar.php @@ -31,7 +31,7 @@ class Grammar { protected string $_scopeName; - public function __construct(string $scopeName, PatternList $patterns, ?string $name = null, ?string $contentRegex = null, ?string $firstLineMatch = null, ?InjectionList $injections = null, ?Repository $repository = null, bool $register = false) { + public function __construct(string $scopeName, PatternList $patterns, ?string $name = null, ?string $contentRegex = null, ?string $firstLineMatch = null, ?InjectionList $injections = null, ?Repository $repository = null, bool $register = true) { $this->_name = $name; $this->_scopeName = $scopeName; $this->_patterns = $patterns; diff --git a/lib/Tokenizer.php b/lib/Tokenizer.php index 7f49a02..386e66b 100644 --- a/lib/Tokenizer.php +++ b/lib/Tokenizer.php @@ -9,7 +9,8 @@ namespace dW\Lit; class Tokenizer { protected \Generator $data; - public function __construct(\Generator $data) { + + public function __construct(\Generator $data, Grammar $grammar) { $this->data = $data; } diff --git a/run b/run index 2392404..a5f270c 100755 --- a/run +++ b/run @@ -19,30 +19,31 @@ ##? * bash >=5.0 ##? * composer >=2.0.6 ##? * docopts >=0.6.3 -##? * GNU awk >=5.1.0 ##? * GNU coreutils >=8.0 ##? * GNU parallel >=20180922 +##? * jq >=1.6 ##? * yarn >=1.22.10 ##? ##? Arch Linux: -##? ``` -##? pacman -S composer docopts parallel yarn -##? ``` +##? +##? +##? pacman -S composer docopts jq parallel yarn +##? ##? ##? macOS: -##? ``` -##? brew install bash composer coreutils docopts gawk parallel yarn +##? +##? +##? brew install bash composer coreutils docopts jq parallel yarn ##? echo \"/usr/local/bin/bash\" >> /etc/shells ##? chsh -s /usr/local/bin/bash -##? ``` +##? ##? ##? Building the grammars is then a matter of running the following commands ##? from the project folder: ##? -##? ``` +##? ##? ./run init ##? ./run build -##? ``` ##? ##? ##? Commands: @@ -73,16 +74,8 @@ fail() { # Check for bash 4+ and set extra glob options shopt -s globstar extglob || fail -# macOS uses the BSD version of awk which isn't compatible with the linux -# version, so this script requires Mac users to install the GNU version; it -# therefore has a different name on macOS. -awkcmd="awk" -if [ "$(uname)" == "Darwin" ]; then - awkcmd="gawk" -fi - # Check for presence of dependencies -if (( $(which $awkcmd composer parallel yarn | wc -l) < 4 )); then fail; fi +if (( $(which composer jq parallel yarn | wc -l) < 4 )); then fail; fi # Process the subcommand subcmd="build" @@ -91,28 +84,44 @@ subcmd=$([ "${args[needed]}" == "true" ] && echo "needed" || echo "$subcmd") # Grammar table of the github repository location followed by its local folder # name -read -r -d '' grammarTable <<'EOF' -franzheidl/atom-applescript applescript -atom/language-c c -atom/language-coffee-script coffeescript -atom/language-css css -rmosolgo/language-graphql graphql -atom/language-html html -atom/language-java java -atom/language-javascript javascript -atom/language-json json -burodepeper/language-markdown markdown -Azganoth/language-lua-plus lua -atom/language-php php -atom/language-python python -atom/language-ruby ruby -atom/language-shellscript shell -MaxGiting/atom-language-smarty smarty -atom/language-sql sql -al3x/atom-language-textile textile -atom/language-typescript typescript -atom/language-xml xml -EOF +grammars="franzheidl/atom-applescript +atom/language-c +atom/language-coffee-script +atom/language-csharp +atom/language-css +miketheman/language-diff +atom/language-gfm +atom/language-git +atom/language-go +atom/language-html +atom/language-hyperlink +atom/language-java +atom/language-javascript +atom/language-json +atom/language-less +Azganoth/language-lua-plus +burodepeper/language-markdown +atom/language-make +atom/language-mustache +atom/language-objective-c +atom/language-perl +atom/language-php +atom/language-property-list +atom/language-python +atom/language-ruby +atom/language-ruby-on-rails +zargony/atom-language-rust +atom/language-sass +atom/language-shellscript +MaxGiting/atom-language-smarty +atom/language-sql +kelvin13/atom-swift-89 +atom/language-text +atom/language-todo +al3x/atom-language-textile +atom/language-typescript +atom/language-xml +atom/language-yaml" case $subcmd in init) @@ -121,35 +130,35 @@ init) rm -rf "$cwd"/deps/* cd "$cwd"/deps - printf "$grammarTable" | parallel --colsep ' ' "git clone https://github.com/{1}.git" + printf "$grammars" | parallel "git clone --depth 1 https://github.com/{}.git" + cd "$cwd" ;; needed) - grep -Fxv -f <(cd "$cwd"/data && ls -1 *.json | sed -e 's/\.json$//g') <(cat "$cwd"/data/*.json | grep -E "\"include\"\s*:\s*\"[^#\$]+\"" | $awkcmd '{ match($0, /"include": "(.+?)"/, arr); if(arr[1] != "") print arr[1] }' | sort -u) + grep -Fv -f <(ls -1 "$cwd"/data/*.json | parallel "basename {} .json") <(ls -1 "$cwd"/data/*.json | parallel "jq -r '.. | select(.include | startswith(\"\$\") or startswith(\"#\") | not)? | .include?' {}" | sort | uniq | tail -n +2) ;; -build | *) +build) rm -rf "$cwd"/data/* - # Copy grammars folders from all the local language grammar repositories to a - # temporary folder with the names provided in the table above + # Copy root non-tree-sitter cson and json grammar files to a temporary folder in + # subfolders with the repository's name. temp=$(mktemp -d) - printf "$grammarTable" | parallel --colsep ' ' "mkdir -p $temp/{2} && - cp -r \"$cwd\"/deps/\$(basename {1})/grammars/* $temp/{2}/" - - # Convert all relevant CSON files to a format that can actually be used :) - ls -1 $temp/**/!(tree-sitter-*).cson | parallel "csonc --output={.}.json {} && rm {}" - - # Remove any remaining tree sitter files; will also remove JSON ones from - # packages that didn't use CSON - rm $temp/**/tree-sitter-* - - # Lastly, move everything over to the project's data folder and delete the - # temporary folder - mv $temp/* "$cwd"/data/ - rmdir $temp + ls -1 "$cwd"/deps/*/grammars/!(tree-sitter-*).@(cson|json) | parallel " + folder=\"$temp/\$(basename \$(dirname \$(dirname {})))\"; + mkdir -p \"\$folder\" && + cp {} \"\$folder\"/{/}" + + # Convert all cson files in the temp folder to json files + ls -1 $temp/**/*.cson | parallel "csonc --output={.}.json {} && rm {}" + # Move all json files to the root of the temp folder with the filename's being + # the scopeName property within the json files + ls -1 $temp/**/*.json | parallel "mv {} \"$temp/\$(jq -r '.scopeName' {}).json\"" + # Finally, move the json files to the data folder + mv $temp/*.json "$cwd"/data/ + rm -rf $temp ;; esac \ No newline at end of file