diff --git a/composer.json b/composer.json index 43cd5b6..8e7dd20 100644 --- a/composer.json +++ b/composer.json @@ -14,7 +14,8 @@ "php": "^7.4 || ^8.0", "ext-intl": "*", "ext-json": "*", - "ext-dom": "*" + "ext-dom": "*", + "docopt/docopt": "^1.0" }, "autoload": { "psr-4": { diff --git a/composer.lock b/composer.lock index 641c3a0..adf82a0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,59 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "cb22d0620bd4dc89e4d39d6eb9acaebe", - "packages": [], + "content-hash": "eb84c086d7c773cf5f8ad5ad2b9e546e", + "packages": [ + { + "name": "docopt/docopt", + "version": "1.0.4", + "source": { + "type": "git", + "url": "https://github.com/docopt/docopt.php.git", + "reference": "bf3683a16e09fa1665e493eb4d5a29469e132a4f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/docopt/docopt.php/zipball/bf3683a16e09fa1665e493eb4d5a29469e132a4f", + "reference": "bf3683a16e09fa1665e493eb4d5a29469e132a4f", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "4.1.*" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/docopt.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Blake Williams", + "email": "code@shabbyrobe.org", + "homepage": "http://docopt.org/", + "role": "Developer" + } + ], + "description": "Port of Python's docopt for PHP >=5.3", + "homepage": "http://github.com/docopt/docopt.php", + "keywords": [ + "cli", + "docs" + ], + "support": { + "issues": "https://github.com/docopt/docopt.php/issues", + "source": "https://github.com/docopt/docopt.php/tree/1.0.4" + }, + "time": "2019-12-03T02:48:46+00:00" + } + ], "packages-dev": [], "aliases": [], "minimum-stability": "stable", @@ -19,5 +70,5 @@ "ext-dom": "*" }, "platform-dev": [], - "plugin-api-version": "2.0.0" + "plugin-api-version": "2.1.0" } diff --git a/data/source.applescript.json b/data/applescript/applescript.json similarity index 100% rename from data/source.applescript.json rename to data/applescript/applescript.json diff --git a/data/source.cpp.json b/data/c/c++.json similarity index 100% rename from data/source.cpp.json rename to data/c/c++.json diff --git a/data/source.c.json b/data/c/c.json similarity index 100% rename from data/source.c.json rename to data/c/c.json diff --git a/data/source.litcoffee.json b/data/coffeescript/coffeescript (literate).json similarity index 100% rename from data/source.litcoffee.json rename to data/coffeescript/coffeescript (literate).json diff --git a/data/source.coffee.json b/data/coffeescript/coffeescript.json similarity index 100% rename from data/source.coffee.json rename to data/coffeescript/coffeescript.json diff --git a/data/source.css.json b/data/css/css.json similarity index 100% rename from data/source.css.json rename to data/css/css.json diff --git a/data/source.graphql.json b/data/graphql/graphql.json similarity index 100% rename from data/source.graphql.json rename to data/graphql/graphql.json diff --git a/data/text.html.basic.json b/data/html/html.json similarity index 100% rename from data/text.html.basic.json rename to data/html/html.json diff --git a/data/text.html.jsp.json b/data/java/java server pages (jsp).json similarity index 100% rename from data/text.html.jsp.json rename to data/java/java server pages (jsp).json diff --git a/data/source.java.json b/data/java/java.json similarity index 100% rename from data/source.java.json rename to data/java/java.json diff --git a/data/source.java-properties.json b/data/java/javaproperties.json similarity index 100% rename from data/source.java-properties.json rename to data/java/javaproperties.json diff --git a/data/text.junit-test-report.json b/data/java/junit test report.json similarity index 100% rename from data/text.junit-test-report.json rename to data/java/junit test report.json diff --git a/data/source.java.el.json b/data/java/unified expression language (el).json similarity index 100% rename from data/source.java.el.json rename to data/java/unified expression language (el).json diff --git a/data/source.js.json b/data/javascript/javascript.json similarity index 100% rename from data/source.js.json rename to data/javascript/javascript.json diff --git a/data/source.jsdoc.json b/data/javascript/jsdoc.json similarity index 100% rename from data/source.jsdoc.json rename to data/javascript/jsdoc.json diff --git a/data/source.js.regexp.replacement.json b/data/javascript/regular expression replacement (javascript).json similarity index 100% rename from data/source.js.regexp.replacement.json rename to data/javascript/regular expression replacement (javascript).json diff --git a/data/source.js.regexp.json b/data/javascript/regular expressions (javascript).json similarity index 100% rename from data/source.js.regexp.json rename to data/javascript/regular expressions (javascript).json diff --git a/data/source.json.json b/data/json/json.json similarity index 100% rename from data/source.json.json rename to data/json/json.json diff --git a/data/source.lua.json b/data/lua/grammar-lua.json similarity index 100% rename from data/source.lua.json rename to data/lua/grammar-lua.json diff --git a/data/lua/tree-sitter-lua.json b/data/lua/tree-sitter-lua.json new file mode 100644 index 0000000..8a375d8 --- /dev/null +++ b/data/lua/tree-sitter-lua.json @@ -0,0 +1,136 @@ +{ + "name": "Lua", + "scopeName": "source.lua", + "type": "tree-sitter", + "parser": "tree-sitter-lua", + + "fileTypes": [ "lua" ], + + "folds": [ + { + "type": [ + "do_statement", + "while_statement", + "repeat_statement", + "for_statement", + "for_in_statement", + "function", + "local_function", + "function_definition", + "table" + ], + "end": { "index": -1 } + }, + { + "type": ["if_statement","elseif"], + "start": { "index": 1 }, + "end": { "type": [ "else", "elseif" ] } + }, + { + "type": "if_statement", + "start": { "index": 1 }, + "end": { "index": -1 } + }, + { + "type": "elseif", + "start": { "index": 1 } + }, + { + "type": "else", + "start": { "index": 0 } + } + ], + + "comments": { + "start": "-- " + }, + + "scopes": { + "program": "source.lua", + + "comment": "comment", + "string": "string", + "number": "constant.numeric", + + "function > function_name > identifier": "entity.name.function", + "function > function_name > property_identifier": "entity.name.function", + "function > function_name > method": "entity.name.function", + "function > parameters > identifier": "variable.parameter", + + "local_function > identifier": "entity.name.function", + "local_function > parameters > identifier": "variable.parameter", + + "function_call > identifier": "entity.name.function", + "function_call > property_identifier": "entity.name.function", + "function_call > method": "entity.name.function", + + "function_definition > parameters > identifier": "variable.parameter", + + "self": "variable.language", + "next": "entity.name.function", + "spread": "variable.parameter", + "global_variable": "variable.language", + + "nil": "constant.language.nil", + "true": "constant.language.boolean", + "false": "constant.language.boolean", + + "'local'": "storage.modifier", + "'function'": "storage.type.function", + "label_statement": "storage.type.label", + + "'{'": "punctuation.definition.table.begin", + "'}'": "punctuation.definition.table.end", + "'('": "punctuation.definition.parameters.begin", + "')'": "punctuation.definition.parameters.end", + + "'do'": "keyword.control", + "'return'": "keyword.control", + "'if'": "keyword.control", + "'then'": "keyword.control", + "'elseif'": "keyword.control", + "'else'": "keyword.control", + "'while'": "keyword.control", + "'repeat'": "keyword.control", + "'until'": "keyword.control", + "'for'": "keyword.control", + "'in'": "keyword.control", + "'goto'": "keyword.control", + "'end'": "keyword.control", + + "'or'": "keyword.operator.logical", + "'and'": "keyword.operator.logical", + "'not'": "keyword.operator.logical", + "'|'": "keyword.operator.logical", + "'&'": "keyword.operator.logical", + "'~'": "keyword.operator.logical", + + "'='": "keyword.operator.assignment", + + "'<'": "keyword.operator.comparison", + "'<='": "keyword.operator.comparison", + "'=='": "keyword.operator.comparison", + "'~='": "keyword.operator.comparison", + "'>='": "keyword.operator.comparison", + "'>'": "keyword.operator.comparison", + + "'<<'": "keyword.operator.arithmetic.bitwise", + "'>>'": "keyword.operator.arithmetic.bitwise", + "'+'": "keyword.operator.arithmetic", + "'-'": "keyword.operator.arithmetic", + "'*'": "keyword.operator.arithmetic", + "'/'": "keyword.operator.arithmetic", + "'//'": "keyword.operator.arithmetic", + "'%'": "keyword.operator.arithmetic", + + "'..'": "keyword.operator.arithmetic", + "'^'": "keyword.operator.arithmetic", + + "'#'": "keyword.operator.arithmetic", + + "'.'": "punctuation.separator.object", + "','": "punctuation.separator.object", + "':'": "punctuation.separator.method", + "';'": "punctuation.separator.statement" + } +} diff --git a/data/markdown/fixtures/fenced-code.json b/data/markdown/fixtures/fenced-code.json new file mode 100644 index 0000000..8dfe6dd --- /dev/null +++ b/data/markdown/fixtures/fenced-code.json @@ -0,0 +1,216 @@ +{ + "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 new file mode 100644 index 0000000..b196258 --- /dev/null +++ b/data/markdown/injections/php.json @@ -0,0 +1,119 @@ +{ + "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/text.md.json b/data/markdown/language-markdown.json similarity index 100% rename from data/text.md.json rename to data/markdown/language-markdown.json diff --git a/data/markdown/repositories/blocks/fenced-code.json b/data/markdown/repositories/blocks/fenced-code.json new file mode 100644 index 0000000..7552576 --- /dev/null +++ b/data/markdown/repositories/blocks/fenced-code.json @@ -0,0 +1,37 @@ +{ + "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 new file mode 100644 index 0000000..f70c449 --- /dev/null +++ b/data/markdown/repositories/blocks/headings.json @@ -0,0 +1,259 @@ +{ + "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 new file mode 100644 index 0000000..c4930da --- /dev/null +++ b/data/markdown/repositories/blocks/hr.json @@ -0,0 +1,17 @@ +{ + "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 new file mode 100644 index 0000000..bfa7d9d --- /dev/null +++ b/data/markdown/repositories/blocks/lists.json @@ -0,0 +1,155 @@ +{ + "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 new file mode 100644 index 0000000..efd2385 --- /dev/null +++ b/data/markdown/repositories/blocks/quotes.json @@ -0,0 +1,24 @@ +{ + "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 new file mode 100644 index 0000000..44b662d --- /dev/null +++ b/data/markdown/repositories/flavors/criticmark.json @@ -0,0 +1,120 @@ +{ + "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 new file mode 100644 index 0000000..fc2a2d9 --- /dev/null +++ b/data/markdown/repositories/flavors/front-matter.json @@ -0,0 +1,65 @@ +{ + "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 new file mode 100644 index 0000000..e56b753 --- /dev/null +++ b/data/markdown/repositories/flavors/github-blocks.json @@ -0,0 +1,58 @@ +{ + "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 new file mode 100644 index 0000000..5e3d0c3 --- /dev/null +++ b/data/markdown/repositories/flavors/github-inlines.json @@ -0,0 +1,160 @@ +{ + "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 new file mode 100644 index 0000000..18c786d --- /dev/null +++ b/data/markdown/repositories/inlines/emphasis.json @@ -0,0 +1,129 @@ +{ + "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 new file mode 100644 index 0000000..d44a690 --- /dev/null +++ b/data/markdown/repositories/inlines/link-label.json @@ -0,0 +1,24 @@ +{ + "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 new file mode 100644 index 0000000..ce711e5 --- /dev/null +++ b/data/markdown/repositories/inlines/link-text.json @@ -0,0 +1,98 @@ +{ + "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 new file mode 100644 index 0000000..b7a4669 --- /dev/null +++ b/data/markdown/repositories/inlines/link-title.json @@ -0,0 +1,29 @@ +{ + "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 new file mode 100644 index 0000000..1b913f9 --- /dev/null +++ b/data/markdown/repositories/inlines/links.json @@ -0,0 +1,317 @@ +{ + "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 new file mode 100644 index 0000000..034398e --- /dev/null +++ b/data/markdown/repositories/inlines/liquid.json @@ -0,0 +1,8 @@ +{ + "key": "liquid", + "patterns": [ + { + "include": "text.html.liquid" + } + ] +} diff --git a/data/markdown/repositories/inlines/references.json b/data/markdown/repositories/inlines/references.json new file mode 100644 index 0000000..6da00b3 --- /dev/null +++ b/data/markdown/repositories/inlines/references.json @@ -0,0 +1,14 @@ +{ + "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 new file mode 100644 index 0000000..3e10bf4 --- /dev/null +++ b/data/markdown/repositories/inlines/todo.json @@ -0,0 +1,9 @@ +{ + "key": "todo", + "patterns": [ + { + "match": "(?