From ed119573104c3a67b0f2d292f1fe28b0ba7e07be Mon Sep 17 00:00:00 2001 From: Thomas Osmonson Date: Mon, 20 Jul 2020 09:22:11 -0500 Subject: [PATCH] feat: better remote mdx --- babel.config.js | 6 + .../data/extraGrammars/TOML.tmLanguage | 455 -- .../extraGrammars/clarity.tmLanguage.json | 249 - .../data/extraGrammars/graphql.json | 667 --- .../data/extraGrammars/haml.json | 590 --- .../data/extraGrammars/kotlin.tmLanguage | 1067 ---- .../data/extraGrammars/latex.plist | 2287 --------- .../data/extraGrammars/nginx.tmLanguage | 1265 ----- .../data/extraGrammars/postcss.json | 1648 ------- .../data/extraGrammars/sass.tmLanguage | 750 --- .../data/extraGrammars/stylus.json | 1199 ----- .../data/extraGrammars/vue-html.json | 563 --- .../data/extraGrammars/vue.json | 1093 ----- .../data/grammars/ASPVBnet.plist | 372 -- .../data/grammars/Batch File.tmLanguage | 169 - .../data/grammars/Clojure.tmLanguage | 440 -- .../data/grammars/Dockerfile.tmLanguage | 143 - .../data/grammars/Groovy.tmLanguage | 2145 -------- .../data/grammars/Handlebars.json | 854 ---- .../data/grammars/JSON.tmLanguage | 387 -- .../data/grammars/JSONC.tmLanguage.json | 213 - lib/shiki-languages/data/grammars/Jade.json | 964 ---- .../data/grammars/JavaScript.tmLanguage.json | 3575 -------------- .../data/grammars/MagicPython.tmLanguage.json | 3438 ------------- .../data/grammars/MagicRegExp.tmLanguage.json | 435 -- .../data/grammars/Makefile.json | 475 -- .../data/grammars/Objective-C.tmLanguage | 1432 ------ .../data/grammars/Perl 6.tmLanguage | 490 -- lib/shiki-languages/data/grammars/Perl.plist | 3707 -------------- .../data/grammars/Platform.tmLanguage | 237 - .../data/grammars/PowershellSyntax.tmLanguage | 1186 ----- lib/shiki-languages/data/grammars/R.plist | 316 -- ...egular Expressions (JavaScript).tmLanguage | 237 - lib/shiki-languages/data/grammars/Ruby.plist | 4092 ---------------- lib/shiki-languages/data/grammars/SQL.plist | 767 --- .../grammars/Shell-Unix-Bash.tmLanguage.json | 1231 ----- .../data/grammars/TypeScript.tmLanguage.json | 3303 ------------- .../grammars/TypeScriptReact.tmLanguage.json | 3574 -------------- lib/shiki-languages/data/grammars/c++.json | 455 -- lib/shiki-languages/data/grammars/c.json | 980 ---- .../data/grammars/coffeescript.json | 668 --- .../data/grammars/csharp.tmLanguage.json | 4333 ----------------- lib/shiki-languages/data/grammars/cshtml.json | 153 - lib/shiki-languages/data/grammars/css.plist | 1184 ----- .../data/grammars/diff.tmLanguage | 268 - lib/shiki-languages/data/grammars/fsharp.json | 533 -- .../data/grammars/git-commit.tmLanguage | 221 - .../data/grammars/git-rebase.tmLanguage | 57 - lib/shiki-languages/data/grammars/go.json | 611 --- lib/shiki-languages/data/grammars/html.json | 553 --- lib/shiki-languages/data/grammars/java.json | 1030 ---- .../data/grammars/less.tmLanguage.json | 619 --- lib/shiki-languages/data/grammars/lua.json | 192 - .../data/grammars/markdown.tmLanguage | 1889 ------- lib/shiki-languages/data/grammars/php.json | 2638 ---------- .../data/grammars/properties.plist | 181 - lib/shiki-languages/data/grammars/rust.json | 595 --- lib/shiki-languages/data/grammars/scss.json | 1672 ------- .../data/grammars/shaderlab.json | 133 - lib/shiki-languages/data/grammars/swift.json | 257 - lib/shiki-languages/data/grammars/xml.json | 426 -- lib/shiki-languages/data/grammars/xsl.json | 93 - lib/shiki-languages/data/grammars/yaml.json | 629 --- lib/shiki-languages/dist/index.d.ts | 2 - lib/shiki-languages/dist/index.js | 6 - lib/shiki-languages/dist/lang.d.ts | 14 - lib/shiki-languages/dist/lang.js | 480 -- lib/shiki-languages/dist/types.d.ts | 12 - lib/shiki-languages/dist/types.js | 2 - lib/shiki-languages/package.json | 22 - next.config.js | 32 +- package.json | 9 +- src/common/_data/clarityRef.json | 699 ++- src/common/mdx.ts | 55 +- src/common/routes/get-routes.js | 1 + src/common/shiki-clarity.ts | 41 - src/components/clarity-ref.tsx | 135 +- src/components/cli-reference.tsx | 122 +- src/components/code-block/index.tsx | 9 - src/components/feedback.tsx | 2 +- src/components/header.tsx | 10 - src/components/layouts/default-layout.tsx | 4 +- src/components/layouts/docs-layout.tsx | 122 +- src/components/mdx/components.tsx | 26 +- src/components/mdx/mdx-components.tsx | 16 +- src/components/pagination.tsx | 46 +- src/components/toc.tsx | 59 +- src/lib/md-loader.js | 40 +- src/pages/core/cmdLineRef.md | 8 +- src/pages/core/smart/clarityRef.md | 9 +- src/pages/core/smart/tutorial-counter.md | 6 +- src/pages/index.tsx | 29 +- src/pages/storage/overview.md | 5 +- src/pages/storage/write-to-read.md | 1 - yarn.lock | 13 +- 95 files changed, 1111 insertions(+), 67317 deletions(-) delete mode 100644 lib/shiki-languages/data/extraGrammars/TOML.tmLanguage delete mode 100644 lib/shiki-languages/data/extraGrammars/clarity.tmLanguage.json delete mode 100644 lib/shiki-languages/data/extraGrammars/graphql.json delete mode 100644 lib/shiki-languages/data/extraGrammars/haml.json delete mode 100644 lib/shiki-languages/data/extraGrammars/kotlin.tmLanguage delete mode 100644 lib/shiki-languages/data/extraGrammars/latex.plist delete mode 100644 lib/shiki-languages/data/extraGrammars/nginx.tmLanguage delete mode 100644 lib/shiki-languages/data/extraGrammars/postcss.json delete mode 100644 lib/shiki-languages/data/extraGrammars/sass.tmLanguage delete mode 100644 lib/shiki-languages/data/extraGrammars/stylus.json delete mode 100644 lib/shiki-languages/data/extraGrammars/vue-html.json delete mode 100644 lib/shiki-languages/data/extraGrammars/vue.json delete mode 100644 lib/shiki-languages/data/grammars/ASPVBnet.plist delete mode 100644 lib/shiki-languages/data/grammars/Batch File.tmLanguage delete mode 100644 lib/shiki-languages/data/grammars/Clojure.tmLanguage delete mode 100644 lib/shiki-languages/data/grammars/Dockerfile.tmLanguage delete mode 100644 lib/shiki-languages/data/grammars/Groovy.tmLanguage delete mode 100644 lib/shiki-languages/data/grammars/Handlebars.json delete mode 100644 lib/shiki-languages/data/grammars/JSON.tmLanguage delete mode 100644 lib/shiki-languages/data/grammars/JSONC.tmLanguage.json delete mode 100644 lib/shiki-languages/data/grammars/Jade.json delete mode 100644 lib/shiki-languages/data/grammars/JavaScript.tmLanguage.json delete mode 100644 lib/shiki-languages/data/grammars/MagicPython.tmLanguage.json delete mode 100644 lib/shiki-languages/data/grammars/MagicRegExp.tmLanguage.json delete mode 100644 lib/shiki-languages/data/grammars/Makefile.json delete mode 100644 lib/shiki-languages/data/grammars/Objective-C.tmLanguage delete mode 100644 lib/shiki-languages/data/grammars/Perl 6.tmLanguage delete mode 100644 lib/shiki-languages/data/grammars/Perl.plist delete mode 100644 lib/shiki-languages/data/grammars/Platform.tmLanguage delete mode 100644 lib/shiki-languages/data/grammars/PowershellSyntax.tmLanguage delete mode 100644 lib/shiki-languages/data/grammars/R.plist delete mode 100644 lib/shiki-languages/data/grammars/Regular Expressions (JavaScript).tmLanguage delete mode 100644 lib/shiki-languages/data/grammars/Ruby.plist delete mode 100644 lib/shiki-languages/data/grammars/SQL.plist delete mode 100644 lib/shiki-languages/data/grammars/Shell-Unix-Bash.tmLanguage.json delete mode 100644 lib/shiki-languages/data/grammars/TypeScript.tmLanguage.json delete mode 100644 lib/shiki-languages/data/grammars/TypeScriptReact.tmLanguage.json delete mode 100644 lib/shiki-languages/data/grammars/c++.json delete mode 100644 lib/shiki-languages/data/grammars/c.json delete mode 100644 lib/shiki-languages/data/grammars/coffeescript.json delete mode 100644 lib/shiki-languages/data/grammars/csharp.tmLanguage.json delete mode 100644 lib/shiki-languages/data/grammars/cshtml.json delete mode 100644 lib/shiki-languages/data/grammars/css.plist delete mode 100644 lib/shiki-languages/data/grammars/diff.tmLanguage delete mode 100644 lib/shiki-languages/data/grammars/fsharp.json delete mode 100644 lib/shiki-languages/data/grammars/git-commit.tmLanguage delete mode 100644 lib/shiki-languages/data/grammars/git-rebase.tmLanguage delete mode 100644 lib/shiki-languages/data/grammars/go.json delete mode 100644 lib/shiki-languages/data/grammars/html.json delete mode 100644 lib/shiki-languages/data/grammars/java.json delete mode 100644 lib/shiki-languages/data/grammars/less.tmLanguage.json delete mode 100644 lib/shiki-languages/data/grammars/lua.json delete mode 100644 lib/shiki-languages/data/grammars/markdown.tmLanguage delete mode 100644 lib/shiki-languages/data/grammars/php.json delete mode 100644 lib/shiki-languages/data/grammars/properties.plist delete mode 100644 lib/shiki-languages/data/grammars/rust.json delete mode 100644 lib/shiki-languages/data/grammars/scss.json delete mode 100644 lib/shiki-languages/data/grammars/shaderlab.json delete mode 100644 lib/shiki-languages/data/grammars/swift.json delete mode 100644 lib/shiki-languages/data/grammars/xml.json delete mode 100644 lib/shiki-languages/data/grammars/xsl.json delete mode 100644 lib/shiki-languages/data/grammars/yaml.json delete mode 100644 lib/shiki-languages/dist/index.d.ts delete mode 100644 lib/shiki-languages/dist/index.js delete mode 100644 lib/shiki-languages/dist/lang.d.ts delete mode 100644 lib/shiki-languages/dist/lang.js delete mode 100644 lib/shiki-languages/dist/types.d.ts delete mode 100644 lib/shiki-languages/dist/types.js delete mode 100644 lib/shiki-languages/package.json delete mode 100644 src/common/shiki-clarity.ts diff --git a/babel.config.js b/babel.config.js index ea05946c..8eb22cd3 100644 --- a/babel.config.js +++ b/babel.config.js @@ -3,6 +3,12 @@ module.exports = { plugins: [ './lib/babel-plugin-nextjs-mdx-patch', 'babel-plugin-macros', + [ + 'prismjs', + { + languages: ['bash', 'css', 'jsx', 'tsx', 'json', 'toml', 'python', 'kotlin', 'nginx'], + }, + ], ['styled-components', { ssr: true }], ], }; diff --git a/lib/shiki-languages/data/extraGrammars/TOML.tmLanguage b/lib/shiki-languages/data/extraGrammars/TOML.tmLanguage deleted file mode 100644 index 0eb0c0bb..00000000 --- a/lib/shiki-languages/data/extraGrammars/TOML.tmLanguage +++ /dev/null @@ -1,455 +0,0 @@ - - - - - fileTypes - - toml - tml - - name - TOML - patterns - - - include - #comments - - - include - #tables - - - include - #keys - - - repository - - array - - begin - (?<!\w)(\[)\s* - beginCaptures - - 1 - - name - punctuation.definition.array.toml - - - comment - Array - end - \s*(\])(?!\w) - endCaptures - - 1 - - name - punctuation.definition.array.toml - - - patterns - - - include - #comments - - - include - #dataTypes - - - - boolean - - captures - - 1 - - name - constant.other.boolean.toml - - - comment - Boolean - match - (?<!\w)(true|false)(?!\w) - - comments - - captures - - 1 - - name - comment.line.number-sign.toml - - 2 - - name - punctuation.definition.comment.toml - - - comment - Comments - match - \s*((#).*)$ - - dataTypes - - patterns - - - include - #inlinetable - - - include - #array - - - include - #string - - - include - #dateTimeWithTz - - - include - #dateTime - - - include - #date - - - include - #float - - - include - #integer - - - include - #boolean - - - - dateTimeWithTz - - captures - - 1 - - name - constant.other.datetime-with-timezone.toml - - - comment - DateTime - match - (?<!\w)(\d{4}\-\d{2}\-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[\+\-]\d{2}:\d{2}))(?!\w) - - dateTime - - captures - - 1 - - name - constant.other.datetime.toml - - - comment - DateTime - match - (\d{4}\-\d{2}\-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?) - - date - - captures - - 1 - - name - constant.other.date.toml - - - comment - DateTime - match - (\d{4}\-\d{2}\-\d{2}) - - float - - captures - - 1 - - name - constant.numeric.float.toml - - - comment - Float, decimal and exponential representation - match - (?<!\w)([\+\-]?(0|([1-9](([0-9]|_[0-9])+)?))(?:(?:\.(0|([1-9](([0-9]|_[0-9])+)?)))?[eE][\+\-]?[1-9]_?[0-9]*|(?:\.[0-9_]*)))(?!\w) - - illegal - - captures - - 1 - - name - invalid.illegal.toml - - - comment - Invalid things -> everything unmatched - match - (.*) - - inlinetable - - begin - (?<!\w)(\{)\s* - beginCaptures - - 1 - - name - punctuation.definition.inlinetable.toml - - - end - \s*(\})(?!\w) - endCaptures - - 1 - - name - punctuation.definition.inlinetable.toml - - - patterns - - - include - #keys - - - include - #dataTypes - - - - integer - - captures - - 1 - - name - constant.numeric.integer.toml - - - comment - Integer (with and without + and - prefixes) - match - (?<!\w)((?:[\+\-]?(0|([1-9](([0-9]|_[0-9])+)?))))(?!\w) - - keys - - comment - Key-value-pairs - patterns - - - comment - Assignments without key are invalid - match - (\s*=.*)$ - name - invalid.illegal.noKeyDefined.toml - - - comment - Assignments without value are unusual - match - (\s*[A-Za-z_\-][A-Za-z0-9_\-]*\s*=)(?=\s*$) - name - invalid.deprecated.noValueGiven.toml - - - begin - \s*([A-Za-z_-][A-Za-z0-9_-]*|".+"|'.+'|[0-9]+)\s*(=)\s* - beginCaptures - - 1 - - name - keyword.key.toml - - 2 - - name - punctuation.definition.keyValuePair.toml - - - end - ($|(?==)|\,|\s*(?=\})) - patterns - - - include - #comments - - - include - #dataTypes - - - include - #illegal - - - - - - string - - patterns - - - begin - ''' - comment - literal string block (no escape sequences) - end - ''' - name - string.quoted.triple.literal.block.toml - - - comment - literal string line (no escape sequences) - match - '.*?' - name - string.quoted.single.literal.line.toml - - - begin - """ - comment - basic string block - end - """ - name - string.quoted.triple.basic.block.toml - patterns - - - match - \\([btnfr"\\ \n]|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8}) - name - constant.character.escape.toml - - - match - \\[^btnfr"\\\n] - name - invalid.illegal.escape.toml - - - - - comment - basic string line - match - "[^"\\]*(?:\\.[^"\\]*)*" - name - string.quoted.single.basic.line.toml - - - - tables - - patterns - - - captures - - 1 - - name - punctuation.definition.table.toml - - 2 - - patterns - - - match - [^\s.]+ - name - entity.other.attribute-name.table.toml - - - - 3 - - name - punctuation.definition.table.toml - - - match - ^\s*(\[)([^\[\]]*)(\]) - name - meta.tag.table.toml - - - captures - - 1 - - name - punctuation.definition.table.array.toml - - 2 - - patterns - - - match - [^\s.]+ - name - entity.other.attribute-name.table.array.toml - - - - 3 - - name - punctuation.definition.table.array.toml - - - match - ^\s*(\[\[)([^\[\]]*)(\]\]) - name - meta.tag.table.array.toml - - - - - scopeName - source.toml - uuid - ffffeb76-439f-4c5e-b60f-d8a13606d63d - - \ No newline at end of file diff --git a/lib/shiki-languages/data/extraGrammars/clarity.tmLanguage.json b/lib/shiki-languages/data/extraGrammars/clarity.tmLanguage.json deleted file mode 100644 index 687c6974..00000000 --- a/lib/shiki-languages/data/extraGrammars/clarity.tmLanguage.json +++ /dev/null @@ -1,249 +0,0 @@ -{ - "fileTypes": [ - "clar" - ], - "keyEquivalent": "^~S", - "name": "Clarity", - "patterns": [ - { - "include": "#comment" - }, - { - "include": "#sexp" - }, - { - "include": "#string" - }, - { - "include": "#language-functions" - }, - { - "include": "#illegal" - } - ], - "repository": { - "comment": { - "begin": "(^[ \\t]+)?(?=;)", - "beginCaptures": { - "1": { - "name": "punctuation.whitespace.comment.leading.clarity" - } - }, - "end": "(?!\\G)", - "patterns": [ - { - "begin": ";", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.clarity" - } - }, - "end": "\\n", - "name": "comment.line.semicolon.clarity" - } - ] - }, - "define-map": { - "begin": "(?<=\\()(define-map)\\s([[:alnum:]][[:alnum:]!$%&*+-./:<=>?@^_~]*)\\s+", - "end": "(?=\\))", - "captures": { - "1": { - "name": "keyword.control.clarity" - }, - "2": { - "name": "entity.name.function.clarity" - } - }, - "name": "meta.declaration.map.clarity", - "patterns": [ - { - "include": "#comment" - }, - { - "include": "#sexp" - }, - { - "include": "#illegal" - } - ] - }, - "constants": { - "patterns": [ - { - "match": "\\'(true|false)", - "name": "constant.language.boolean.clarity" - }, - { - "match": "(?<=[\\(\\s])((#e|#i)?[0-9]+(\\.[0-9]+)?|(#x)[0-9a-fA-F]+|(#o)[0-7]+|(#b)[01]+)(?=[\\s;()'\",\\[\\]])", - "name": "constant.numeric.clarity" - }, - { - "match": "\\'[0123456789ABCDEFGHJKMNPQRSTVWXYZ]{28,41}", - "name": "constant.numeric.clarity" - } - ] - }, - "illegal": { - "match": "[()\\[\\]]", - "name": "invalid.illegal.parenthesis.clarity" - }, - "language-functions": { - "patterns": [ - { - "match": "(?x) (?<=(\\s|\\()) # preceded by space or (\\n\n ( or|and|xor|not|begin|let|if|ok|err|\n unwrap!|unwrap-err!|unwrap-panic|unwrap-err-panic|match|try!|asserts!\n map-get\\?|var-get|contract-map-get\\?|get|tuple|\n define-public|define-private|define-constant|define-map|define-data-var|\n define-fungible-token|define-non-fungible-token|\n define-read-only|let\\* )\n (?=(\\s|\\())\n", - "name": "keyword.control.clarity" - }, - { - "match": "(?x) (?<=(\\s|\\()) # preceded by space or (\n ( is-eq|is-some|is-none|is-ok|is-err )\n (?=(\\s|\\()) # followed by space or (\n", - "name": "support.function.boolean-test.clarity" - }, - { - "match": "(?x) (?<=(\\s|\\()) # preceded by space or (\n ( var-set|map-set|map-delete|map-insert|\n ft-transfer\\?|nft-transfer\\?|nft-mint\\?|ft-mint\\?|nft-get-owner\\?|ft-get-balance\\?|\n contract-call\\? )\n (?=(\\s|\\()) # followed by space or (\n", - "name": "support.function.with-side-effects.clarity" - }, - { - "match": "(?x) (?<=(\\s|\\()) # preceded by space or (\n ( as-contract|contract-caller|tx-sender|block-height|at-block|get-block-info\\? )\n (?=(\\s|\\()) # followed by space or (\n", - "name": "support.function.sender-context.clarity" - }, - { - "match": "(?x) (?<=(\\s|\\()) # preceded by space or (\n ( >=?|<=?|[*/+-]|mod|pow )\n (?=(\\s|\\()) # followed by space or (\n", - "name": "support.function.arithmetic.clarity" - }, - { - "match": "(?x) (?<=(\\s|\\()) # preceded by space or (\n ( list|map|filter|fold|len|concat|append|as-max-len\\?|to-int|to-uint|\n buff|hash160|sha256|sha512|sha512/256|keccak256 )\n (?=(\\s|\\()) # followed by space or (\n", - "name": "support.function.general.clarity" - } - ] - }, - "sexp": { - "begin": "\\(", - "beginCaptures": { - "1": { - "name": "punctuation.section.expression.begin.clarity" - } - }, - "end": "\\)(\\n)?", - "endCaptures": { - "1": { - "name": "punctuation.section.expression.end.clarity" - }, - "2": { - "name": "meta.after-expression.clarity" - } - }, - "name": "meta.expression.clarity", - "patterns": [ - { - "include": "#comment" - }, - { - "include": "#define-map" - }, - { - "begin": "(?x) (?<=\\() # preceded by ( (define-public|define-private|define-constant|define-read-only)\\s+\n \\( # open parens\n ([[:alnum:]][[:alnum:]!$%&*+-./:<=>?@^_~]*)\n ((\\s+\n \\( # open parens for parameter/type pair\n \\s*\n ([[:alnum:]][[:alnum:]!$%&*+-./:<=>?@^_~]*)\n \\s+\n ([[:alnum:]][[:alnum:]!$%&*+-./:<=>?@^_~]*)\n \\s*\n \\) # close parens for parameter/type pair\n \\s*\n )*)\n \\s*\n \\) # close parens\n", - "captures": { - "1": { - "name": "keyword.control.clarity" - }, - "2": { - "name": "entity.name.function.clarity" - }, - "4": { - "name": "variable.parameter.function.clarity" - } - }, - "end": "(?=\\))", - "name": "meta.declaration.procedure.clarity", - "patterns": [ - { - "include": "#comment" - }, - { - "include": "#sexp" - }, - { - "include": "#illegal" - } - ] - }, - { - "begin": "(?<=\\()(define)\\s([[:alnum:]][[:alnum:]!$%&*+-./:<=>?@^_~]*)\\s*.*?", - "captures": { - "1": { - "name": "keyword.control.clarity" - }, - "2": { - "name": "variable.other.clarity" - } - }, - "end": "(?=\\))", - "name": "meta.declaration.variable.clarity", - "patterns": [ - { - "include": "#constants" - }, - { - "include": "#comment" - }, - { - "include": "#sexp" - }, - { - "include": "#illegal" - } - ] - }, - { - "include": "#language-functions" - }, - { - "include": "#string" - }, - { - "include": "#constants" - }, - { - "match": "(?<=[\\(\\s])(#\\\\)(space|newline|tab)(?=[\\s\\)])", - "name": "constant.character.named.clarity" - }, - { - "match": "(?<=[\\(\\s])(#\\\\)x[0-9A-F]{2,4}(?=[\\s\\)])", - "name": "constant.character.hex-literal.clarity" - }, - { - "match": "(?<=[\\(\\s])(#\\\\).(?=[\\s\\)])", - "name": "constant.character.escape.clarity" - }, - { - "include": "#sexp" - }, - { - "include": "#illegal" - } - ] - }, - "string": { - "begin": "(\")", - "beginCaptures": { - "1": { - "name": "punctuation.definition.string.begin.clarity" - } - }, - "end": "(\")", - "endCaptures": { - "1": { - "name": "punctuation.definition.string.end.clarity" - } - }, - "name": "string.quoted.double.clarity", - "patterns": [ - { - "match": "\\\\.", - "name": "constant.character.escape.clarity" - } - ] - } - }, - "scopeName": "source.clarity", - "uuid": "a26370fe-ce63-4d00-a5f7-a00abb11be89" -} diff --git a/lib/shiki-languages/data/extraGrammars/graphql.json b/lib/shiki-languages/data/extraGrammars/graphql.json deleted file mode 100644 index c862fcff..00000000 --- a/lib/shiki-languages/data/extraGrammars/graphql.json +++ /dev/null @@ -1,667 +0,0 @@ -{ - "name": "GraphQL", - "scopeName": "source.graphql", - "fileTypes": ["graphql", "graphqls", "gql", "graphcool"], - "patterns": [{ "include": "#graphql" }], - "repository": { - "graphql": { - "patterns": [ - { "include": "#graphql-comment" }, - { "include": "#graphql-description-docstring" }, - { "include": "#graphql-description-singleline" }, - { "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": "#literal-quasi-embedded" } - ] - }, - "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*([_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-description-docstring" }, - { "include": "#graphql-description-singleline" }, - { "include": "#graphql-selection-set" }, - { "include": "#graphql-directive" }, - { "include": "#graphql-skip-newlines" }, - { "include": "#literal-quasi-embedded" } - ] - }, - "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": "(?=.)", - "applyEndPatternLast": 1, - "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": [ - { - "begin": "\\s*\\b(implements)\\b\\s*", - "end": "\\s*(?={)", - "beginCaptures": { - "1": { "name": "keyword.implements.graphql" } - }, - "patterns": [ - { - "match": "\\s*([_A-Za-z][_0-9A-Za-z]*)", - "captures": { - "1": { "name": "support.type.graphql" } - } - }, - { "include": "#graphql-ampersand" }, - { "include": "#graphql-comma" } - ] - }, - { "include": "#graphql-comment" }, - { "include": "#graphql-description-docstring" }, - { "include": "#graphql-description-singleline" }, - { "include": "#graphql-directive" }, - { "include": "#graphql-type-object" }, - { "include": "#literal-quasi-embedded" }, - { "include": "#graphql-ignore-spaces" } - ] - }, - "graphql-ignore-spaces": { - "match": "\\s*" - }, - "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-comment" }, - { "include": "#graphql-description-docstring" }, - { "include": "#graphql-description-singleline" }, - { "include": "#graphql-object-type" }, - { "include": "#graphql-type-definition" }, - { "include": "#literal-quasi-embedded" } - ] - }, - "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-comment" }, - { "include": "#graphql-description-docstring" }, - { "include": "#graphql-description-singleline" }, - { "include": "#graphql-variable-definitions" }, - { "include": "#graphql-type-object" }, - { "include": "#graphql-colon" }, - { "include": "#graphql-input-types" }, - { "include": "#literal-quasi-embedded" } - ] - }, - "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-comment" }, - { "include": "#graphql-description-docstring" }, - { "include": "#graphql-description-singleline" }, - { "include": "#graphql-colon" }, - { "include": "#graphql-skip-newlines" } - ] - }, - { "include": "#graphql-comment" }, - { "include": "#graphql-description-docstring" }, - { "include": "#graphql-description-singleline" }, - { "include": "#graphql-skip-newlines" } - ] - }, - { "include": "#graphql-comment" }, - { "include": "#graphql-description-docstring" }, - { "include": "#graphql-description-singleline" }, - { "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", - "match": "#(?=([^\"]*\"[^\"]*\")*[^\"]*$).*$" - }, - "graphql-description-singleline": { - "name": "comment.line.number-sign.graphql", - "match": "#(?=([^\"]*\"[^\"]*\")*[^\"]*$).*$" - }, - "graphql-description-docstring": { - "name": "comment.block.graphql", - "begin": "\"\"\"", - "end": "\"\"\"" - }, - "graphql-variable-definitions": { - "begin": "\\s*(\\()", - "end": "\\s*(\\))", - "captures": { - "1": { "name": "meta.brace.round.graphql" } - }, - "patterns": [ - { "include": "#graphql-comment" }, - { "include": "#graphql-description-docstring" }, - { "include": "#graphql-description-singleline" }, - { "include": "#graphql-variable-definition" }, - { "include": "#literal-quasi-embedded" } - ] - }, - "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.parameter.graphql" } - }, - "endCaptures": { - "5": { "name": "punctuation.comma.graphql" } - }, - "patterns": [ - { "include": "#graphql-comment" }, - { "include": "#graphql-description-docstring" }, - { "include": "#graphql-description-singleline" }, - { "include": "#graphql-colon" }, - { "include": "#graphql-input-types" }, - { "include": "#graphql-variable-assignment" }, - { "include": "#literal-quasi-embedded" }, - { "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.square.graphql" }, - "2": { "name": "keyword.operator.nulltype.graphql" } - }, - "patterns": [ - { "include": "#graphql-comment" }, - { "include": "#graphql-description-docstring" }, - { "include": "#graphql-description-singleline" }, - { "include": "#graphql-input-types" }, - { "include": "#graphql-comma" }, - { "include": "#literal-quasi-embedded" } - ] - } - ] - }, - "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-ampersand": { - "match": "\\s*(&)", - "captures": { - "1": { "name": "keyword.operator.logical.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-comment" }, - { "include": "#graphql-description-docstring" }, - { "include": "#graphql-description-singleline" }, - { "include": "#graphql-arguments" }, - { "include": "#literal-quasi-embedded" }, - { "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-comment" }, - { "include": "#graphql-description-docstring" }, - { "include": "#graphql-description-singleline" }, - { "include": "#graphql-field" }, - { "include": "#graphql-fragment-spread" }, - { "include": "#graphql-inline-fragment" }, - { "include": "#graphql-comma" }, - { "include": "#native-interpolation" }, - { "include": "#literal-quasi-embedded" } - ] - }, - "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": "#literal-quasi-embedded" }, - { "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-description-docstring" }, - { "include": "#graphql-description-singleline" }, - { "include": "#graphql-selection-set" }, - { "include": "#graphql-directive" }, - { "include": "#literal-quasi-embedded" }, - { "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-description-docstring" }, - { "include": "#graphql-description-singleline" }, - { "include": "#graphql-selection-set" }, - { "include": "#graphql-directive" }, - { "include": "#graphql-skip-newlines" }, - { "include": "#literal-quasi-embedded" } - ] - }, - "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" }, - { "include": "#graphql-description-docstring" }, - { "include": "#graphql-description-singleline" }, - { - "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.parameter.graphql" }, - "2": { "name": "punctuation.colon.graphql" } - }, - "endCaptures": { - "3": { "name": "punctuation.comma.graphql" } - }, - "patterns": [ - { "include": "#graphql-comment" }, - { "include": "#graphql-description-docstring" }, - { "include": "#graphql-description-singleline" }, - { "include": "#graphql-value" }, - { "include": "#graphql-skip-newlines" } - ] - }, - { "include": "#literal-quasi-embedded" } - ] - }, - "graphql-variable-name": { - "match": "\\s*(\\$[_A-Za-z][_0-9A-Za-z]*)", - "captures": { - "1": { "name": "variable.graphql" } - } - }, - "graphql-float-value": { - "match": "\\s*(-?(0|[1-9][0-9]*)(\\.[0-9]+)?((e|E)(\\+|-)?[0-9]+)?)", - "captures": { - "1": { "name": "constant.numeric.float.graphql" } - } - }, - "graphql-boolean-value": { - "match": "\\s*\\b(true|false)\\b", - "captures": { - "1": { "name": "constant.language.boolean.graphql" } - } - }, - "graphql-null-value": { - "match": "\\s*\\b(null)\\b", - "captures": { - "1": { "name": "constant.language.null.graphql" } - } - }, - "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" }, - { "include": "#literal-quasi-embedded" } - ] - }, - "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-description-docstring" }, - { "include": "#graphql-description-singleline" }, - { "include": "#graphql-enum-value" }, - { "include": "#literal-quasi-embedded" } - ] - } - ] - }, - "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-comment" }, - { "include": "#graphql-description-docstring" }, - { "include": "#graphql-variable-name" }, - { "include": "#graphql-float-value" }, - { "include": "#graphql-string-value" }, - { "include": "#graphql-boolean-value" }, - { "include": "#graphql-null-value" }, - { "include": "#graphql-enum-value" }, - { "include": "#graphql-list-value" }, - { "include": "#graphql-object-value" }, - { "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*(})", - "beginCaptures": { - "1": { "name": "meta.brace.curly.graphql" } - }, - "endCaptures": { - "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-comment" }, - { "include": "#graphql-description-docstring" }, - { "include": "#graphql-description-singleline" }, - { "include": "#graphql-skip-newlines" }, - { "include": "#literal-quasi-embedded" }, - { - "match": "\\s*(\\|)\\s*([_A-Za-z][_0-9A-Za-z]*)", - "captures": { - "1": { "name": "punctuation.or.graphql" }, - "2": { "name": "support.type.graphql" } - } - } - ] - }, - { "include": "#graphql-comment" }, - { "include": "#graphql-description-docstring" }, - { "include": "#graphql-description-singleline" }, - { "include": "#graphql-skip-newlines" }, - { "include": "#literal-quasi-embedded" } - ] - }, - "native-interpolation": { - "name": "native.interpolation", - "begin": "\\s*(\\${)", - "end": "(})", - "beginCaptures": { - "1": { "name": "keyword.other.substitution.begin" } - }, - "endCaptures": { - "1": { "name": "keyword.other.substitution.end" } - }, - "patterns": [ - { "include": "source.js" }, - { "include": "source.ts" }, - { "include": "source.js.jsx" }, - { "include": "source.tsx" } - ] - }, - "graphql-skip-newlines": { - "match": "\\s*\n" - } - } -} diff --git a/lib/shiki-languages/data/extraGrammars/haml.json b/lib/shiki-languages/data/extraGrammars/haml.json deleted file mode 100644 index 28664248..00000000 --- a/lib/shiki-languages/data/extraGrammars/haml.json +++ /dev/null @@ -1,590 +0,0 @@ -{ - "fileTypes": [ - "haml", - "html.haml" - ], - "foldingStartMarker": "^\\s*([-%#\\:\\.\\w\\=].*)\\s$", - "foldingStopMarker": "^\\s*$", - "keyEquivalent": "^~H", - "name": "Ruby Haml", - "patterns": [ - { - "begin": "^(\\s*)==", - "contentName": "string.quoted.double.ruby", - "end": "$\\n*", - "patterns": [ - { - "include": "#interpolated_ruby" - } - ] - }, - { - "begin": "^(\\s*):ruby", - "end": "^(?=\\1\\s+|$\\n*)", - "name": "source.ruby.embedded.filter.haml", - "patterns": [ - { - "include": "source.ruby" - } - ] - }, - { - "captures": { - "1": { - "name": "punctuation.definition.prolog.haml" - } - }, - "match": "^(!!!)($|\\s.*)", - "name": "meta.prolog.haml" - }, - { - "begin": "^(\\s*):javascript", - "end": "^(?!\\1\\s+|$\\n*)", - "name": "js.haml", - "patterns": [ - { - "include": "source.js" - } - ] - }, - { - "begin": "^(\\s*):ruby$", - "end": "^(?=\\1\\s+|$\\n*)", - "name": "source.ruby.embedded.filter.haml", - "patterns": [ - { - "include": "source.ruby" - } - ] - }, - { - "captures": { - "1": { - "name": "punctuation.section.comment.haml" - } - }, - "match": "^(\\s*)(\\/\\[[^\\]].*?$\\n?)", - "name": "comment.line.slash.haml" - }, - { - "begin": "^(\\s*)(\\-\\#|\\/|\\-\\s*\\/\\*+)", - "beginCaptures": { - "2": { - "name": "punctuation.section.comment.haml" - } - }, - "end": "^(?!\\1\\s+|\\n)", - "name": "comment.block.haml", - "patterns": [ - { - "include": "text.haml" - } - ] - }, - { - "begin": "^\\s*(?:((%)([-\\w:]+))|(?=\\.|#))", - "end": "$|(?!\\.|#|\\{|\\(|\\[|&|=|-|~|!=|&=|/)", - "captures": { - "1": { - "name": "meta.tag.haml" - }, - "2": { - "name": "punctuation.definition.tag.haml" - }, - "3": { - "name": "entity.name.tag.haml" - } - }, - "patterns": [ - { - "begin": "==", - "contentName": "string.quoted.double.ruby", - "end": "$\\n?", - "patterns": [ - { - "include": "#interpolated_ruby" - } - ] - }, - - { - "captures": { - "1": { - "name": "entity.other.attribute-name.class" - } - }, - "match": "(\\.[\\w-]+)", - "name": "meta.selector.css" - }, - { - "captures": { - "1": { - "name": "entity.other.attribute-name.id" - } - }, - "match": "(#[\\w-]+)", - "name": "meta.selector.css" - }, - { - "begin": "(? - - - - fileTypes - - kt - kts - - foldingStartMarker - (\{\s*(//.*)?$|^\s*// \{\{\{) - foldingStopMarker - ^\s*(\}|// \}\}\}$) - name - Kotlin - patterns - - - include - #comments - - - captures - - 1 - - name - keyword.other.kotlin - - 2 - - name - entity.name.package.kotlin - - - match - ^\s*(package)\b(?:\s*([^ ;$]+)\s*)? - - - captures - - 1 - - name - keyword.other.import.kotlin - - 2 - - name - storage.modifier.import.java - - 3 - - name - keyword.other.kotlin - - 4 - - name - entity.name.type - - - match - ^\s*(import)\s+([^ $.]+(?:\.(?:[`][^$`]+[`]|[^` $.]+))+)(?:\s+(as)\s+([`][^$`]+[`]|[^` $.]+))? - name - meta.import.kotlin - - - include - #code - - - repository - - annotations - - patterns - - - begin - (@[^ (]+)(\()? - beginCaptures - - 1 - - name - storage.type.annotation.kotlin - - 2 - - name - punctuation.definition.annotation-arguments.begin.kotlin - - - end - (\)|\s|$) - endCaptures - - 1 - - name - punctuation.definition.annotation-arguments.end.kotlin - - - name - meta.declaration.annotation.kotlin - patterns - - - captures - - 1 - - name - constant.other.key.kotlin - - 2 - - name - keyword.operator.assignment.kotlin - - - match - (\w*)\s*(=) - - - include - #code - - - match - , - name - punctuation.seperator.property.kotlin - - - - - match - @\w* - name - storage.type.annotation.kotlin - - - - builtin-functions - - patterns - - - match - \b(apply|also|let|takeIf|run|takeUnless|with|print|println)\b\s*(?={|\() - captures - - 1 - - name - support.function.kotlin - - - - - match - \b(mutableListOf|listOf|mutableMapOf|mapOf|mutableSetOf|setOf)\b\s*(?={|\() - captures - - 1 - - name - support.function.kotlin - - - - - - comments - - patterns - - - captures - - 0 - - name - punctuation.definition.comment.kotlin - - - match - /\*\*/ - name - comment.block.empty.kotlin - - - include - #comments-inline - - - - comments-inline - - patterns - - - begin - /\* - captures - - 0 - - name - punctuation.definition.comment.kotlin - - - end - \*/ - name - comment.block.kotlin - - - captures - - 1 - - name - comment.line.double-slash.kotlin - - 2 - - name - punctuation.definition.comment.kotlin - - - match - \s*((//).*$\n?) - - - - class-literal - - begin - (?=\b(?:class|interface|object)\s+\w+)\b - end - (?=\}|$) - name - meta.class.kotlin - patterns - - - include - #keyword-literal - - - begin - \b(class|object|interface)\b\s+(\w+) - beginCaptures - - 1 - - name - storage.modifier.kotlin - - 2 - - name - entity.name.class.kotlin - - - end - (?=\{|\(|:|$) - patterns - - - include - #keyword-literal - - - include - #annotations - - - include - #types - - - - - begin - (:)\s*(\w+) - beginCaptures - - 1 - - name - keyword.operator.declaration.kotlin - - 2 - - name - entity.other.inherited-class.kotlin - - - end - (?={|=|$) - patterns - - - include - #types - - - - - include - #braces - - - include - #parens - - - - literal-functions - - begin - (?=\b(?:fun)\b) - end - (?=$|=|\}) - patterns - - - begin - \b(fun)\b - beginCaptures - - 1 - - name - keyword.other.kotlin - - - end - (?=\() - patterns - - - captures - - 2 - - name - entity.name.function.kotlin - - - match - ([\.<\?>\w]+\.)?(\w+|(`[^`]*`)) - - - include - #types - - - - - begin - (:) - beginCaptures - - 1 - - name - keyword.operator.declaration.kotlin - - - end - (?={|=|$) - patterns - - - include - #types - - - - - include - #parens - - - include - #braces - - - - parameters - - patterns - - - begin - (:) - beginCaptures - - 1 - - name - keyword.operator.declaration.kotlin - - - end - (?=,|=|\)) - patterns - - - include - #types - - - - - match - \w+(?=:) - name - variable.parameter.function.kotlin - - - include - #keyword-literal - - - - keyword-literal - - patterns - - - match - (\!in|\!is|as\?) - name - keyword.operator.kotlin - - - match - \b(in|is|as|assert)\b - name - keyword.operator.kotlin - - - match - \b(const)\b - name - storage.modifier.kotlin - - - match - \b(val|var)\b - name - storage.type.kotlin - - - match - \b(\_)\b - name - punctuation.definition.variable.kotlin - - - match - \b(data|inline|tailrec|operator|infix|typealias|reified)\b - name - storage.type.kotlin - - - match - \b(external|public|private|protected|internal|abstract|final|sealed|enum|open|annotation|override|vararg|typealias|expect|actual|suspend|yield|out|in)\b - name - storage.modifier.kotlin - - - match - \b(try|catch|finally|throw)\b - name - keyword.control.catch-exception.kotlin - - - match - \b(if|else|when)\b - name - keyword.control.conditional.kotlin - - - match - \b(while|for|do|return|break|continue)\b - name - keyword.control.kotlin - - - match - \b(constructor|init)\b - name - entity.name.function.constructor - - - match - \b(companion|object)\b - name - storage.type.kotlin - - - - keyword-operator - - patterns - - - match - \b(and|or|not|inv)\b - name - keyword.operator.bitwise.kotlin - - - match - (==|!=|===|!==|<=|>=|<|>) - name - keyword.operator.comparison.kotlin - - - match - (=) - name - keyword.operator.assignment.kotlin - - - match - (:(?!:)) - name - keyword.operator.declaration.kotlin - - - match - (\?:) - name - keyword.operator.elvis.kotlin - - - match - (\-\-|\+\+) - name - keyword.operator.increment-decrement.kotlin - - - match - (\-|\+|\*|\/|%) - name - keyword.operator.arithmetic.kotlin - - - match - (\+\=|\-\=|\*\=|\/\=) - name - keyword.operator.arithmetic.assign.kotlin - - - match - (\!|\&\&|\|\|) - name - keyword.operator.logical.kotlin - - - match - (\.\.) - name - keyword.operator.range.kotlin - - - - keyword-punctuation - - patterns - - - match - (::) - name - punctuation.accessor.reference.kotlin - - - match - (\?\.) - name - punctuation.accessor.dot.safe.kotlin - - - match - (\.) - name - punctuation.accessor.dot.kotlin - - - match - (\,) - name - punctuation.seperator.kotlin - - - match - (\;) - name - punctuation.terminator.kotlin - - - - keyword-constant - - patterns - - - match - \b(true|false|null|class)\b - name - constant.language.kotlin - - - match - \b(this|super)\b - name - variable.language.kotlin - - - match - \b(0(x|X)[0-9A-Fa-f_]*)[L]?\b - name - constant.numeric.hex.kotlin - - - match - \b(0(b|B)[0-1_]*)[L]?\b - name - constant.numeric.binary.kotlin - - - match - \b([0-9][0-9_]*\.[0-9][0-9_]*[fFL]?)\b - name - constant.numeric.float.kotlin - - - match - \b([0-9][0-9_]*[fFL]?)\b - name - constant.numeric.integer.kotlin - - - - literal-string - - patterns - - - begin - " - beginCaptures - - 0 - - name - punctuation.definition.string.begin.kotlin - - - end - " - endCaptures - - 0 - - name - punctuation.definition.string.end.kotlin - - - name - string.quoted.double.kotlin - patterns - - - include - #string-content - - - - - - literal-raw-string - - patterns - - - begin - """ - beginCaptures - - 0 - - name - punctuation.definition.string.begin.kotlin - - - end - """ - endCaptures - - 0 - - name - punctuation.definition.string.end.kotlin - - - name - string.quoted.triple.kotlin - patterns - - - include - #string-content - - - - - - string-content - - patterns - - - name - constant.character.escape.newline.kotlin - match - \\\s*\n - - - name - constant.character.escape.kotlin - match - \\(x[\da-fA-F]{2}|u[\da-fA-F]{4}|.) - - - begin - (\$)(\{) - beginCaptures - - 1 - - name - punctuation.definition.keyword.kotlin - - 2 - - name - punctuation.section.block.begin.kotlin - - - end - \} - endCaptures - - 0 - - name - punctuation.section.block.end.kotlin - - - name - entity.string.template.element.kotlin - patterns - - - include - #code - - - - - - types - - patterns - - - match - \b(Nothing|Any|Unit|String|CharSequence|Int|Boolean|Char|Long|Double|Float|Short|Byte|Array|List|Map|Set|dynamic)\b(\?)? - name - support.class.kotlin - - - match - \b(IntArray|BooleanArray|CharArray|LongArray|DoubleArray|FloatArray|ShortArray|ByteArray)\b(\?)? - name - support.class.kotlin - - - match - ((?:[a-zA-Z]\w*\.)*[A-Z]+\w*[a-z]+\w*)(\?) - name - entity.name.type.class.kotlin - patterns - - - include - #keyword-punctuation - - - include - #types - - - - - match - \b(?:[a-z]\w*(\.))*[A-Z]+\w*\b - captures - - 1 - - name - keyword.operator.dereference.kotlin - - - name - entity.name.type.class.kotlin - - - begin - \( - beginCaptures - - 0 - - name - punctuation.section.group.begin.kotlin - - - end - \) - endCaptures - - 0 - - name - punctuation.section.group.end.kotlin - - - patterns - - - include - #types - - - - - include - #keyword-punctuation - - - include - #keyword-operator - - - - parens - - patterns - - - begin - \( - beginCaptures - - 0 - - name - punctuation.section.group.begin.kotlin - - - end - \) - endCaptures - - 0 - - name - punctuation.section.group.end.kotlin - - - name - meta.group.kotlin - patterns - - - include - #keyword-punctuation - - - include - #parameters - - - include - #code - - - - - - braces - - patterns - - - begin - \{ - beginCaptures - - 0 - - name - punctuation.section.group.begin.kotlin - - - end - \} - endCaptures - - 0 - - name - punctuation.section.group.end.kotlin - - - name - meta.block.kotlin - patterns - - - include - #code - - - - - - brackets - - patterns - - - begin - \[ - beginCaptures - - 0 - - name - punctuation.section.brackets.begin.kotlin - - - end - \] - endCaptures - - 0 - - name - punctuation.section.brackets.end.kotlin - - - name - meta.brackets.kotlin - patterns - - - include - #code - - - - - - code - - patterns - - - include - #comments - - - include - #comments-inline - - - include - #annotations - - - include - #class-literal - - - include - #parens - - - include - #braces - - - include - #brackets - - - include - #keyword-literal - - - include - #types - - - include - #keyword-operator - - - include - #keyword-constant - - - include - #keyword-punctuation - - - include - #builtin-functions - - - include - #literal-functions - - - include - #builtin-classes - - - include - #literal-raw-string - - - include - #literal-string - - - - - scopeName - source.kotlin - uuid - d9380650-5edc-447d-8dbd-98838c7d0adf - - diff --git a/lib/shiki-languages/data/extraGrammars/latex.plist b/lib/shiki-languages/data/extraGrammars/latex.plist deleted file mode 100644 index 2ef85baf..00000000 --- a/lib/shiki-languages/data/extraGrammars/latex.plist +++ /dev/null @@ -1,2287 +0,0 @@ - - - - - fileTypes - - tex - - firstLineMatch - ^\\documentclass(\[.*\])?\{.*\} - keyEquivalent - ^~L - name - LaTeX - patterns - - - comment - This scope identifies partially typed commands such as `\tab`. We use this to trigger “Command Completion” only when it makes sense. - match - (?<=\\[\w@]|\\[\w@]{2}|\\[\w@]{3}|\\[\w@]{4}|\\[\w@]{5}|\\[\w@]{6})\s - name - meta.space-after-command.latex - - - begin - ((\\)(?:usepackage|documentclass))((?:\[[^\[]*?\])*)(\{) - beginCaptures - - 1 - - name - keyword.control.preamble.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - patterns - - - include - #optional-arg - - - - 4 - - name - punctuation.definition.arguments.begin.latex - - - contentName - support.class.latex - end - \} - endCaptures - - 0 - - name - punctuation.definition.arguments.end.latex - - - name - meta.preamble.latex - patterns - - - include - $self - - - - - begin - ((\\)(?:include|input))(\{) - beginCaptures - - 1 - - name - keyword.control.include.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - name - punctuation.definition.arguments.begin.latex - - - contentName - support.class.latex - end - \} - endCaptures - - 0 - - name - punctuation.definition.arguments.end.latex - - - name - meta.include.latex - patterns - - - include - $self - - - - - begin - (?x) - ( # Capture 1 - (\\) # Marker - ( - (?:sub){0,2}section # Functions - | (?:sub)?paragraph - | chapter|part|addpart - | addchap|addsec|minisec - | frametitle # only for Beamer - ) - (?:\*)? # Optional Unnumbered - ) - ((?:\[[^\[]*?\]){0,2}) - (\{) # Opening Bracket - - beginCaptures - - 1 - - name - support.function.section.latex - - 2 - - name - punctuation.definition.function.latex - - 4 - - patterns - - - include - #optional-arg - - - - 5 - - name - punctuation.definition.arguments.begin.latex - - - comment - this works OK with all kinds of crazy stuff as long as section is one line - contentName - entity.name.section.latex - end - \} - endCaptures - - 0 - - name - punctuation.definition.arguments.end.latex - - - name - meta.function.section.$3.latex - patterns - - - include - text.tex#braces - - - include - $self - - - - - begin - (^\s*)?(?=\\begin\{(lstlisting|minted|pyglist)\}) - beginCaptures - - 0 - - name - punctuation.whitespace.embedded.leading.latex - - - end - (?!\G)(\s*$\n?)? - endCaptures - - 0 - - name - punctuation.whitespace.embedded.trailing.latex - - - patterns - - - begin - (\\begin\{minted\}(?:\[.*\])?\{(?:cpp|c)\}) - captures - - 1 - - patterns - - - include - #minted-env - - - - - contentName - source.cpp - patterns - - - include - source.cpp - - - end - (\\end\{minted\}) - - - begin - (\\begin\{minted\}(?:\[.*\])?\{css\}) - captures - - 1 - - patterns - - - include - #minted-env - - - - - contentName - source.css - patterns - - - include - source.css - - - end - (\\end\{minted\}) - - - begin - (\\begin\{minted\}(?:\[.*\])?\{html\}) - captures - - 1 - - patterns - - - include - #minted-env - - - - - contentName - text.html - patterns - - - include - text.html - - - end - (\\end\{minted\}) - - - begin - (\\begin\{minted\}(?:\[.*\])?\{java\}) - captures - - 1 - - patterns - - - include - #minted-env - - - - - contentName - source.java - patterns - - - include - source.java - - - end - (\\end\{minted\}) - - - begin - (\\begin\{minted\}(?:\[.*\])?\{(?:js|javascript)\}) - captures - - 1 - - patterns - - - include - #minted-env - - - - - contentName - source.js - patterns - - - include - source.js - - - end - (\\end\{minted\}) - - - begin - (\\begin\{minted\}(?:\[.*\])?\{lua\}) - captures - - 1 - - patterns - - - include - #minted-env - - - - - contentName - source.lua - patterns - - - include - source.lua - - - end - (\\end\{minted\}) - - - begin - (\\begin\{minted\}(?:\[.*\])?\{(?:python|py)\}) - captures - - 1 - - patterns - - - include - #minted-env - - - - - contentName - source.python - patterns - - - include - source.python - - - end - (\\end\{minted\}) - - - begin - (\\begin\{minted\}(?:\[.*\])?\{xml\}) - captures - - 1 - - patterns - - - include - #minted-env - - - - - contentName - yaml.xml - patterns - - - include - yaml.xml - - - end - (\\end\{minted\}) - - - begin - (\\begin\{minted\}(?:\[.*\])?\{yaml\}) - captures - - 1 - - patterns - - - include - #minted-env - - - - - contentName - source.yaml - patterns - - - include - source.yaml - - - end - (\\end\{minted\}) - - - begin - (\\begin\{(?:lstlisting|minted|pyglist)\}(?:\[.*\])?) - captures - - 1 - - patterns - - - include - #minted-env - - - - - contentName - meta.function.embedded.latex - end - (\\end\{(?:lstlisting|minted|pyglist)\}) - name - meta.embedded.block.generic - - - - - begin - ((?:\s*)\\begin\{(cppcode(?:\*)?)\}(?:\[.*\])?) - captures - - 1 - - patterns - - - include - #code-env - - - - - contentName - source.cpp - patterns - - - include - source.cpp - - - end - (\\end\{\2\}(?:\s*\n)?) - - - begin - ((?:\s*)\\begin\{(luacode(?:\*)?)\}(?:\[.*\])?) - captures - - 1 - - patterns - - - include - #code-env - - - - - contentName - source.lua - patterns - - - include - source.lua - - - end - (\\end\{\2\}(?:\s*\n)?) - - - begin - ((?:\s*)\\begin\{(pycode(?:\*)?)\}(?:\[.*\])?) - captures - - 1 - - patterns - - - include - #code-env - - - - - contentName - source.python - patterns - - - include - source.python - - - end - (\\end\{\2\}(?:\s*\n)?) - - - begin - ((?:\s*)\\begin\{asy\}(?:\[.*\])?) - captures - - 1 - - patterns - - - include - #code-env - - - - - contentName - source.asymptote - patterns - - - include - source.asymptote - - - end - (\\end\{asy\}(?:\s*\n)?) - - - begin - ((?:\s*)\\begin\{dot2tex\}(?:\[.*\])?) - captures - - 1 - - patterns - - - include - #code-env - - - - - contentName - source.dot - patterns - - - include - source.dot - - - end - (\\end\{dot2tex\}(?:\s*\n)?) - - - begin - ((?:\s*)\\begin\{gnuplot\}(?:\[.*\])?) - captures - - 1 - - patterns - - - include - #code-env - - - - - contentName - source.gnuplot - patterns - - - include - source.gnuplot - - - end - (\\end\{gnuplot\}(?:\s*\n)?) - - - begin - (?:\s*)((\\)begin)(\{)((?:fboxv|boxedv|V|v)erbatim)(\}) - captures - - 1 - - name - support.function.be.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - name - punctuation.definition.arguments.begin.latex - - 4 - - name - variable.parameter.function.latex - - 5 - - name - punctuation.definition.arguments.end.latex - - - contentName - markup.raw.verbatim.latex - end - ((\\)end)(\{)(\4)(\}) - name - meta.function.verbatim.latex - - - begin - (?:\s*)((\\)begin)(\{)(VerbatimOut)(\})(\{)([^\}]*)(\}) - captures - - 1 - - name - support.function.be.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - name - punctuation.definition.arguments.begin.latex - - 4 - - name - variable.parameter.function.latex - - 5 - - name - punctuation.definition.arguments.end.latex - - 6 - - name - punctuation.definition.arguments.begin.latex - - 7 - - name - support.class.latex - - 8 - - name - punctuation.definition.arguments.end.latex - - - contentName - markup.raw.verbatim.latex - end - ((\\)end)(\{)(\VerbatimOut)(\}) - name - meta.function.verbatim.latex - - - begin - (?:\s*)((\\)begin)(\{)(alltt)(\}) - captures - - 1 - - name - support.function.be.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - name - punctuation.definition.arguments.begin.latex - - 4 - - name - variable.parameter.function.latex - - 5 - - name - punctuation.definition.arguments.end.latex - - - contentName - markup.raw.verbatim.latex - end - ((\\)end)(\{)(alltt)(\}) - name - meta.function.alltt.latex - patterns - - - captures - - 1 - - name - punctuation.definition.function.tex - - - match - (\\)[A-Za-z]+ - name - support.function.general.tex - - - - - begin - (?:\s*)((\\)begin)(\{)((?:C|c)omment)(\}) - captures - - 1 - - name - support.function.be.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - name - punctuation.definition.arguments.begin.latex - - 4 - - name - variable.parameter.function.latex - - 5 - - name - punctuation.definition.arguments.end.latex - - - contentName - punctuation.definition.comment.tex - end - ((\\)end)(\{)(\4)(\}) - name - meta.function.verbatim.latex - - - captures - - 1 - - name - support.function.url.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - name - punctuation.definition.arguments.begin.latex - - 4 - - name - markup.underline.link.latex - - 5 - - name - punctuation.definition.arguments.end.latex - - - match - (?:\s*)((\\)(?:url|href))(\{)([^}]*)(\}) - name - meta.function.link.url.latex - - - captures - - 1 - - name - support.function.be.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - name - punctuation.definition.arguments.begin.latex - - 4 - - name - variable.parameter.function.latex - - 5 - - name - punctuation.definition.arguments.end.latex - - - comment - These two patterns match the \begin{document} and \end{document} commands, so that the environment matching pattern following them will ignore those commands. - match - (?:\s*)((\\)begin)(\{)(document)(\}) - name - meta.function.begin-document.latex - - - captures - - 1 - - name - support.function.be.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - name - punctuation.definition.arguments.begin.latex - - 4 - - name - variable.parameter.function.latex - - 5 - - name - punctuation.definition.arguments.end.latex - - - match - (?:\s*)((\\)end)(\{)(document)(\}) - name - meta.function.end-document.latex - - - begin - (?x) - (?:\s*) # Optional whitespace - ((\\)begin) # Marker - Function - (\{) # Open Bracket - ( - (?: - align|equation|eqnarray # Argument - | multline|aligned|alignat - | split|gather|gathered - | cases - ) - (?:\*)? # Optional Unnumbered - ) - (\}) # Close Bracket - (\s*\n)? # Match to end of line absent of content - - captures - - 1 - - name - support.function.be.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - name - punctuation.definition.arguments.begin.latex - - 4 - - name - variable.parameter.function.latex - - 5 - - name - punctuation.definition.arguments.end.latex - - - contentName - support.class.math.block.environment.latex - end - (?x) - (?:\s*) # Optional whitespace - ((\\)end) # Marker - Function - (\{) # Open Bracket - (\4) # Previous capture from begin - (\}) # Close Bracket - (?:\s*\n)? # Match to end of line absent of content - - name - meta.function.environment.math.latex - patterns - - - match - (?<!\\)& - name - keyword.control.equation.align.latex - - - match - \\\\ - name - keyword.control.equation.newline.latex - - - include - #definition-label - - - include - text.tex#math - - - include - $base - - - - - begin - (?x) - (?:\s*) # Optional whitespace - ((\\)begin) # Marker - Function - (\{) # Open Bracket - (array|tabular[xy*]?|xltabular) - (\}) # Close Bracket - (\s*\n)? # Match to end of line absent of content - - captures - - 1 - - name - support.function.be.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - name - punctuation.definition.arguments.begin.latex - - 4 - - name - variable.parameter.function.latex - - 5 - - name - punctuation.definition.arguments.end.latex - - - contentName - meta.data.environment.tabular.latex - end - (?x) - (?:\s*) # Optional whitespace - ((\\)end) # Marker - Function - (\{) # Open Bracket - (\4) # Previous capture from begin - (\}) # Close Bracket - (?:\s*\n)? # Match to end of line absent of content - - name - meta.function.environment.tabular.latex - patterns - - - match - (?<!\\)& - name - keyword.control.table.cell.latex - - - match - \\\\ - name - keyword.control.table.newline.latex - - - include - $base - - - - - begin - (?:\s*)((\\)begin)(\{)(itemize|enumerate|description|list)(\}) - captures - - 1 - - name - support.function.be.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - name - punctuation.definition.arguments.begin.latex - - 4 - - name - variable.parameter.function.latex - - 5 - - name - punctuation.definition.arguments.end.latex - - - end - ((\\)end)(\{)(\4)(\})(?:\s*\n)? - name - meta.function.environment.list.latex - patterns - - - include - $base - - - - - begin - (?:\s*)((\\)begin)(\{)(tikzpicture)(\}) - captures - - 1 - - name - support.function.be.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - name - punctuation.definition.arguments.begin.latex - - 4 - - name - variable.parameter.function.latex - - 5 - - name - punctuation.definition.arguments.end.latex - - - end - ((\\)end)(\{)(tikzpicture)(\})(?:\s*\n)? - name - meta.function.environment.latex.tikz - patterns - - - include - text.tex.latex - - - - - begin - (?:\s*)((\\)begin)(\{)(frame)(\}) - captures - - 1 - - name - support.function.be.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - name - punctuation.definition.arguments.begin.latex - - 4 - - name - variable.parameter.function.latex - - 5 - - name - punctuation.definition.arguments.end.latex - - - end - ((\\)end)(\{)(frame)(\}) - name - meta.function.environment.frame.latex - patterns - - - include - $base - - - - - begin - (?:\s*)((\\)begin)(\{)(\w+[*]?)(\}) - captures - - 1 - - name - support.function.be.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - name - punctuation.definition.arguments.begin.latex - - 4 - - name - variable.parameter.function.latex - - 5 - - name - punctuation.definition.arguments.end.latex - - - end - ((\\)end)(\{)(\4)(\})(?:\s*\n)? - name - meta.function.environment.general.latex - patterns - - - include - $base - - - - - captures - - 1 - - name - punctuation.definition.function.latex - - - match - (\\)(newcommand|renewcommand)\b - name - storage.type.function.latex - - - begin - ((\\)marginpar)((?:\[[^\[]*?\])*)(\{) - beginCaptures - - 1 - - name - support.function.marginpar.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - patterns - - - include - #optional-arg - - - - 4 - - name - punctuation.definition.marginpar.begin.latex - - - contentName - meta.paragraph.margin.latex - end - \} - endCaptures - - 0 - - name - punctuation.definition.marginpar.end.latex - - - patterns - - - include - text.tex#braces - - - include - $base - - - - - begin - ((\\)footnote)((?:\[[^\[]*?\])*)(\{) - beginCaptures - - 1 - - name - support.function.footnote.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - patterns - - - include - #optional-arg - - - - 4 - - name - punctuation.definition.footnote.begin.latex - - - contentName - meta.footnote.latex - end - \} - endCaptures - - 0 - - name - punctuation.definition.footnote.end.latex - - - patterns - - - include - text.tex#braces - - - include - $base - - - - - begin - ((\\)emph)(\{) - beginCaptures - - 1 - - name - support.function.emph.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - name - punctuation.definition.emph.begin.latex - - - contentName - markup.italic.emph.latex - end - \} - endCaptures - - 0 - - name - punctuation.definition.emph.end.latex - - - name - meta.function.emph.latex - patterns - - - include - text.tex#braces - - - include - $base - - - - - begin - ((\\)textit)(\{) - captures - - 1 - - name - support.function.textit.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - name - punctuation.definition.textit.begin.latex - - - comment - We put the keyword in a capture and name this capture, so that disabling spell checking for “keyword” won't be inherited by the argument to \textit{...}. - -Put specific matches for particular LaTeX keyword.functions before the last two more general functions - contentName - markup.italic.textit.latex - end - \} - endCaptures - - 0 - - name - punctuation.definition.textit.end.latex - - - name - meta.function.textit.latex - patterns - - - include - text.tex#braces - - - include - $base - - - - - begin - ((\\)textbf)(\{) - captures - - 1 - - name - support.function.textbf.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - name - punctuation.definition.textbf.begin.latex - - - contentName - markup.bold.textbf.latex - end - \} - endCaptures - - 0 - - name - punctuation.definition.textbf.end.latex - - - name - meta.function.textbf.latex - patterns - - - include - text.tex#braces - - - include - $base - - - - - begin - ((\\)texttt)(\{) - captures - - 1 - - name - support.function.texttt.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - name - punctuation.definition.texttt.begin.latex - - - contentName - markup.raw.texttt.latex - end - \} - endCaptures - - 0 - - name - punctuation.definition.texttt.end.latex - - - name - meta.function.texttt.latex - patterns - - - include - text.tex#braces - - - include - $base - - - - - captures - - 0 - - name - keyword.other.item.latex - - 1 - - name - punctuation.definition.keyword.latex - - - match - (\\)item\b - name - meta.scope.item.latex - - - begin - (?x) - ( - (\\) # Marker - (?:auto)?(?:foot)?(?:full)?(?:no)?(?:short)? # Function Name - [cC]ite - (?:al)?(?:t|p|author|year(?:par)?|title)?[ANP]* - \*? # Optional Unabreviated - ) - (?:(\[)[^\]]*(\]))? # Optional - (?:(\[)[^\]]*(\]))? # Arguments - (\{) # Opening Bracket - - captures - - 1 - - name - keyword.control.cite.latex - - 2 - - name - punctuation.definition.keyword.latex - - 3 - - name - punctuation.definition.arguments.optional.begin.latex - - 4 - - name - punctuation.definition.arguments.optional.end.latex - - 5 - - name - punctuation.definition.arguments.optional.begin.latex - - 6 - - name - punctuation.definition.arguments.optional.end.latex - - 7 - - name - punctuation.definition.arguments.begin.latex - - - end - \} - endCaptures - - 0 - - name - punctuation.definition.arguments.end.latex - - - name - meta.citation.latex - patterns - - - match - [\w:.]+ - name - constant.other.reference.citation.latex - - - - - begin - ((\\)(?:\w*[r|R]ef\*?))(\{) - beginCaptures - - 1 - - name - keyword.control.ref.latex - - 2 - - name - punctuation.definition.keyword.latex - - 3 - - name - punctuation.definition.arguments.begin.latex - - - end - \} - endCaptures - - 0 - - name - punctuation.definition.arguments.end.latex - - - name - meta.reference.label.latex - patterns - - - match - [a-zA-Z0-9\.,:/*!^_-] - name - constant.other.reference.label.latex - - - - - include - #definition-label - - - begin - ((\\)verb[\*]?)\s*((\\)scantokens)(\{) - beginCaptures - - 1 - - name - support.function.verb.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - name - support.function.verb.latex - - 4 - - name - punctuation.definition.verb.latex - - 5 - - name - punctuation.definition.begin.latex - - - contentName - markup.raw.verb.latex - end - (\}) - endCaptures - - 1 - - name - punctuation.definition.end.latex - - - name - meta.function.verb.latex - patterns - - - include - $self - - - - - captures - - 1 - - name - support.function.verb.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - name - punctuation.definition.verb.latex - - 4 - - name - markup.raw.verb.latex - - 5 - - name - punctuation.definition.verb.latex - - - match - ((\\)verb[\*]?)\s*((?<=\s)\S|[^a-zA-Z])(.*?)(\3|$) - name - meta.function.verb.latex - - - captures - - 1 - - name - support.function.verb.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - patterns - - - include - #optional-arg - - - - 4 - - name - punctuation.definition.arguments.begin.latex - - 5 - - name - punctuation.definition.arguments.end.latex - - 6 - - name - punctuation.definition.verb.latex - - 7 - - name - markup.raw.verb.latex - - 8 - - name - punctuation.definition.verb.latex - - 9 - - name - punctuation.definition.verb.latex - - 10 - - name - markup.raw.verb.latex - - 11 - - name - punctuation.definition.verb.latex - - - match - ((\\)(?:mint|mintinline))((?:\[[^\[]*?\])?)(\{)[a-zA-Z]*(\})(?:(?:([^a-zA-Z\{])(.*?)(\6))|(?:(\{)(.*?)(\}))) - name - meta.function.verb.latex - - - captures - - 1 - - name - support.function.verb.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - patterns - - - include - #optional-arg - - - - 4 - - name - punctuation.definition.verb.latex - - 5 - - name - markup.raw.verb.latex - - 6 - - name - punctuation.definition.verb.latex - - 7 - - name - punctuation.definition.verb.latex - - 8 - - name - markup.raw.verb.latex - - 9 - - name - punctuation.definition.verb.latex - - - match - ((\\)(?:lstinline))((?:\[[^\[]*?\])?)(?:(?:([^a-zA-Z\{])(.*?)(\4))|(?:(\{)(.*?)(\}))) - name - meta.function.verb.latex - - - match - \\(?:newline|pagebreak|clearpage|linebreak|pause)(?:\b) - name - keyword.control.layout.tex - - - begin - \\\( - beginCaptures - - 0 - - name - punctuation.definition.string.begin.latex - - - end - \\\) - endCaptures - - 0 - - name - punctuation.definition.string.end.latex - - - name - support.class.math.latex - patterns - - - include - text.tex#math - - - include - $base - - - - - begin - \$\$ - beginCaptures - - 0 - - name - punctuation.definition.string.begin.latex - - - end - \$\$ - endCaptures - - 0 - - name - punctuation.definition.string.end.latex - - - name - support.class.math.latex - patterns - - - match - \\\$ - name - constant.character.escape.tex - - - include - text.tex#math - - - include - $base - - - - - begin - \\\[ - beginCaptures - - 0 - - name - punctuation.definition.string.begin.latex - - - end - \\\] - endCaptures - - 0 - - name - punctuation.definition.string.end.latex - - - name - support.class.math.latex - patterns - - - include - text.tex#math - - - include - $base - - - - - captures - - 1 - - name - punctuation.definition.constant.latex - - - match - (\\)(text(s(terling|ixoldstyle|urd|e(ction|venoldstyle|rvicemark))|yen|n(ineoldstyle|umero|aira)|c(ircledP|o(py(left|right)|lonmonetary)|urrency|e(nt(oldstyle)?|lsius))|t(hree(superior|oldstyle|quarters(emdash)?)|i(ldelow|mes)|w(o(superior|oldstyle)|elveudash)|rademark)|interrobang(down)?|zerooldstyle|o(hm|ne(superior|half|oldstyle|quarter)|penbullet|rd(feminine|masculine))|d(i(scount|ed|v(orced)?)|o(ng|wnarrow|llar(oldstyle)?)|egree|agger(dbl)?|blhyphen(char)?)|uparrow|p(ilcrow|e(so|r(t(housand|enthousand)|iodcentered))|aragraph|m)|e(stimated|ightoldstyle|uro)|quotes(traight(dblbase|base)|ingle)|f(iveoldstyle|ouroldstyle|lorin|ractionsolidus)|won|l(not|ira|e(ftarrow|af)|quill|angle|brackdbl)|a(s(cii(caron|dieresis|acute|grave|macron|breve)|teriskcentered)|cutedbl)|r(ightarrow|e(cipe|ferencemark|gistered)|quill|angle|brackdbl)|g(uarani|ravedbl)|m(ho|inus|u(sicalnote)?|arried)|b(igcircle|orn|ullet|lank|a(ht|rdbl)|rokenbar)))\b - name - constant.character.latex - - - captures - - 1 - - name - punctuation.definition.column-specials.begin.latex - - 2 - - name - punctuation.definition.column-specials.end.latex - - - match - (?:<|>)(\{)\$(\}) - name - meta.column-specials.latex - - - include - text.tex - - - repository - - optional-arg - - patterns - - - captures - - 1 - - name - punctuation.definition.optional.arguments.begin.latex - - 2 - - name - variable.parameter.latex - - 3 - - name - punctuation.definition.optional.arguments.end.latex - - - match - (\[)([^\[]*?)(\]) - - - - minted-env - - captures - - 1 - - name - support.function.be.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - name - punctuation.definition.arguments.begin.latex - - 4 - - name - variable.parameter.function.latex - - 5 - - name - punctuation.definition.arguments.end.latex - - 6 - - name - punctuation.definition.arguments.optional.begin.latex - - 7 - - name - punctuation.definition.arguments.optional.end.latex - - 8 - - name - punctuation.definition.arguments.begin.latex - - 9 - - name - variable.parameter.function.latex - - 10 - - name - punctuation.definition.arguments.end.latex - - - match - ((\\)(?:begin|end))(\{)(lstlisting|minted|pyglist)(\})(?:(\[).*(\]))?(?:(\{)([a-z]*)(\}))? - - code-env - - captures - - 1 - - name - support.function.be.latex - - 2 - - name - punctuation.definition.function.latex - - 3 - - name - punctuation.definition.arguments.begin.latex - - 4 - - name - variable.parameter.function.latex - - 5 - - name - punctuation.definition.arguments.end.latex - - 6 - - name - punctuation.definition.arguments.optional.begin.latex - - 7 - - name - punctuation.definition.arguments.optional.end.latex - - - match - (?:\s*)((\\)(?:begin|end))(\{)([a-z]*code(?:\*)?|gnuplot|dot2tex|asy)(\})(?:(\[).*(\]))? - - definition-label - - begin - ((\\)label)(\{) - beginCaptures - - 1 - - name - keyword.control.label.latex - - 2 - - name - punctuation.definition.keyword.latex - - 3 - - name - punctuation.definition.arguments.begin.latex - - - end - \} - endCaptures - - 0 - - name - punctuation.definition.arguments.end.latex - - - name - meta.definition.label.latex - patterns - - - match - [a-zA-Z0-9\.,:/*!^_-] - name - variable.parameter.definition.label.latex - - - - - scopeName - text.tex.latex - uuid - 3BEEA00C-6B1D-11D9-B8AD-000D93589AF6 - - diff --git a/lib/shiki-languages/data/extraGrammars/nginx.tmLanguage b/lib/shiki-languages/data/extraGrammars/nginx.tmLanguage deleted file mode 100644 index f802b07d..00000000 --- a/lib/shiki-languages/data/extraGrammars/nginx.tmLanguage +++ /dev/null @@ -1,1265 +0,0 @@ - - - - - fileTypes - - conf.erb - conf - ngx - nginx.conf - mime.types - fastcgi_params - scgi_params - uwsgi_params - - foldingStartMarker - \{\s*$ - foldingStopMarker - ^\s*\} - keyEquivalent - ^~N - name - nginx - patterns - - - match - \#.* - name - comment.line.number-sign - - - name - meta.context.events.nginx - begin - \b(events) +\{ - end - \} - beginCaptures - - 1 - - name - storage.type.context.nginx - - - patterns - - - include - $self - - - - - name - meta.context.http.nginx - begin - \b(http) +\{ - end - \} - beginCaptures - - 1 - - name - storage.type.context.nginx - - - patterns - - - include - $self - - - - - name - meta.context.types.nginx - begin - \b(types) +\{ - end - \} - beginCaptures - - 1 - - name - storage.type.context.nginx - - - patterns - - - include - $self - - - - - name - meta.context.server.nginx - begin - \b(server) +\{ - end - \} - beginCaptures - - 1 - - name - storage.type.context.nginx - - - patterns - - - include - $self - - - - - name - meta.context.location.nginx - begin - \b(location) +[\^]?~[\*]? +(.*?)\{ - end - \} - beginCaptures - - 1 - - name - storage.type.context.location.nginx - - 2 - - name - string.regexp.nginx - - - patterns - - - include - $self - - - - - name - meta.context.location.nginx - begin - \b(location) +(.*?)\{ - end - \} - beginCaptures - - 1 - - name - storage.type.context.location.nginx - - 2 - - name - entity.name.context.location.nginx - - - patterns - - - include - $self - - - - - name - meta.context.upstream.nginx - begin - \b(upstream) +(.*?)\{ - end - \} - beginCaptures - - 1 - - name - storage.type.context.nginx - - 2 - - name - entity.name.context.location.nginx - - - patterns - - - include - $self - - - - - begin - \b(if) +\( - end - \) - beginCaptures - - 1 - - name - keyword.control.nginx - - - patterns - - - include - #values - - - - - name - meta.block.nginx - begin - \{ - end - \} - patterns - - - include - $self - - - - - begin - \b(daemon|env|debug_points|error_log|include|lock_file|master_process|pid|ssl_engine|timer_resolution|user|worker_cpu_affinity|worker_priority|worker_processes|worker_rlimit_core|worker_rlimit_nofile|worker_rlimit_sigpending|working_directory)\b - captures - - 1 - - name - keyword.directive.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(accept_mutex|accept_mutex_delay|debug_connection|devpoll_changes|devpoll_events|epoll_events|kqueue_changes|kqueue_events|multi_accept|rtsig_signo|rtsig_overflow_events|rtsig_overflow_test|rtsig_overflow_threshold|use|worker_connections)\b - captures - - 1 - - name - keyword.directive.module.events.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(aio|alias|chunked_transfer_encoding|client_body_in_file_only|client_body_in_single_buffer|client_body_buffer_size|client_body_temp_path|client_body_timeout|client_header_buffer_size|client_header_timeout|client_max_body_size|connection_pool_size|default_type|directio|error_page|if_modified_since|internal|keepalive_disable|keepalive_timeout|keepalive_requests|large_client_header_buffers|limit_except|limit_rate|limit_rate_after|lingering_close|lingering_time|lingering_timeout|listen|log_not_found|log_subrequest|msie_padding|msie_refresh|open_file_cache|open_file_cache_errors|open_file_cache_min_uses|open_file_cache_valid|optimize_server_names|port_in_redirect|post_action|recursive_error_pages|request_pool_size|reset_timedout_connection|resolver|resolver_timeout|root|satisfy|satisfy_any|send_timeout|sendfile|server_name|server_name_in_redirect|server_names_hash_max_size|server_names_hash_bucket_size|server_tokens|tcp_nodelay|tcp_nopush|try_files|types\ |underscores_in_hashes|variables_hash_bucket_size|variables_hash_max_size|types_hash_max_size)\b - captures - - 1 - - name - keyword.directive.module.http.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(set_real_ip_from|real_ip_recursive|real_ip_header)\b - captures - - 1 - - name - keyword.directive.module.http.realip.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(allow|deny)\b - captures - - 1 - - name - keyword.directive.module.http.access.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(auth_basic|auth_basic_user_file)\b - captures - - 1 - - name - keyword.directive.module.http.auth_basic.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(autoindex|autoindex_exact_size|autoindex_localtime)\b - captures - - 1 - - name - keyword.directive.module.http.autoindex.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(ancient_browser|ancient_browser_value|modern_browser|modern_browser_value)\b - captures - - 1 - - name - keyword.directive.module.http.browser.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(charset|charset_map|override_charset|source_charset)\b - captures - - 1 - - name - keyword.directive.module.http.charset.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(empty_gif)\b - captures - - 1 - - name - keyword.directive.module.http.empty_gif.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(fastcgi_bind|fastcgi_buffer_size|fastcgi_buffers|fastcgi_cache|fastcgi_cache_key|fastcgi_cache_path|fastcgi_cache_methods|fastcgi_cache_min_uses|fastcgi_cache_use_stale|fastcgi_cache_valid|fastcgi_connect_timeout|fastcgi_index|fastcgi_hide_header|fastcgi_ignore_client_abort|fastcgi_ignore_headers|fastcgi_intercept_errors|fastcgi_max_temp_file_size|fastcgi_no_cache|fastcgi_next_upstream|fastcgi_param|fastcgi_pass|fastcgi_pass_header|fastcgi_pass_request_body|fastcgi_pass_request_headers|fastcgi_read_timeout|fastcgi_redirect_errors|fastcgi_send_timeout|fastcgi_split_path_info|fastcgi_store|fastcgi_store_access|fastcgi_temp_path)\b - captures - - 1 - - name - keyword.directive.module.http.fastcgi.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(geo)\b - captures - - 1 - - name - keyword.directive.module.http.geo.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(gzip|gzip_buffers|gzip_comp_level|gzip_disable|gzip_http_version|gzip_min_length|gzip_proxied|gzip_types|gzip_vary)\b - captures - - 1 - - name - keyword.directive.module.http.gzip.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(gzip_static|gzip_disable|gzip_http_version|gzip_proxied|gzip_vary)\b - captures - - 1 - - name - keyword.directive.module.http.gzip_static.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(add_header|expires)\b - captures - - 1 - - name - keyword.directive.module.http.headers.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(index)\b - captures - - 1 - - name - keyword.directive.module.http.index.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - match - \b(limit_req_log_level|limit_req_zone|limit_req)\b - captures - - 1 - - name - keyword.directive.module.http.limit_req.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(limit_zone|limit_conn|limit_conn_log_level)\b - captures - - 1 - - name - keyword.directive.module.http.limit_zone.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(limit_conn_zone|limit_conn|limit_conn_log_level)\b - captures - - 1 - - name - keyword.directive.module.http.limit_conn.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(access_log|log_format|open_log_file_cache)\b - captures - - 1 - - name - keyword.directive.module.http.log.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - name - meta.context.map.nginx - begin - \b(map) +(\$[A-Za-z0-9\_]+) +(\$[A-Za-z0-9\_]+) *\{ - end - \} - beginCaptures - - 1 - - name - storage.type.context.nginx - - 2 - - name - variable.other.nginx - - 3 - - name - variable.other.nginx - - - patterns - - - include - #values - - - match - ; - name - punctuation.definition.map.nginx - - - - - begin - \b(map_hash_max_size|map_hash_bucket_size)\b - captures - - 1 - - name - keyword.directive.module.http.map.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(memcached_pass|memcached_connect_timeout|memcached_read_timeout|memcached_send_timeout|memcached_buffer_size|memcached_next_upstream)\b - captures - - 1 - - name - keyword.directive.module.http.memcached.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(proxy_bind|proxy_buffer_size|proxy_buffering|proxy_buffers|proxy_busy_buffers_size|proxy_cache|proxy_cache_bypass|proxy_cache_key|proxy_cache_methods|proxy_cache_min_uses|proxy_cache_path|proxy_cache_use_stale|proxy_cache_valid|proxy_connect_timeout|proxy_headers_hash_bucket_size|proxy_headers_hash_max_size|proxy_hide_header|proxy_ignore_client_abort|proxy_ignore_headers|proxy_intercept_errors|proxy_max_temp_file_size|proxy_method|proxy_next_upstream|proxy_no_cache|proxy_pass|proxy_http_version|proxy_pass_header|proxy_pass_request_body|proxy_pass_request_headers|proxy_redirect|proxy_read_timeout|proxy_redirect_errors|proxy_send_lowat|proxy_send_timeout|proxy_set_body|proxy_set_header|proxy_ssl_session_reuse|proxy_store|proxy_store_access|proxy_temp_file_write_size|proxy_temp_path|proxy_upstream_fail_timeout|proxy_upstream_max_fails)\b - captures - - 1 - - name - keyword.directive.module.http.proxy.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(valid_referers)\b - captures - - 1 - - name - keyword.directive.module.http.referer.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(rewrite_log|set|uninitialized_variable_warn)\b - captures - - 1 - - name - keyword.directive.module.http.rewrite.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(break|return)\b - captures - - 1 - - name - support.function.module.http.rewrite.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(rewrite)\b *(".+?(?<!\\)"|'.+?(?<!\\)'|((.+?)(?<!\\)\s)) - captures - - 1 - - name - keyword.directive.module.http.rewrite.nginx - - 2 - - name - string.regexp.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(scgi_bind|scgi_buffer_size|scgi_buffering|scgi_buffers|scgi_busy_buffers_size|scgi_cache|scgi_cache_bypass|scgi_cache_key|scgi_cache_methods|scgi_cache_min_uses|scgi_cache_path|scgi_cache_use_stale|scgi_cache_valid|scgi_connect_timeout|scgi_hide_header|scgi_ignore_client_abort|scgi_ignore_headers|scgi_intercept_errors|scgi_max_temp_file_size|scgi_next_upstream|scgi_no_cache|scgi_param|scgi_pass|scgi_pass_header|scgi_pass_request_body|scgi_pass_request_headers|scgi_read_timeout|scgi_send_timeout|scgi_store|scgi_store_access|scgi_temp_file_write_size|scgi_temp_path)\b - captures - - 1 - - name - keyword.directive.module.http.scgi.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(split_clients)\b - captures - - 1 - - name - keyword.directive.module.http.split_clients.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(ssi|ssi_silent_errors|ssi_types|ssi_value_length)\b - captures - - 1 - - name - keyword.directive.module.http.ssi.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(ssl|ssl_certificate|ssl_certificate_key|ssl_client_certificate|ssl_dhparam|ssl_ciphers|ssl_crl|ssl_prefer_server_ciphers|ssl_protocols|ssl_verify_client|ssl_verify_depth|ssl_session_cache|ssl_session_timeout|ssl_engine)\b - captures - - 1 - - name - keyword.directive.module.http.ssl.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(ip_hash|server)\b - captures - - 1 - - name - keyword.directive.module.http.upstream.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(userid|userid_domain|userid_expires|userid_name|userid_p3p|userid_path|userid_service)\b - captures - - 1 - - name - keyword.directive.module.http.userid.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b(uwsgi_bind|uwsgi_buffer_size|uwsgi_buffering|uwsgi_buffers|uwsgi_busy_buffers_size|uwsgi_cache|uwsgi_cache_bypass|uwsgi_cache_key|uwsgi_cache_methods|uwsgi_cache_min_uses|uwsgi_cache_path|uwsgi_cache_use_stale|uwsgi_cache_valid|uwsgi_connect_timeout|uwsgi_hide_header|uwsgi_ignore_client_abort|uwsgi_ignore_headers|uwsgi_intercept_errors|uwsgi_max_temp_file_size|uwsgi_modifier1|uwsgi_modifier2|uwsgi_next_upstream|uwsgi_no_cache|uwsgi_param|uwsgi_pass|uwsgi_pass_header|uwsgi_pass_request_body|uwsgi_pass_request_headers|uwsgi_read_timeout|uwsgi_send_timeout|uwsgi_store|uwsgi_store_access|uwsgi_string|uwsgi_temp_file_write_size|uwsgi_temp_path)\b - captures - - 1 - - name - keyword.directive.module.http.uwsgi.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b([a-zA-Z0-9\_]+)\s+ - end - (;|$) - patterns - - - include - #values - - - beginCaptures - - 1 - - name - keyword.directive.module.unsupported.nginx - - - name - punctuation.definition.variable - - - begin - \b(stub_status)\b - captures - - 1 - - name - keyword.directive.module.http.stub_status.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - begin - \b([a-z]+\/[a-z0-9\-\.\+]+)\b - captures - - 1 - - name - keyword.directive.module.http.nginx - - - end - ; - patterns - - - include - #values - - - name - punctuation.definition.variable - - - repository - - variables - - patterns - - - match - (\$[A-Za-z0-9\_]+)\b - name - variable.other.nginx - - - - values - - patterns - - - include - #variables - - - match - [\t ]([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}|[0-9a-f:]+)(\/[0-9]{2})?(?=[\t ;]) - captures - - 1 - - name - string.ipaddress.nginx - - 2 - - name - constant.numeric.cidr.nginx - - - - - match - [\t ](=?[0-9][0-9\.]*[bBkKmMgGtTsShHdD]?)(?=[\t ;]) - captures - - 1 - - name - constant.numeric.nginx - - - - - match - [\t ](on|off|true|false)(?=[\t ;]) - name - constant.language.nginx - - - match - [\t ](kqueue|rtsig|epoll|\/dev\/poll|select|poll|eventport|max|all|default_server|default|main|crit|error|debug|warn|notice|last)(?=[\t ;]) - name - constant.language.nginx - - - match - \\.*\ |\~\*|\~|\!\~\*|\!\~ - name - string.regexp.nginx - - - match - \^.*?\$ - name - string.regexp.nginx - - - begin - " - end - " - name - string.quoted.double.nginx - patterns - - - match - \\" - name - constant.character.escape.nginx - - - include - #variables - - - - - begin - ' - end - ' - name - string.quoted.single.nginx - patterns - - - match - \\' - name - constant.character.escape.nginx - - - include - #variables - - - - - - - scopeName - source.nginx - uuid - 0C04066A-12D2-43CA-8238-00A12CE4C12D - - diff --git a/lib/shiki-languages/data/extraGrammars/postcss.json b/lib/shiki-languages/data/extraGrammars/postcss.json deleted file mode 100644 index eba75349..00000000 --- a/lib/shiki-languages/data/extraGrammars/postcss.json +++ /dev/null @@ -1,1648 +0,0 @@ -{ - "scopeName": "source.css.postcss", - "fileTypes": [ - "css", - "pcss", - "postcss" - ], - "name": "PostCSS", - "foldingStartMarker": "\\{\\s*$", - "foldingStopMarker": "^\\s*\\}", - "repository": { - "at_rule_charset": { - "begin": "\\s*((@)charset\\b)\\s*", - "captures": { - "1": { - "name": "keyword.control.at-rule.charset.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - } - }, - "comment": "Charset", - "end": "\\s*((?=;|$))", - "name": "meta.at-rule.charset.postcss", - "patterns": [ - { - "include": "#variable" - }, - { - "include": "#string_single" - }, - { - "include": "#string_double" - } - ] - }, - "at_rule_apply": { - "begin": "\\s*((@)apply\\b)\\s*", - "captures": { - "1": { - "name": "keyword.control.at-rule.apply.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - } - }, - "comment": "Apply", - "end": "\\s*((?=;|$))", - "name": "meta.at-rule.apply.postcss", - "patterns": [ - { - "include": "#variable" - } - ] - }, - "at_rule_content": { - "begin": "\\s*((@)content\\b)\\s*", - "captures": { - "1": { - "name": "keyword.control.content.postcss" - } - }, - "end": "\\s*((?=;))", - "name": "meta.content.postcss", - "patterns": [ - { - "include": "#variable" - }, - { - "include": "#selectors" - }, - { - "include": "#property_values" - } - ] - }, - "at_rule_each": { - "begin": "\\s*((@)each\\b)\\s*", - "captures": { - "1": { - "name": "keyword.control.each.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - } - }, - "end": "\\s*((?=\\}))", - "name": "meta.at-rule.each.postcss", - "patterns": [ - { - "match": "\\b(in|\\,)\\b", - "name": "keyword.control.operator" - }, - { - "include": "#variable" - }, - { - "include": "#property_values" - }, - { - "include": "$self" - } - ] - }, - "at_rule_else": { - "begin": "\\s*((@)else(\\s*(if)?))\\s*", - "captures": { - "1": { - "name": "keyword.control.else.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - } - }, - "end": "\\s*(?=\\{)", - "name": "meta.at-rule.else.postcss", - "patterns": [ - { - "include": "#logical_operators" - }, - { - "include": "#variable" - }, - { - "include": "#property_values" - } - ] - }, - "at_rule_extend": { - "begin": "\\s*((@)extend\\b)\\s*", - "captures": { - "1": { - "name": "keyword.control.at-rule.import.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - } - }, - "end": "\\s*(?=\\;)", - "name": "meta.at-rule.import.postcss", - "patterns": [ - { - "include": "#variable" - }, - { - "include": "#selectors" - }, - { - "include": "#property_values" - } - ] - }, - "at_rule_fontface": { - "patterns": [ - { - "begin": "^\\s*((@)font-face\\b)", - "beginCaptures": { - "1": { - "name": "keyword.control.at-rule.fontface.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - } - }, - "end": "\\s*(?=\\{)", - "name": "meta.at-rule.fontface.postcss", - "patterns": [ - { - "include": "#function_attributes" - } - ] - } - ] - }, - "at_rule_for": { - "begin": "\\s*((@)for\\b)\\s*", - "captures": { - "1": { - "name": "keyword.control.for.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - } - }, - "end": "\\s*(?=\\{)", - "name": "meta.at-rule.for.postcss", - "patterns": [ - { - "match": "(\\=\\=|\\!\\=|\\<\\=|\\>\\=|\\<|\\>|from|to|through)", - "name": "keyword.control.operator" - }, - { - "include": "#variable" - }, - { - "include": "#property_values" - }, - { - "include": "$self" - } - ] - }, - "at_rule_function": { - "patterns": [ - { - "begin": "\\s*((@)function\\b)\\s*", - "captures": { - "1": { - "name": "keyword.control.at-rule.function.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - }, - "3": { - "name": "entity.name.function.postcss" - } - }, - "comment": "Function with Attributes", - "end": "\\s*(?=\\{)", - "name": "meta.at-rule.function.postcss", - "patterns": [ - { - "include": "#function_attributes" - } - ] - }, - { - "captures": { - "1": { - "name": "keyword.control.at-rule.function.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - }, - "3": { - "name": "entity.name.function.postcss" - } - }, - "comment": "Simple Function", - "match": "\\s*((@)function\\b)\\s*", - "name": "meta.at-rule.function.postcss" - } - ] - }, - "at_rule_if": { - "begin": "\\s*((@)if\\b)\\s*", - "captures": { - "1": { - "name": "keyword.control.if.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - } - }, - "end": "\\s*(?=\\{)", - "name": "meta.at-rule.if.postcss", - "patterns": [ - { - "include": "#logical_operators" - }, - { - "include": "#variable" - }, - { - "include": "#property_values" - } - ] - }, - "at_rule_import": { - "begin": "\\s*((@)import\\b)\\s*", - "captures": { - "1": { - "name": "keyword.control.at-rule.import.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - } - }, - "end": "\\s*((?=;)|(?=\\}))", - "name": "meta.at-rule.import.postcss", - "patterns": [ - { - "include": "#variable" - }, - { - "include": "#string_single" - }, - { - "include": "#string_double" - }, - { - "include": "#functions" - }, - { - "include": "#comment_line" - } - ] - }, - "at_rule_nest": { - "begin": "\\s*((@)nest\\b)\\s*", - "captures": { - "1": { - "name": "keyword.control.at-rule.nest.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - } - }, - "comment": "The Nesting At-Rule", - "end": "\\s*(?=\\{)", - "name": "meta.at-rule.nest.postcss", - "patterns": [ - { - "include": "#selectors" - }, - { - "include": "#property_values" - } - ] - }, - "at_rule_value": { - "begin": "\\s*((@)value\\b)\\s*", - "captures": { - "1": { - "name": "keyword.control.at-rule.value.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - } - }, - "end": "\\s*((?=;)|(?=\\}))", - "name": "meta.at-rule.value.postcss", - "patterns": [ - { - "include": "#variable" - }, - { - "include": "#string_single" - }, - { - "include": "#string_double" - }, - { - "include": "#functions" - }, - { - "include": "#comment_line" - } - ] - }, - "at_rule_use": { - "begin": "\\s*((@)use\\b)\\s*", - "captures": { - "1": { - "name": "keyword.control.at-rule.use.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - } - }, - "end": "\\s*((?=;)|(?=\\}))", - "name": "meta.at-rule.use.postcss", - "patterns": [ - { - "include": "#variable" - }, - { - "include": "#string_single" - }, - { - "include": "#string_double" - }, - { - "include": "#functions" - }, - { - "include": "#comment_line" - } - ] - }, - "at_rule_custom_media": { - "begin": "\\s*((@)custom-media\\b)\\s*", - "captures": { - "1": { - "name": "keyword.control.at-rule.custom-media.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - } - }, - "end": "\\s*((?=;)|(?=\\}))", - "name": "meta.at-rule.custom-media.postcss", - "patterns": [ - { - "include": "#variable" - }, - { - "include": "#string_single" - }, - { - "include": "#string_double" - }, - { - "include": "#functions" - }, - { - "include": "#comment_line" - } - ] - }, - "at_rule_custom_selector": { - "begin": "\\s*((@)custom-selector\\b)\\s*", - "captures": { - "1": { - "name": "keyword.control.at-rule.custom-selector.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - } - }, - "end": "\\s*((?=;)|(?=\\}))", - "name": "meta.at-rule.custom-selector.postcss", - "patterns": [ - { - "include": "#variable" - }, - { - "include": "#string_single" - }, - { - "include": "#string_double" - }, - { - "include": "#functions" - }, - { - "include": "#comment_line" - } - ] - }, - "at_rule_include": { - "patterns": [ - { - "begin": "\\s*((@)include\\b)\\s*", - "captures": { - "1": { - "name": "keyword.control.at-rule.include.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - }, - "3": { - "name": "entity.name.function.postcss" - }, - "4": { - "name": "entity.name.text.postcss" - } - }, - "end": "\\s*[\\)|\\s\\;]", - "name": "meta.at-rule.include.postcss", - "patterns": [ - { - "include": "#function_attributes" - }, - { - "include": "#functions" - } - ] - } - ] - }, - "at_rule_keyframes": { - "patterns": [ - { - "begin": "^\\s*((@)(\\-[\\w\\-]*\\-)?keyframes\\b)\\s*([\\w-]*)", - "captures": { - "1": { - "name": "keyword.control.at-rule.keyframes.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - }, - "3": { - "name": "punctuation.definition.keyword.postcss" - }, - "4": { - "name": "entity.name.function.postcss" - } - }, - "comment": "Keyframes with Attributes", - "end": "(?<=\\})(?:\\s*$)?", - "name": "meta.at-rule.keyframes.postcss", - "patterns": [ - { - "begin": "\\{", - "end": "\\}", - "beginCaptures": { - "0": { - "name": "punctuation.section.keyframes.begin.postcss" - } - }, - "endCaptures": { - "0": { - "name": "punctuation.section.keyframes.end.postcss" - } - }, - "name": "meta.keyframes.postcss", - "patterns": [ - { - "match": "(\\b(\\d+%|from\\b|to\\b))", - "name": "entity.other.attribute-name.postcss" - }, - { - "include": "#interpolation" - }, - { - "include": "#property_list" - } - ] - } - ] - } - ] - }, - "at_rule_media": { - "patterns": [ - { - "begin": "^\\s*((@)media\\b)\\s*", - "end": "\\s*(?=\\{)", - "captures": { - "1": { - "name": "keyword.control.at-rule.media.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - } - }, - "name": "meta.at-rule.media.postcss", - "patterns": [ - { - "match": "\\b(only)\\b", - "name": "keyword.control.operator" - }, - { - "include": "#property_values" - }, - { - "include": "#variable" - }, - { - "include": "#logical_operators" - }, - { - "include": "#media_features" - }, - { - "include": "#media_types" - }, - { - "include": "#property_names" - } - ] - } - ] - }, - "at_rule_mixin": { - "patterns": [ - { - "begin": "\\s*((@)mixin) ([\\w-]*)\\s*\\(", - "captures": { - "1": { - "name": "keyword.control.at-rule.mixin.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - }, - "3": { - "name": "entity.name.function.postcss" - } - }, - "comment": "Mixin with Attributes", - "end": "\\)", - "name": "meta.at-rule.mixin.postcss", - "patterns": [ - { - "include": "#function_attributes" - } - ] - }, - { - "captures": { - "1": { - "name": "keyword.control.at-rule.mixin.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - }, - "3": { - "name": "entity.name.function.postcss" - } - }, - "comment": "Simple Mixin", - "match": "^\\s*((@)mixin) ([\\w-]{1,})", - "name": "meta.at-rule.mixin.postcss" - } - ] - }, - "at_rule_namespace": { - "patterns": [ - { - "begin": "\\s*((@)namespace)\\s+(?=url)", - "captures": { - "1": { - "name": "keyword.control.at-rule.namespace.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - }, - "3": { - "name": "support.function.misc.postcss" - } - }, - "comment": "Namespace without prefix", - "end": "\\s*((?=;|$))", - "name": "meta.at-rule.namespace.postcss", - "patterns": [ - { - "include": "#property_values" - }, - { - "include": "#string_single" - }, - { - "include": "#string_double" - } - ] - }, - { - "begin": "\\s*((@)namespace) ([\\w-]*)\\s*", - "captures": { - "1": { - "name": "keyword.control.at-rule.namespace.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - }, - "3": { - "name": "entity.name.function.postcss" - } - }, - "comment": "Namespace", - "end": "\\s*((?=;|$))", - "name": "meta.at-rule.namespace.postcss", - "patterns": [ - { - "include": "#variables" - }, - { - "include": "#cssnext_variables" - }, - { - "include": "#property_values" - }, - { - "include": "#string_single" - }, - { - "include": "#string_double" - } - ] - } - ] - }, - "at_rule_option": { - "captures": { - "1": { - "name": "keyword.control.at-rule.charset.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - } - }, - "comment": "Option", - "match": "^\\s*((@)option\\b)\\s*", - "name": "meta.at-rule.option.postcss" - }, - "at_rule_page": { - "patterns": [ - { - "begin": "^\\s*((@)page)(?=:|\\s)\\s*([-:\\w]*)", - "captures": { - "1": { - "name": "keyword.control.at-rule.page.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - }, - "3": { - "name": "entity.name.function.postcss" - } - }, - "comment": "Page with Attributes", - "end": "\\s*(?=\\{)", - "name": "meta.at-rule.page.postcss" - } - ] - }, - "at_rule_return": { - "begin": "\\s*((@)(return)\\b)", - "captures": { - "1": { - "name": "keyword.control.return.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - } - }, - "end": "\\s*((?=;))", - "name": "meta.at-rule.return.postcss", - "patterns": [ - { - "include": "#variable" - }, - { - "include": "#property_values" - } - ] - }, - "at_rule_at_root": { - "begin": "\\s*((@)(at-root))(\\s+|$)", - "end": "\\s*(?=\\{)", - "beginCaptures": { - "1": { - "name": "keyword.control.at-rule.at-root.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - } - }, - "name": "meta.at-rule.at-root.postcss", - "patterns": [ - { - "include": "#function_attributes" - }, - { - "include": "#functions" - }, - { - "include": "#selectors" - } - ] - }, - "at_rule_warn": { - "begin": "\\s*((@)(warn|debug|error)\\b)\\s*", - "captures": { - "1": { - "name": "keyword.control.warn.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - } - }, - "end": "\\s*(?=\\;)", - "name": "meta.at-rule.warn.postcss", - "patterns": [ - { - "include": "#variable" - }, - { - "include": "#string_double" - }, - { - "include": "#string_single" - } - ] - }, - "at_rule_while": { - "begin": "\\s*((@)while\\b)\\s*", - "captures": { - "1": { - "name": "keyword.control.while.postcss" - }, - "2": { - "name": "punctuation.definition.keyword.postcss" - } - }, - "end": "\\s*(?=\\})", - "name": "meta.at-rule.while.postcss", - "patterns": [ - { - "include": "#logical_operators" - }, - { - "include": "#variable" - }, - { - "include": "#property_values" - }, - { - "include": "$self" - } - ] - }, - "comment_block": { - "begin": "\\s*/\\*\\s*", - "captures": { - "0": { - "name": "punctuation.whitespace.comment.trailing.postcss" - } - }, - "comment": "Revamped Comment block.", - "end": "(\\*/)\\s*", - "name": "comment.block.postcss" - }, - "comment_line": { - "begin": "(\\s*)//", - "comment": "Revamped", - "end": "$(\\s*)", - "name": "comment.line.postcss" - }, - "constant_color": { - "match": "\\b(aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen)\\b", - "name": "support.constant.color.w3c-standard-color-name.postcss" - }, - "constant_default": { - "match": "\\!default", - "name": "keyword.other.default.postcss" - }, - "constant_font": { - "match": "(\\b(?i:arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace)\\b)", - "name": "string.constant.font-name.postcss" - }, - "constant_functions": { - "begin": "([\\w-]+)(\\()", - "beginCaptures": { - "1": { - "name": "support.function.misc.postcss" - }, - "2": { - "name": "punctuation.section.function.postcss" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.function.postcss" - } - }, - "patterns": [ - { - "include": "#parameters" - } - ] - }, - "constant_hex": { - "captures": { - "1": { - "name": "punctuation.definition.constant.postcss" - } - }, - "match": "(#)([0-9a-fA-F]{1}|[0-9a-fA-F]{2}|[0-9a-fA-F]{3}|[0-9a-fA-F]{4}|[0-9a-fA-F]{6})\\b", - "name": "constant.other.color.rgb-value.postcss" - }, - "constant_important": { - "match": "\\!important", - "name": "keyword.other.important.postcss" - }, - "constant_mathematical_symbols": { - "match": "(\\b(\\+|\\-|\\*|/)\\b)", - "name": "support.constant.mathematical-symbols.postcss" - }, - "constant_optional": { - "match": "\\!optional", - "name": "keyword.other.optional.postcss" - }, - "constant_property_value": { - "match": "\\b(absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|block|bold|bolder|both|bottom|border-box|break-all|break-word|butt|capitalize|center|char|circle|cjk-ideographic|col-resize|collapse|column-reverse|column|contain|content-box|cover|crosshair|currentColor|dashed|decimal-leading-zero|decimal|default|disabled|disc|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ellipsis|fill|fixed|flex-end|flex-start|flex|georgian|groove|hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|inactive|inherit|inline-block|inline-flex|inline|inset|inside|inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|keep-all|landscape|left|lighter|line-edge|line-through|line|list-item|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|nw-resize|none|normal|not-allowed|nowrap|null|oblique|outset|outside|overline|pointer|portrait|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|right|ridge|round|row-resize|row-reverse|row|rtl|s-resize|scroll|se-resize|separate|small-caps|solid|space-around|space-between|square|static|stretch|strict|super|sw-resize|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-bottom|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|wrap|wrap-reverse|zero|true|false|vertical|horizontal)\\b", - "name": "support.constant.property-value.postcss" - }, - "postcss_values": { - "match": "\\b(responsive|fix-legacy|fix|amaro|brannan|earlybird|inkwell|kalvin|lo-fi|nashville|toaster|small-caps|lining-nums)\\b", - "name": "support.constant.property-value.postcss" - }, - "constant_rgb": { - "match": "(?\\=|\\<|\\>|not|or|and)\\b", - "name": "keyword.control.operator" - }, - "media_attributes": { - "patterns": [ - { - "match": ":", - "name": "punctuation.definition" - }, - { - "include": "#general" - }, - { - "include": "#property_name" - }, - { - "include": "#postcss_properties" - }, - { - "include": "#property_values" - }, - { - "include": "#property_name_au" - }, - { - "comment": "We even have error highlighting <3", - "match": "[=\\{\\}\\?\\@]", - "name": "invalid.illegal" - } - ] - }, - "media_features": { - "patterns": [ - { - "match": "\\b(min-device-aspect-ratio|max-device-aspect-ratio|device-aspect-ratio|min-aspect-ratio|max-aspect-ratio|aspect-ratio|min-device-height|max-device-height|device-height|min-device-width|max-device-width|device-width|min-monochrome|max-monochrome|monochrome|min-color-index|max-color-index|color-index|min-color|max-color|color|orientation|scan|min-resolution|max-resolution|resolution|grid|min-width|max-width|width)\\b", - "name": "support.type.property-name.media.css" - } - ] - }, - "media_types": { - "patterns": [ - { - "match": "\\b(all|aural|braille|embossed|handheld|print|projection|screen|tty|tv)\\b", - "name": "support.constant.media.css" - } - ] - }, - "parameters": { - "patterns": [ - { - "include": "#variable" - }, - { - "include": "#property_values" - }, - { - "include": "#comment_line" - }, - { - "include": "#comment_block" - }, - { - "match": "[^'\",) \\t]+", - "name": "variable.parameter.url.postcss" - }, - { - "match": ",", - "name": "punctuation.postcss" - } - ] - }, - "properties": { - "patterns": [ - { - "begin": "(?(['\"])(?:[^\\\\]|\\\\.)*?(\\6)))))?\\s*(\\])", - "name": "meta.attribute-selector.postcss" - }, - "selector_class": { - "captures": { - "1": { - "name": "punctuation.definition.entity.css" - } - }, - "match": "(\\.)[a-zA-Z0-9_-]+", - "name": "entity.other.attribute-name.class.css" - }, - "selector_entities": { - "match": "\\b(:root|a|abbr|acronym|address|area|article|aside|audio|b|base|bdi|bdo|big|blockquote|body|br|button|canvas|caption|circle|cite|code|col|colgroup|data|datalist|dd|del|details|dfn|dialog|div|dl|dt|em|embed|eventsource|fieldset|figure|figcaption|footer|form|frame|frameset|g|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|keygen|label|legend|li|line(?!-)|link|main|map|mark|menu|menuitem|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|path|polygon|polyline|pre|progress|q|rb|rect|rp|rt|rtc|ruby|s|samp|script|section|select|small|source|span|strike|strong|style|sub|summary|sup|svg|table(?!-)|tbody|td|template|text(?!-)|textarea|textpath|tfoot|th|thead|time|title|tr|track|tspan|tt|u|ul|var|video|wbr)\\b", - "name": "entity.name.tag.postcss" - }, - "selector_custom": { - "match": "\\b([a-zA-Z0-9]+(-[a-zA-Z0-9]+)+)(?=\\.|\\s++[^:]|\\s*[,{]|:(matches|not|link|any-link|visited|hover|active|focus|target|lang|disabled|enabled|checked|indeterminate|root|nth-child()|nth-last-child()|nth-of-type()|nth-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.postcss" - }, - "selector_id": { - "captures": { - "1": { - "name": "punctuation.definition.entity.css" - } - }, - "match": "(#)[a-zA-Z][a-zA-Z0-9_-]*", - "name": "entity.other.attribute-name.id.css" - }, - "selector_placeholder": { - "captures": { - "1": { - "name": "punctuation.definition.entity.postcss" - } - }, - "match": "(\\%)[a-zA-Z0-9_-]+", - "name": "entity.other.attribute-name.placeholder.postcss" - }, - "parent_selector_suffix": { - "match": "(?<=&)[a-zA-Z0-9_-]+", - "name": "entity.other.attribute-name.parent-selector-suffix.postcss" - }, - "selector_pseudo_class": { - "captures": { - "1": { - "name": "punctuation.definition.entity.css" - } - }, - "match": "(:)\\b(link|any-link|matches|not|visited|hover|active|focus|target|lang|disabled|enabled|checked|indeterminate|root|nth-child()|nth-last-child()|nth-of-type()|nth-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.other.attribute-name.pseudo-class.css" - }, - "selector_pseudo_element": { - "captures": { - "1": { - "name": "punctuation.definition.entity.css" - } - }, - "match": "(:+)((-(moz|webkit|ms)-)?(after|before|first-letter|first-line|selection))\\b", - "name": "entity.other.attribute-name.pseudo-element.css" - }, - "selectors": { - "comment": "Stuff for Selectors.", - "patterns": [ - { - "include": "#selector_entities" - }, - { - "include": "#selector_custom" - }, - { - "include": "#selector_class" - }, - { - "include": "#selector_id" - }, - { - "include": "#selector_pseudo_class" - }, - { - "include": "#tag_wildcard" - }, - { - "include": "#tag_parent_reference" - }, - { - "include": "#selector_pseudo_element" - }, - { - "include": "#selector_attribute" - }, - { - "include": "#selector_placeholder" - }, - { - "include": "#parent_selector_suffix" - } - ] - }, - "string_double": { - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.postcss" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.postcss" - } - }, - "name": "string.quoted.double.postcss", - "patterns": [ - { - "match": "\\\\.", - "name": "constant.character.escape.postcss" - }, - { - "include": "#interpolation" - } - ] - }, - "string_single": { - "begin": "'", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.postcss" - } - }, - "end": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.postcss" - } - }, - "name": "string.quoted.single.postcss", - "patterns": [ - { - "match": "\\\\.", - "name": "constant.character.escape.postcss" - }, - { - "include": "#interpolation" - } - ] - }, - "tag_parent_reference": { - "match": "\\&", - "name": "entity.name.tag.reference.postcss" - }, - "tag_wildcard": { - "match": "\\*", - "name": "entity.name.tag.wildcard.postcss" - }, - "variable": { - "patterns": [ - { - "include": "#variables" - }, - { - "include": "#cssnext_variables" - }, - { - "include": "#interpolation" - } - ] - }, - "cssnext_variables": { - "captures": { - "1": { - "name": "variable.postcss" - } - }, - "match": "\\---?[_a-zA-Z]+[_a-zA-Z0-9-]*", - "name": "variable.var.postcss" - }, - "variables": { - "captures": { - "1": { - "name": "variable.postcss" - } - }, - "match": "\\s*(\\$[A-Za-z0-9_-]+\\b)\\s*", - "name": "variable.postcss" - } - }, - "patterns": [ - { - "include": "#variable_setting" - }, - { - "include": "#at_rule_include" - }, - { - "include": "#at_rule_import" - }, - { - "include": "#at_rule_use" - }, - { - "include": "#at_rule_custom_media" - }, - { - "include": "#at_rule_custom_selector" - }, - { - "include": "#general" - }, - { - "include": "#flow_control" - }, - { - "include": "#rules" - }, - { - "include": "#property_list" - }, - { - "include": "#at_rule_mixin" - }, - { - "include": "#at_rule_media" - }, - { - "include": "#at_rule_function" - }, - { - "include": "#at_rule_charset" - }, - { - "include": "#at_rule_apply" - }, - { - "include": "#at_rule_option" - }, - { - "include": "#at_rule_namespace" - }, - { - "include": "#at_rule_nest" - }, - { - "include": "#at_rule_fontface" - }, - { - "include": "#at_rule_page" - }, - { - "include": "#at_rule_keyframes" - }, - { - "include": "#at_rule_at_root" - }, - { - "match": "\\b(colour|zed-index)\\b(?=\\:|\\s\\s*)", - "name": "support.type.property-name.postcss" - }, - { - "match": "\\b(centre|yeah-nah|fair-dinkum|rack-off|woop-woop)\\b", - "name": "variable.property-value.postcss" - }, - { - "match": "(\\b|\\s)(!bloody-oath)\\b", - "name": "keyword.control.postcss" - }, - { - "match": "\\b(true-blue|vegemite|vb-green|kangaroo|koala)\\b", - "name": "support.constant.color.w3c-standard-color-name.postcss" - }, - { - "match": "(\\b|\\s)(!sorry)\\b", - "name": "keyword.control.postcss" - }, - { - "match": "\\b(grey)\\b", - "name": "support.constant.color.w3c-standard-color-name.postcss" - }, - { - "match": "\\b(animation-verzögerung|animation-richtung|animation-dauer|animation-füll-methode|animation-wiederholung-anzahl|animation-name|animation-abspiel-zustand|animation-takt-funktion|animation|hintergrund-befestigung|hintergrund-beschnitt|hintergrund-farbe|hintergrund-bild|hintergrund-ursprung|hintergrund-position|hintergrund-wiederholung|hintergrund-größe|hintergrund|rahmen-unten-farbe|rahmen-unten-links-radius|rahmen-unten-rechts-radius|rahmen-unten-stil|rahmen-unten-breite|rahmen-unten|rahmen-kollaps|rahmen-farbe|rahmen-bild|rahmen-bild-anfang|rahmen-bild-wiederholung|rahmen-bild-schnitt|rahmen-bild-quelle|rahmen-bild-breite|rahmen-links-farbe|rahmen-links-stil|rahmen-links-breite|rahmen-links|rahmen-radius|rahmen-rechts-farbe|rahmen-rechts-stil|rahmen-rechts-breite|rahmen-rechts|rahmen-abstand|rahmen-stil|rahmen-oben-farbe|rahmen-oben-links-radius|rahmen-oben-rechts-radius|rahmen-oben-stil|rahmen-oben-breite|rahmen-oben|rahmen-breite|rahmen|unten|kasten-schatten|kasten-bemessung|beschriftung-seite|klären|beschnitt|farbe|spalten|spalte-anzahl|spalte-füllung|spalte-lücke|spalte-linie|spalte-linie-farbe|spalte-linie-stil|spalte-linie-breite|spalte-spanne|spalte-breite|inhalt|zähler-erhöhen|zähler-zurücksetzen|zeiger|anzeige|leere-zellen|filter|flex-grundlage|flex-richtung|flex-fluss|flex-wachsem|flex-schrumpfen|flex-umbruch|umlaufen|schrift-familie|schrift-eigenschaft-einstellungen|schrift-größe|schrift-größe-einstellen|schrift-stil|schrift-variante|schrift-gewicht|schrift|höhe|trennstriche|inhalt-ausrichten|links|zeichen-abstand|zeilen-umbruch|zeilen-höhe|listen-stil-bild|listen-stil-position|listen-stil-typ|listen-stil|außenabstand-unten|außenabstand-links|außenabstand-rechts|außenabstand-oben|außenabstand|max-höhe|max-breite|min-höhe|min-breite|deckkraft|reihenfolge|schusterjungen|kontur-farbe|kontur-abstand|kontur-stil|kontur-breite|kontur|überlauf-x|überlauf-y|überlauf|innenabstand-unten|innenabstand-left|innenabstand-rechts|innenabstand-oben|innenabstand|perspektive-ursprung|perspektive|zeiger-ereignisse|position|anführungszeichen|größenänderung|rechts|tabelle-gestaltung|tab-größe|text-ausrichten|text-verzierung|text-einrückung|text-orientierung|text-überlauf|text-wiedergabe|text-schatten|text-umformung|oben|übergang-verzögerung|übergang-dauer|übergang-eigenschaft|übergang-takt-funktion|übergang|unicode-bidi|vertikale-ausrichtung|sichtbarkeit|weißraum|hurenkinder|breite|wort-umbruch|wort-abstand|wort-umschlag|schreib-richtung|ebene)\\b(?=\\:|\\s\\s*)", - "name": "support.type.property-name.postcss" - }, - { - "match": "\\b(absolut|automatisch|fett|fixiert|versteckt|erben|initial|kursiv|links|nicht-wiederholen|keines|relativ|wiederholen-x|wiederholen-y|wiederholen|rechts|durchgezogen|statisch|aufheben)\\b", - "name": "variable.property-value.postcss" - }, - { - "match": "(\\b|\\s)(!wichtig)\\b", - "name": "keyword.control.postcss" - }, - { - "match": "\\b(eisfarben|antikweiß|wasser|aquamarinblau|beige|biskuit|mandelweiß|blauviolett|gelbbraun|kadettenblau|schokolade|kornblumenblau|mais|karmesinrot|dunkelblau|dunkeltürkis|dunklegoldrunenfarbe|dunkelgrün|dunkelgrau|dunkelkhaki|dunkelmagenta|dunkelolivgrün|dunkelorange|dunkleorchidee|dunkelrot|dunklelachsfarbe|dunklesseegrün|dunklesschieferblau|dunkelviolett|tiefrosa|tiefhimmelblau|gedimmtesgrau|persinningblau|backstein|blütenweiß|waldgrün|geisterweiß|grüngelb|honigmelone|leuchtendrosa|indischrot|elfenbein|staubfarbend|lavendelrosa|grasgrün|chiffongelb|hellblau|helleskorallenrot|helltürkis|hellgrau|hellgrün|hellrosa|hellelachsfarbe|hellesseegrün|helleshimmelblau|hellesschiefergrau|hellesstahlblau|hellgelb|limonengrün|leinen|kastanie|mitternachtsblau|cremigeminze|altrosa|mokassin|navajoweiß|marineblau|altespitze|olivgrünbraun|orangerot|orchidee|blassegoldrunenfarbe|blassegoldrunenfarbe|blasstürkis|blasstürkis|pfirsich|pflaume|taubenblau|violett|rosigesbraun|royalblau|sattelbraun|lachsfarben|sandbraun|seegrün|muschel|siennaerde|silber|schieferblau|schiefergrau|schneeweiß|frühlingsgrün|stahlblau|hautfarben|krickentengrün|distel|tomate|türkis|veilchen|weizen|rauchfarben|gelbgrün|himmelblau|schwarz|blau|koralle|cyan|grau|grün|rosa|lavendel|limone|orange|rot|weiß|gelb)\\b", - "name": "support.constant.color.w3c-standard-color-name.postcss" - }, - { - "match": "\\b(ключевыекадры|анимация|имя-анимации|длительность-анимации|функция-времени-анимации|задержка-анимации|число-повторов-анимации|направление-анимации|статус-проигрывания-анимации|фон|положение-фона|цвет-фона|изображение-фона|позиция-фона|повтор-фона|обрезка-фона|начало-фона|размер-фона|граница|нижняя-граница|цвет-нижней-границы|стиль-нижней-границы|толщина-нижней-границы|цвет-границы|левая-граница|цвет-левой-границы|стиль-левой-границы|толщина-левой-границы|правая-граница|цвет-правой-границы|стиль-правой-границы|толщина-правой-границы|стиль-границы|верхняя-граница|цвет-верхней-границы|стиль-верхней-границы|толщина-верхней-границы|толщина-границы|контур|цвет-контура|стиль-контура|толщина-контура|радиус-нижней-левой-рамки|радиус-нижней-правой-рамки|изображение-рамки|начало-изображения-рамки|повтор-изображения-рамки|смещение-изображения-рамки|источник-изображения-рамки|толщина-изображения-рамки|радиус-рамки|радиус-верхней-левой-рамки|радиус-верхней-правой-рамки|разрыв-оформления-блока|тень-блока|переполнение-икс|переполнение-игрек|стиль-переполнения|поворот|точка-поворота|цветовой-профиль|непрозрачность|намерение-отрисовки|метка-закладки|уровень-закладки|цель-закладки|плавающий-сдвиг|дефисный-после|дефисный-до|дефисный-символ|дефисный-строки|дифисный-ресурс|дефисы|разрешение-изображения|маркировка|набор-строк|высота|макс-высота|макс-ширина|мин-высота|мин-ширина|ширина|выравнивание-блока|направление-блока|флекс-блок|группа-флекс-блока|линии-блока|порядок-группы-бокса|ориентация-бокса|пак-бокса|шрифт|семейство-шрифта|размер-шрифта|стиль-шрифта|вид-шрифта|вес-шрифта|определение-шрифта|подгонка-размера-шрифта|разрядка-шрифта|содержимое|инкремент-счетчика|сброс-счетчика|кавычки|обрезка|сдвинуть-на|политика-страницы|колонки-сетки|ряды-сетки|цель|имя-цели|новая-цель|позиция-цели|подгонка-выравнивания|выравнивание-базовой|сдвиг-базовой|домининация-базовой|выравнивание-строчного-блока|высота-текста|стиль-списка|изображение-стиля-списка|позиция-стиля-списка|тип-стиля-списка|поле|поле-снизу|поле-слева|поле-справа|поле-сверху|направление-шатра|количество-повторов-шатра|скорость-шатра|стиль-шатра|количество-колонок|заполнение-колонок|зазор-колонок|направляющая-колонок|цвет-направляющей-колонок|стиль-направляющей-колонок|ширина-направляющей-колонок|охват-колонок|ширина-колонок|колонки|отбивка|отбивка-снизу|отбивка-слева|отбивка-справа|отбивка-сверху|ориентация-изображения|страница|размер|снизу|очистить|обрезать|курсор|отображение|обтекание|слева|переполнение|положение|справа|сверху|видимость|зед-индекс|сироты|разрыв-страницы-после|разрыв-страницы-до|разрыв-страницы-внутри|вдовы|схлопывание-границ|расстояние-границ|сторона-подписи|пустые-ячейки|макет-таблицы|цвет|направление|мужбуквенный-пробел|высота-строки|выравнивание-текста|оформление-текста|отступ-текста|трансформация-текста|уникод-биди|вертикальное-выравнивание|пробелы|межсловный-пробел|висячая-пунктуация|обрезка-пунктуации|выравнивание-последней-строки|выключка-текста|контур-текста|переполнение-текста|тень-текста|подгонка-размера-текста|обертка-текста|разрыв-слова|обертка-слова|трансформация|точка-трансформации|стиль-трансформации|перспектива|точка-перспективы|видимость-задника|переход|свойство-перехода|длительность-перехода|функция-вренеми-перехода|задержка-перехода|представление|калибровка-блока|иконка|нав-вниз|нав-индекс|нав-влево|нав-вправо|нав-вверх|смещение-контура|ресайз|зум|фильтр|выделение-пользователем|сглаживание-шрифта|осх-сглаживание-шрифта|переполнение-прокрутки|ист)\\b(?=\\:|\\s\\s*)", - "name": "support.type.property-name.postcss" - }, - { - "match": "\\b(выше|абсолютный|абсолютная|абсолютное|после|псевдоним|все|всё|свободный-скролл|все-капителью|всё-капителью|позволить-конец|алфавитный|алфавитная|алфавитное|альтернативный|альтернативная|альтернативное|альтернативный-инвертированн|альтернативная-инвертированн|альтернативное-инвертированн|всегда|армянский|армянская|армянское|авто|избегать|избегать-колонку|избегать-страницу|назад|баланс|базоваялиния|перед|ниже|отменить-биди|мигать|блок|блокировать|блочное|жирный|более-жирный|по-границе|оба|нижний|перенос-всего|перенос-слов|капитализировать|ячейка|центр|круг|обрезать|клонировать|закрывающие-кавычки|ресайз-колонки|схлопнуть|колонка|инвертировать-колонки|насыщенный|содержать|содержит|по-содержимому|контекстное-меню|копия|копировать|покрыть|перекрестие|пунктирная|десятичный|десятичный-ведущий-ноль|обычный|потомки|диск|распространять|распространить|точка|точечный|двойной|двойной-круг|в-ресайз|легкость|легкость-в|легкость-в-из|легкость-из|края|эллипсис|вставленный|конец|зв-ресайз|расширен|экстра-конденсирован|экстра-расширен|заполнение|заполнен|первый|фиксирован|плоский|флекс|флекс-конец|флекс-старт|форсированный-конец|вперед|полной-ширины|грузинский|канавка|помощь|скрытый|спрятать|горизонтальный|горизонтальный-тб|иконка|бесконечный|бесконечная|бесконечное|наследовать|начальный|начальная|начальное|чернила|строчный|строчный-блок|строчный-флекс|строчная-таблица|вставка|внутри|между-кластером|между-иероглифом|между-словом|инвертированный|инвертированная|инвертированное|курсив|курсивный|выключитьстроку|кашида|сохранить-все|большое|больше|последний|последняя|последнее|слева|левый|легче|зачеркнуть|линейный|линейная|линейное|последний-пункт|локальный|локальная|локальное|свободный|свободная|свободное|нижний-буквенный|нижний-греческий|нижний-латинский|нижний-романский|нижний-регистр|лнп|ручной|соответствует-родителю|средний|средняя|среднее|посередине|смешенный-справа|двигать|с-ресайз|св-ресайз|свюз-ресайз|не-закрывать-кавычки|не-сбрасывать|не-открывать-кавычки|не-повторять|нет|ничего|нету|нормальный|не-разрешен|безобтекания|сю-ресайз|сз-ресайз|сзюв-ресайз|объекты|наклонный|наклонная|наклонное|открыт|открывающие-кавычки|начало|снаружи|оверлайн|по-отбивке|страница|пауза|указатель|пре|пре-линия|пре-обертка|прогресс|относительный|относительная|относительное|повтор|повтор-икс|повтор-игрек|обратный|обратная|обратное|хребет|справа|превый|правый|круглый|круглая|круглое|ряд|ряд-ресайз|обратный-ряд|пнл|бегущий|бегущяя|бегущее|ю-ресайз|уменьшить|уменьшать|скролл|юв-ресайз|полу-конденсирован|полу-расширен|отдельный|отдельная|отдельное|кунжут|показать|боком|боком-лева|боком-права|нарезать|маленький|маленький|капитель|меньше|сплошной|пробел|пробел-вокруг|пробел-между|пробелы|квадрат|старт|статический|шаг-конец|шаг-старт|растягивать|строгий|строгая|строгое|стиль|суб|над|юз-ресайз|таблица|заголовок-таблицы|ячейка-таблицы|колонка-таблицы|группа-колонок-талицы|группа-футера-таблицы|группа-заголовка-таблицы|ряд-таблицы|группа-ряда-таблицы|текст|текст-внизу|текст-наверху|толстый|тонкий|начертание-титров|верх|прозрачный|прозрачная|прозрачное|треугольный|треугольная|треугольное|сверх-конденсирован|сверх-расширен|под|подчеркнут|однорегистровый|однорегистровая|однорегистровое|отключенный|отключенная|отключенное|верхний-буквенный|верхний-латинский|верхний-романский|верхний-регистр|вертикально|использовать-ориентуцию-знака|вертикальный|вертикальная|вертикальное|вертикальный-лп|вертикальный-пл|вертикальный-текст|видимый|з-ресайз|ждать|волнистый|волнистая|волнистое|вес|обернуть|обернуть-обратный|оч-большой|оч-маленький|очоч-большой|очоч-маленький|призумить|отзумить)\\b", - "name": "variable.property-value.postcss" - }, - { - "match": "(\\b|\\s)(!важно)\\b", - "name": "keyword.control.postcss" - }, - { - "match": "\\b(красный|красная|красное|оранжевый|оранжевая|оранжевое|желтый|желтая|желтое|оливковый|оливковая|оливковое|пурпурный|пурпурное|пурпурная|фуксия|белый|белая|белое|лимонный|лимонная|лимонное|зеленый|зеленая|зеленое|темносиний|темносиняя|темносинее|синий|синяя|синее|водяной|водяная|водяное|бирюзовый|бирюзовая|бирюзовое|черный|черная|черное|серебряный|серебряная|серебряное|серый|серая|серое)\\b", - "name": "support.constant.color.w3c-standard-color-name.postcss" - }, - { - "match": "\\b(моноширинный|c-засечками|без-засечек|фантазийный|рукописный)\\b", - "name": "string.constant.font-name.postcss" - }, - { - "match": "\\b(кзс|вычс|кзсп|урл|аттр|от|до)\\b", - "name": "storage.name.tag.postcss" - }, - { - "match": "\\b(fondo|flota|ancho|alto|puntero|redondeado|izquierda|derecha|arriba|abajo|espaciado)\\b", - "name": "support.type.property-name.postcss(?=\\:|\\s\\s*)" - }, - { - "match": "\\b(subrayado|manito|mayuscula|izquierda|derecha|arriba|abajo)\\b", - "name": "variable.property-value.postcss" - }, - { - "match": "(\\b|\\s)(!importantisimo)\\b", - "name": "keyword.control.postcss" - }, - { - "match": "\\b(animering-fördröjning|animering-riktning|animering-längd|animering-fyllnads-metod|animering-upprepning-antal|animering-namn|animering-spelning-status|animering-tajming-funktion|animering|bakgrund-bilaga|bakgrund-klipp|bakgrund-färg|bakgrund-bild|bakgrund-ursprung|bakgrund-position|bakgrund-upprepning|bakgrund-storlek|bakgrund|kant-botten-färg|kant-botten-vänster-radie|kant-botten-höger-radie|kant-botten-stil|kant-botten-bredd|kant-botten|kant-kollaps|kant-färg|kant-bild|kant-bild-början|kant-bild-upprepning|kant-bild-snitt|kant-bild-källa|kant-bild-bredd|kant-vänster-färg|kant-vänster-stil|kant-vänster-bredd|kant-vänster|kant-radie|kant-höger-färg|kant-höger-stil|kant-höger-bredd|kant-höger|kant-avstånd|kant-stil|kant-topp-färg|kant-topp-vänster-radie|kant-topp-höger-radie|kant-topp-stil|kant-topp-bredd|kant-topp|kant-bredd|kant|botten|låda-skugga|låda-kalibrering|bildtext-sida|rensa|klipp|färg|kolumn|kolumn-antal|kolumn-fyllning|kolumn-mellanrum|kolumn-linje|kolumn-linje-färg|kolumn-linje-stil|kolumn-linje-bredd|kolumn-spann|kolumn-bredd|innehåll|räknare-ökning|räknare-återställ|muspekare|visa|tomma-celler|filter|flex-grund|flex-rikting|flex-flöde|flex-ökning|flex-förminskning|flex-omslutning|flex|flyt|typsnitt-familj|typsnitt-särdrag-inställningar|typsnitt-storlek|typsnitt-storlek-justering|typsnitt-stil|typsnitt-variant|typsnitt-vikt|typsnitt|höjd|bindestreck|justera-innehåll|vänster|bokstav-mellanrum|linje-brytning|linje-höjd|lista-stil-bild|lista-stil-position|lista-stil-typ|lista-stil|marginal-botten|marginal-vänster|marginal-höger|marginal-topp|marginal|max-höjd|max-bredd|min-höjd|min-bredd|opacitet|ordning|föräldralösa|kontur-färg|kontur-abstand|kontur-stil|kontur-bredd|kontur|överflöde-x|överflöde-y|överflöde|stoppning-botten|stoppning-left|stoppning-höger|stoppning-topp|stoppning|perspektiv-ursprung|perspektiv|pekare-händelser|position|citat|storleksändra|höger|tabell-layout|tab-storlek|text-riktning|text-dekoration|text-indrag|text-inriktning|text-överflöde|text-rendering|text-skugga|text-omvanlda|topp|övergång-fördröjning|övergång-längd|övergång-egenskap|övergång-tajming-funktion|övergång|unicode-bidi|vertikal-riktning|synlighet|luftrum|änkor|bredd|ord-brytning|ord-avstånd|ord-omslutning|skriv-rikting|nivå)\\b(?=\\:|\\s\\s*)", - "name": "support.type.property-name.postcss" - }, - { - "name": "variable.property-value.postcss", - "match": "\\b(absolut|automatisk|fet|fixerad|gömd|ärva|inledande|kursiv|vänster|ingen-upprepning|ingen|uppradad|uppradad-block|relativ|upprepning-x|upprepning-y|upprepning|höger|solid|statisk|urkoppla)\\b" - }, - { - "match": "(\\b|\\s)(!viktigt)\\b", - "name": "keyword.control.postcss" - }, - { - "match": "\\b(isfärg|antikvitt|vatten|marinblå|beige|kex|mandelvit|blålila|gulbrun|kadettenblå|choklad|kornblå|majs|crimson|mörkblå|mörkturkos|mörkgyllenröd|mörkgrön|mörkgrå|mörkkhaki|mörkrosa|mörkolivgrön|mörkorange|mörkorchidee|mörkröd|mörklaxrosa|mörkväxtgräs|mörkskifferblått|mörklila|djuprosa|djuphimmelblå|grummelgrå|skojarblå|tegelsten|vitsippa|skogsgrön|spökvit|gröngul|honungsmelon|hetrosa|indiskröd|elfenben|khaki|lavendelrosa|gräsgrön|chiffongul|himmelblå|ljuskorall|ljusturkos|ljusgrå|ljusgrön|ljusrosa|ljuselaxrosa|ljushavsgrön|ljushimmelblå|ljusskiffergrå|ljusstålblå|ljusgul|limegrön|linnen|kastanj|midnattsblå|mintkräm|gammelrosa|mokassin|navajovitt|marineblå|spets|olivgrönbrun|orangeröd|orchidee|blektgyllenröd|blektgrön|blektturkos|papayakräm|persikopuff|plommon|ljusblå|lila|skärbrun|royalblå|sadelbrun|laxrosa|sandbrun|havsgrön|snäcka|sienna|silver|skifferblå|skiffergrå|snövit|vårgrön|stålblå|hudfärg|blågrön|tistel|tomat|turkos|violett|vete|vitrök|gulgrön|himmelblå|svart|blå|koraller|cyan|grå|grön|rosa|lavendel|lime|orange|röd|vit|gul)\\b", - "name": "support.constant.color.w3c-standard-color-name.postcss" - } - ] -} \ No newline at end of file diff --git a/lib/shiki-languages/data/extraGrammars/sass.tmLanguage b/lib/shiki-languages/data/extraGrammars/sass.tmLanguage deleted file mode 100644 index a25f46bf..00000000 --- a/lib/shiki-languages/data/extraGrammars/sass.tmLanguage +++ /dev/null @@ -1,750 +0,0 @@ - - - - - fileTypes - - sass - - foldingStartMarker - /\*|^#|^\*|^\b|^\. - foldingStopMarker - \*/|^\s*$ - name - Sass - patterns - - - begin - ^(/\*) - end - \*/|(?=^[a-zA-Z0-9#.%$@\[=*+]) - name - comment.block.sass - patterns - - - include - #comment-tag - - - include - #comment-param - - - - - begin - \s/\* - end - \*/ - name - comment.block.sass - patterns - - - include - #comment-tag - - - include - #comment-param - - - - - include - #double-slash - - - include - #double-quoted - - - include - #single-quoted - - - include - #interpolation - - - include - #curly-brackets - - - include - #placeholder-selector - - - begin - \$[a-zA-Z0-9_-]+(?=:) - end - $\n?|(?=\)\s\)|\)\n) - name - sass-script-maps - captures - - 0 - - name - variable.other - - - patterns - - - include - #double-slash - - - include - #double-quoted - - - include - #single-quoted - - - include - #interpolation - - - include - #variable - - - include - #rgb-value - - - include - #numeric - - - include - #unit - - - include - #flag - - - include - #comma - - - include - #function - - - include - #function-content - - - include - #operator - - - include - #reserved-words - - - include - #parent-selector - - - include - #property-value - - - include - #dotdotdot - - - - - include - #variable-root - - - include - #numeric - - - include - #unit - - - include - #flag - - - include - #comma - - - include - #semicolon - - - include - #dotdotdot - - - begin - @include|\+(?!\W|\d) - end - (?=\n|\() - name - support.function.name.sass.library - captures - - 0 - - name - keyword.control.at-rule.css.sass - - - - - begin - @mixin|^=|@function - end - $\n?|(?=\() - name - support.function.name.sass.no-completions - captures - - 0 - - name - keyword.control.at-rule.css.sass - - - patterns - - - match - [a-zA-Z0-9_-]+ - name - entity.name.function - - - - - match - (?<=@import)\s[a-zA-Z0-9_/.*-]+ - name - string.quoted.double.css.sass - - - begin - @ - end - $\n?|\s(?!(all|braille|embossed|handheld|print|projection|screen|speech|tty|tv|if|only|not)(\s|,)) - name - keyword.control.at-rule.css.sass - - - begin - # - end - $\n?|(?=\s|,|\(|\)|\.|\[|>) - name - entity.other.attribute-name.id.css.sass - patterns - - - include - #interpolation - - - include - #pseudo-class - - - - - begin - \.|(?<=&)(-|_) - end - $\n?|(?=\s|,|\(|\)|\[|>) - name - entity.other.attribute-name.class.css.sass - patterns - - - include - #interpolation - - - include - #pseudo-class - - - - - begin - \[ - end - \] - name - entity.other.attribute-selector.sass - patterns - - - include - #double-quoted - - - include - #single-quoted - - - match - \^|\$|\*|~ - name - keyword.other.regex.sass - - - - - match - (?<=\]|\)|not\(|\*|>|>\s):[a-z:-]+|(::|:-)[a-z:-]+ - name - entity.other.attribute-name.pseudo-class.css.sass - - - begin - : - end - $\n?|(?=\s\(|and\(|\),) - name - meta.property-list.css.sass - patterns - - - match - (?<=:)[a-z-]+\s - name - support.type.property-name.css.sass - - - include - #double-slash - - - include - #double-quoted - - - include - #single-quoted - - - include - #interpolation - - - include - #curly-brackets - - - include - #variable - - - include - #rgb-value - - - include - #numeric - - - include - #unit - - - include - #flag - - - include - #comma - - - include - #semicolon - - - include - #function - - - include - #function-content - - - include - #operator - - - include - #parent-selector - - - include - #property-value - - - - - include - #rgb-value - - - include - #function - - - include - #function-content - - - begin - (?<!\-|\()\b(a|abbr|acronym|address|applet|area|article|aside|audio|b|base|big|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|datalist|dd|del|details|dfn|dialog|div|dl|dt|em|embed|eventsource|fieldset|figure|figcaption|footer|form|frame|frameset|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|label|legend|li|link|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|picture|pre|progress|q|samp|script|section|select|small|source|span|strike|strong|style|sub|summary|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video|main|svg|rect|ruby|center|circle|ellipse|line|polyline|polygon|path|text|u|x)\b(?!-|\)|:\s)|& - end - $\n?|(?=\s|,|\(|\)|\.|\#|\[|>|-|_) - name - entity.name.tag.css.sass.symbol - patterns - - - include - #interpolation - - - include - #pseudo-class - - - - - begin - (?<=})(?!\n|\(|\)|[a-zA-Z0-9_-]+:) - end - \s|(?=,|\.|\[|\)|\n) - name - entity.name.tag.css.sass - patterns - - - include - #interpolation - - - include - #pseudo-class - - - - - include - #operator - - - match - [a-z-]+((?=:|#{)) - name - support.type.property-name.css.sass - - - include - #reserved-words - - - include - #property-value - - - repository - - comma - - match - \band\b|\bor\b|, - name - comment.punctuation.comma.sass - - comment-tag - - begin - (?<={{) - end - (?=}}) - name - comment.tag.sass - - comment-param - - match - \@(\w+) - name - keyword.control.at-rule.css.sass - - curly-brackets - - match - {|} - name - invalid - - dotdotdot - - match - \.\.\. - name - variable.other - - double-slash - - begin - // - end - $\n? - name - comment.line.sass - patterns - - - include - #comment-tag - - - include - #comment-param - - - - double-quoted - - begin - " - end - " - name - string.quoted.double.css.sass - patterns - - - include - #quoted-interpolation - - - - flag - - match - !(important|default|optional|global) - name - keyword.other.important.css.sass - - function - - match - (?<=[\s|\(|,|:])(?!url|format|attr)[a-zA-Z0-9_-][\w-]*(?=\() - name - support.function.name.sass - - function-content - - begin - (?<=url\(|format\(|attr\() - end - .(?=\)) - name - string.quoted.double.css.sass - - interpolation - - begin - #{ - end - } - name - support.function.interpolation.sass - patterns - - - include - #variable - - - include - #numeric - - - include - #operator - - - include - #unit - - - include - #comma - - - include - #double-quoted - - - include - #single-quoted - - - - numeric - - match - (-|\.)?[0-9]+(\.[0-9]+)? - name - constant.numeric.css.sass - - operator - - match - \+|\s-\s|\s-(?=\$)|(?<=\()-(?=\$)|\s-(?=\()|\*|/|%|=|!|<|>|~ - name - keyword.operator.sass - - parent-selector - - match - & - name - entity.name.tag.css.sass - - placeholder-selector - - begin - (?<!\d)%(?!\d) - end - $\n?|\s - name - entity.other.attribute-name.placeholder-selector.sass - - property-value - - match - [a-zA-Z0-9_-]+ - name - meta.property-value.css.sass, support.constant.property-value.css.sass - - pseudo-class - - match - :[a-z:-]+ - name - entity.other.attribute-name.pseudo-class.css.sass - - quoted-interpolation - - begin - #{ - end - } - name - support.function.interpolation.sass - patterns - - - include - #variable - - - include - #numeric - - - include - #operator - - - include - #unit - - - include - #comma - - - - reserved-words - - match - \b(false|from|in|not|null|through|to|true)\b - name - support.type.property-name.css.sass - - rgb-value - - match - (#)([0-9a-fA-F]{3}|[0-9a-fA-F]{6})\b - name - constant.other.color.rgb-value.css.sass - - semicolon - - match - ; - name - invalid - - single-quoted - - begin - ' - end - ' - name - string.quoted.single.css.sass - patterns - - - include - #quoted-interpolation - - - - unit - - match - (?<=[\d]|})(ch|cm|deg|dpcm|dpi|dppx|em|ex|grad|Hz|in|kHz|mm|ms|pc|pt|px|rad|rem|s|turn|vh|vmax|vmin|vw|%) - name - keyword.other.unit.css.sass - - variable-root - - match - \$[a-zA-Z0-9_-]+ - name - variable.other.root - - variable - - match - \$[a-zA-Z0-9_-]+ - name - variable.other.value - - - scopeName - source.sass - uuid - E8D3BD64-D3C3-4CDC-B721-2120C9F06B68 - - diff --git a/lib/shiki-languages/data/extraGrammars/stylus.json b/lib/shiki-languages/data/extraGrammars/stylus.json deleted file mode 100644 index 47896add..00000000 --- a/lib/shiki-languages/data/extraGrammars/stylus.json +++ /dev/null @@ -1,1199 +0,0 @@ -{ - "name": "Stylus", - "scopeName": "source.stylus", - "fileTypes": [ - "styl", - "stylus", - "css.styl", - "css.stylus" - ], - "patterns": [ - { - "include": "#comment" - }, - { - "include": "#at_rule" - }, - { - "include": "#language_keywords" - }, - { - "include": "#language_constants" - }, - { - "include": "#variable_declaration" - }, - { - "include": "#function" - }, - { - "include": "#selector" - }, - { - "include": "#declaration" - }, - { - "captures": { - "1": { - "name": "punctuation.section.property-list.begin.css" - }, - "2": { - "name": "punctuation.section.property-list.end.css" - } - }, - "match": "(\\{)(\\})", - "name": "meta.brace.curly.css" - }, - { - "match": "\\{|\\}", - "name": "meta.brace.curly.css" - }, - { - "include": "#numeric" - }, - { - "include": "#string" - }, - { - "include": "#operator" - } - ], - "repository": { - "comment": { - "patterns": [ - { - "include": "#comment_block" - }, - { - "include": "#comment_line" - } - ] - }, - "comment_block": { - "begin": "/\\*", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.begin.css" - } - }, - "end": "\\*/", - "endCaptures": { - "0": { - "name": "punctuation.definition.comment.end.css" - } - }, - "name": "comment.block.css" - }, - "comment_line": { - "begin": "(^[ \\t]+)?(?=//)", - "beginCaptures": { - "1": { - "name": "punctuation.whitespace.comment.leading.stylus" - } - }, - "end": "(?!\\G)", - "patterns": [ - { - "begin": "//", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.stylus" - } - }, - "end": "(?=\\n)", - "name": "comment.line.double-slash.stylus" - } - ] - }, - "selector": { - "patterns": [ - { - "match": "(?:(?=\\w)(?(['\"])(?:[^\\\\]|\\\\.)*?(\\6)))))?\\s*(\\])", - "name": "meta.attribute-selector.css" - }, - { - "include": "#interpolation" - }, - { - "include": "#variable" - } - ] - }, - "variable_declaration": { - "begin": "^[^\\S\\n]*(\\$?[a-zA-Z_-][a-zA-Z0-9_-]*)[^\\S\\n]*(\\=|\\?\\=|\\:\\=)", - "beginCaptures": { - "1": { - "name": "variable.stylus" - }, - "2": { - "name": "keyword.operator.stylus" - } - }, - "end": "(\\n)|(;)|(?=\\})", - "endCaptures": { - "2": { - "name": "punctuation.terminator.rule.css" - } - }, - "patterns": [ - { - "include": "#property_values" - } - ] - }, - "declaration": { - "begin": "((?<=^)[^\\S\\n]+)|((?<=;)[^\\S\\n]*)|((?<=\\{)[^\\S\\n]*)", - "end": "(?=\\n)|(;)|(?=\\})|(\\n)", - "endCaptures": { - "2": { - "name": "punctuation.terminator.rule.css" - } - }, - "name": "meta.property-list.css", - "patterns": [ - { - "include": "#language_keywords" - }, - { - "include": "#language_constants" - }, - { - "match": "(?:(?<=^)[^\\S\\n]+(\\n))" - }, - { - "match": "\\G\\s*(counter-reset|counter-increment)(?:(:)|[^\\S\\n])[^\\S\\n]*([a-zA-Z_-][a-zA-Z0-9_-]*)", - "captures": { - "1": { - "name": "support.type.property-name.css" - }, - "2": { - "name": "punctuation.separator.key-value.css" - }, - "3": { - "name": "variable.section.css" - } - }, - "name": "meta.property.counter.css" - }, - { - "begin": "\\G\\s*(filter)(?:(:)|[^\\S\\n])[^\\S\\n]*", - "beginCaptures": { - "1": { - "name": "support.type.property-name.css" - }, - "2": { - "name": "punctuation.separator.key-value.css" - } - }, - "end": "(?=\\n|;|\\}|$)", - "name": "meta.property.filter.css", - "patterns": [ - { - "include": "#function" - }, - { - "include": "#property_values" - } - ] - }, - { - "include": "#property" - }, - { - "include": "#interpolation" - }, - { - "include": "$self" - } - ] - }, - "property": { - "begin": "(?x:\\G\\s*(?:\n (-webkit-[-A-Za-z]+|-moz-[-A-Za-z]+|-o-[-A-Za-z]+|-ms-[-A-Za-z]+|-khtml-[-A-Za-z]+|zoom|z-index|y|x|wrap|word-wrap|word-spacing|word-break|word|width|widows|white-space-collapse|white-space|white|weight|volume|voice-volume|voice-stress|voice-rate|voice-pitch-range|voice-pitch|voice-family|voice-duration|voice-balance|voice|visibility|vertical-align|variant|user-select|up|unicode-bidi|unicode-range|unicode|trim|transition-timing-function|transition-property|transition-duration|transition-delay|transition|transform|touch-action|top-width|top-style|top-right-radius|top-left-radius|top-color|top|timing-function|text-wrap|text-transform|text-shadow|text-replace|text-rendering|text-overflow|text-outline|text-justify|text-indent|text-height|text-emphasis|text-decoration|text-align-last|text-align|text|target-position|target-new|target-name|target|table-layout|tab-size|style-type|style-position|style-image|style|string-set|stretch|stress|stacking-strategy|stacking-shift|stacking-ruby|stacking|src|speed|speech-rate|speech|speak-punctuation|speak-numeral|speak-header|speak|span|spacing|space-collapse|space|sizing|size-adjust|size|shadow|respond-to|rule-width|rule-style|rule-color|rule|ruby-span|ruby-position|ruby-overhang|ruby-align|ruby|rows|rotation-point|rotation|role|right-width|right-style|right-color|right|richness|rest-before|rest-after|rest|resource|resize|reset|replace|repeat|rendering-intent|rate|radius|quotes|punctuation-trim|punctuation|property|profile|presentation-level|presentation|position|pointer-events|point|play-state|play-during|play-count|pitch-range|pitch|phonemes|pause-before|pause-after|pause|page-policy|page-break-inside|page-break-before|page-break-after|page|padding-top|padding-right|padding-left|padding-bottom|padding|pack|overhang|overflow-y|overflow-x|overflow-style|overflow|outline-width|outline-style|outline-offset|outline-color|outline|orphans|origin|orientation|orient|ordinal-group|order|opacity|offset|numeral|new|nav-up|nav-right|nav-left|nav-index|nav-down|nav|name|move-to|model|mix-blend-mode|min-width|min-height|min|max-width|max-height|max|marquee-style|marquee-speed|marquee-play-count|marquee-direction|marquee|marks|mark-before|mark-after|mark|margin-top|margin-right|margin-left|margin-bottom|margin|mask-image|list-style-type|list-style-position|list-style-image|list-style|list|lines|line-stacking-strategy|line-stacking-shift|line-stacking-ruby|line-stacking|line-height|line-break|level|letter-spacing|length|left-width|left-style|left-color|left|label|justify-content|justify|iteration-count|inline-box-align|initial-value|initial-size|initial-before-align|initial-before-adjust|initial-after-align|initial-after-adjust|index|indent|increment|image-resolution|image-orientation|image|icon|hyphens|hyphenate-resource|hyphenate-lines|hyphenate-character|hyphenate-before|hyphenate-after|hyphenate|height|header|hanging-punctuation|gap|grid|grid-area|grid-auto-columns|grid-auto-flow|grid-auto-rows|grid-column|grid-column-end|grid-column-start|grid-row|grid-row-end|grid-row-start|grid-template|grid-template-areas|grid-template-columns|grid-template-rows|row-gap|gap|font-kerning|font-language-override|font-weight|font-variant-caps|font-variant|font-style|font-synthesis|font-stretch|font-size-adjust|font-size|font-family|font|float-offset|float|flex-wrap|flex-shrink|flex-grow|flex-group|flex-flow|flex-direction|flex-basis|flex|fit-position|fit|fill|filter|family|empty-cells|emphasis|elevation|duration|drop-initial-value|drop-initial-size|drop-initial-before-align|drop-initial-before-adjust|drop-initial-after-align|drop-initial-after-adjust|drop|down|dominant-baseline|display-role|display-model|display|direction|delay|decoration-break|decoration|cursor|cue-before|cue-after|cue|crop|counter-reset|counter-increment|counter|count|content|columns|column-width|column-span|column-rule-width|column-rule-style|column-rule-color|column-rule|column-gap|column-fill|column-count|column-break-before|column-break-after|column|color-profile|color|collapse|clip|clear|character|caption-side|break-inside|break-before|break-after|break|box-sizing|box-shadow|box-pack|box-orient|box-ordinal-group|box-lines|box-flex-group|box-flex|box-direction|box-decoration-break|box-align|box|bottom-width|bottom-style|bottom-right-radius|bottom-left-radius|bottom-color|bottom|border-width|border-top-width|border-top-style|border-top-right-radius|border-top-left-radius|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-radius|border-length|border-left-width|border-left-style|border-left-color|border-left|border-image|border-color|border-collapse|border-bottom-width|border-bottom-style|border-bottom-right-radius|border-bottom-left-radius|border-bottom-color|border-bottom|border|bookmark-target|bookmark-level|bookmark-label|bookmark|binding|bidi|before|baseline-shift|baseline|balance|background-blend-mode|background-size|background-repeat|background-position|background-origin|background-image|background-color|background-clip|background-break|background-attachment|background|azimuth|attachment|appearance|animation-timing-function|animation-play-state|animation-name|animation-iteration-count|animation-duration|animation-direction|animation-delay|animation-fill-mode|animation|alignment-baseline|alignment-adjust|alignment|align-self|align-last|align-items|align-content|align|after|adjust|will-change)|\n (writing-mode|text-anchor|stroke-width|stroke-opacity|stroke-miterlimit|stroke-linejoin|stroke-linecap|stroke-dashoffset|stroke-dasharray|stroke|stop-opacity|stop-color|shape-rendering|marker-start|marker-mid|marker-end|lighting-color|kerning|image-rendering|glyph-orientation-vertical|glyph-orientation-horizontal|flood-opacity|flood-color|fill-rule|fill-opacity|fill|enable-background|color-rendering|color-interpolation-filters|color-interpolation|clip-rule|clip-path)|\n ([a-zA-Z_-][a-zA-Z0-9_-]*)\n)(?!([^\\S\\n]*&)|([^\\S\\n]*\\{))(?=:|([^\\S\\n]+[^\\s])))", - "beginCaptures": { - "1": { - "name": "support.type.property-name.css" - }, - "2": { - "name": "support.type.property-name.svg.css" - }, - "3": { - "name": "support.function.mixin.stylus" - } - }, - "end": "(;)|(?=\\n|\\}|$)", - "endCaptures": { - "1": { - "name": "punctuation.terminator.rule.css" - } - }, - "patterns": [ - { - "include": "#property_value" - } - ] - }, - "property_value": { - "begin": "\\G(?:(:)|(\\s))(\\s*)(?!&)", - "beginCaptures": { - "1": { - "name": "punctuation.separator.key-value.css" - }, - "2": { - "name": "punctuation.separator.key-value.css" - } - }, - "end": "(?=\\n|;|\\})", - "endCaptures": { - "1": { - "name": "punctuation.terminator.rule.css" - } - }, - "name": "meta.property-value.css", - "patterns": [ - { - "include": "#property_values" - }, - { - "match": "[^\\n]+?" - } - ] - }, - "property_values": { - "patterns": [ - { - "include": "#function" - }, - { - "include": "#comment" - }, - { - "include": "#language_keywords" - }, - { - "include": "#language_constants" - }, - { - "match": "(?:(?=\\w)(?|(?:=|:|\\?|\\+|-|\\*|\\/|%|<|>)?=|!=)|\\b(?:in|is(?:nt)?|(?/'\"]|/(?!>))+", - "name": "string.unquoted.html" - }, - "string-single-quoted": { - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "patterns": [ - { - "include": "#vue-interpolations" - }, - { - "include": "#entities" - } - ], - "begin": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "end": "'", - "name": "string.quoted.single.html" - }, - "string-double-quoted": { - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "patterns": [ - { - "include": "#vue-interpolations" - }, - { - "include": "#entities" - } - ], - "begin": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "end": "\"", - "name": "string.quoted.double.html" - }, - "vue-interpolations": { - "patterns": [ - { - "beginCaptures": { - "0": { - "name": "punctuation.definition.generic.begin.html" - } - }, - "patterns": [ - { - "include": "source.js#expression" - } - ], - "begin": "\\{\\{\\{?", - "endCaptures": { - "0": { - "name": "punctuation.definition.generic.end.html" - } - }, - "end": "\\}\\}\\}?", - "name": "expression.embedded.vue" - } - ] - }, - "vue-directives": { - "captures": { - "1": { - "name": "entity.other.attribute-name.html" - }, - "7": { - "name": "punctuation.separator.key-value.html" - } - }, - "begin": "((?:\\b(v-)|(:|@))([a-zA-Z0-9\\-_]+)(?:\\:([a-zA-Z0-9\\-_]+))?(?:\\.([a-zA-Z0-9\\-_]+))*)\\s*(=)", - "end": "(?<='|\")|(?=[\\s<>`])", - "name": "meta.directive.vue", - "patterns": [ - { - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "patterns": [ - { - "include": "source.js#expression" - } - ], - "begin": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "end": "\"", - "name": "source.directive.vue" - }, - { - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "patterns": [ - { - "include": "source.js#expression" - } - ], - "begin": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "end": "'", - "name": "source.directive.vue" - } - ] - }, - "tag-generic-attribute": { - "match": "(?<=[^=])\\b([a-zA-Z0-9:\\-_]+)", - "name": "entity.other.attribute-name.html" - }, - "tag-id-attribute": { - "captures": { - "2": { - "name": "punctuation.separator.key-value.html" - }, - "1": { - "name": "entity.other.attribute-name.id.html" - } - }, - "begin": "\\b(id)\\b\\s*(=)", - "end": "(?!\\G)(?<='|\"|[^\\s<>/])", - "name": "meta.attribute-with-value.id.html", - "patterns": [ - { - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "patterns": [ - { - "include": "#vue-interpolations" - }, - { - "include": "#entities" - } - ], - "begin": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "end": "\"", - "name": "string.quoted.double.html", - "contentName": "meta.toc-list.id.html" - }, - { - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.html" - } - }, - "patterns": [ - { - "include": "#vue-interpolations" - }, - { - "include": "#entities" - } - ], - "begin": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.html" - } - }, - "end": "'", - "name": "string.quoted.single.html", - "contentName": "meta.toc-list.id.html" - }, - { - "captures": { - "0": { - "name": "meta.toc-list.id.html" - } - }, - "match": "(?<==)(?:[^\\s<>/'\"]|/(?!>))+", - "name": "string.unquoted.html" - } - ] - }, - "tag-stuff": { - "patterns": [ - { - "include": "#vue-directives" - }, - { - "include": "#tag-id-attribute" - }, - { - "include": "#tag-generic-attribute" - }, - { - "include": "#string-double-quoted" - }, - { - "include": "#string-single-quoted" - }, - { - "include": "#unquoted-attribute" - } - ] - } - }, - "patterns": [ - { - "include": "#vue-interpolations" - }, - { - "beginCaptures": { - "2": { - "name": "entity.name.tag.html" - }, - "1": { - "name": "punctuation.definition.tag.begin.html" - } - }, - "patterns": [ - { - "include": "#tag-stuff" - } - ], - "begin": "(<)([a-zA-Z0-9:-]++)(?=[^>]*>)", - "endCaptures": { - "2": { - "name": "punctuation.definition.tag.begin.html meta.scope.between-tag-pair.html" - }, - "3": { - "name": "punctuation.definition.tag.begin.html" - }, - "1": { - "name": "punctuation.definition.tag.end.html" - }, - "4": { - "name": "entity.name.tag.html" - }, - "5": { - "name": "punctuation.definition.tag.end.html" - } - }, - "end": "(>)(<)(/)(\\2)(>)", - "name": "meta.tag.any.html" - }, - { - "captures": { - "2": { - "name": "entity.name.tag.xml.html" - }, - "1": { - "name": "punctuation.definition.tag.html" - } - }, - "begin": "(<\\?)(xml)", - "end": "(\\?>)", - "name": "meta.tag.preprocessor.xml.html", - "patterns": [ - { - "include": "#tag-generic-attribute" - }, - { - "include": "#string-double-quoted" - }, - { - "include": "#string-single-quoted" - } - ] - }, - { - "captures": { - "0": { - "name": "punctuation.definition.comment.html" - } - }, - "begin": "", - "endCaptures": { - "0": { - "name": "punctuation.definition.comment.cs" - } - } - } - } -} \ No newline at end of file diff --git a/lib/shiki-languages/data/grammars/cshtml.json b/lib/shiki-languages/data/grammars/cshtml.json deleted file mode 100644 index 402915e8..00000000 --- a/lib/shiki-languages/data/grammars/cshtml.json +++ /dev/null @@ -1,153 +0,0 @@ -{ - "name": "ASP.NET Razor", - "scopeName": "text.html.cshtml", - "fileTypes": [ - "cshtml", - "gohtml" - ], - "patterns": [ - { - "name": "section.embedded.source.cshtml", - "begin": "(@?([a-zA-Z0-9]+)?)(\\s[a-zA-Z0-9]+)?(\n|\r)?(\\{)", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.cshtml" - }, - "1": { - "name": "keyword.control.cshtml" - } - }, - "patterns": [ - { - "name": "section.embedded.source.cshtml", - "begin": "(@?([a-zA-Z0-9]+)?)(\\s[a-zA-Z0-9]+)?(\n|\r)?(\\{)", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.cshtml" - }, - "1": { - "name": "keyword.control.cshtml" - } - }, - "patterns": [ - { - "name": "string.quoted.single.cshtml", - "match": "'" - }, - { - "include": "#embedded-code" - }, - { - "include": "#comments" - }, - { - "include": "source.cs" - }, - { - "include": "text.html.basic" - } - ], - "end": "\\}", - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.cshtml" - } - } - }, - { - "name": "string.quoted.single.cshtml", - "match": "'" - }, - { - "include": "#embedded-code" - }, - { - "include": "#comments" - }, - { - "include": "text.html.basic" - } - ], - "end": "\\}", - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.cshtml" - } - }, - "comments": "Simple multi-line code section" - }, - { - "begin": "(@[a-zA-Z0-9]+)(\\s?)", - "captures": { - "0": { - "name": "section.embedded.begin.cshtml" - }, - "1": { - "name": "keyword.control.cshtml" - } - }, - "patterns": [ - { - "match": "(([a-zA-Z0-9]+)(\\.)?)+?", - "captures": { - "2": { - "name": "entity.name.tag.source.cshtml" - }, - "3": { - "name": "punctuation.separator.namespace.source.cshtml" - } - } - }, - { - "include": "#embedded-code" - }, - { - "include": "#comments" - }, - { - "include": "source.cs" - }, - { - "include": "text.html.basic" - } - ], - "end": "(\\n|\\s)", - "comments": "Covers single line Razor tags" - }, - { - "include": "#comments" - }, - { - "include": "text.html.basic" - } - ], - "repository": { - "embedded-code": { - "match": "(@?[a-zA-Z0-9]+)(\\.([a-zA-Z0-9]+))?", - "captures": { - "1": { - "name": "keyword.control.cshtml" - }, - "3": { - "name": "entity.name.tag.source.cshtml" - } - }, - "patterns": [ - { - "include": "#comments" - } - ] - }, - "comments": { - "begin": "@\\*", - "captures": { - "0": { - "name": "punctuation.definition.comment.source.cshtml" - } - }, - "end": "\\*@", - "name": "comment.block.cshtml" - } - }, - "version": "https://github.com/demyte/language-cshtml/commit/a49735dc7aef56ae772a3bcfd8e42c89895dcff4" -} \ No newline at end of file diff --git a/lib/shiki-languages/data/grammars/css.plist b/lib/shiki-languages/data/grammars/css.plist deleted file mode 100644 index afff4c63..00000000 --- a/lib/shiki-languages/data/grammars/css.plist +++ /dev/null @@ -1,1184 +0,0 @@ - - - - - fileTypes - - css - css.erb - - keyEquivalent - ^~C - name - CSS - patterns - - - include - #comment-block - - - include - #selector - - - begin - \s*((@)charset\b)\s* - captures - - 1 - - name - keyword.control.at-rule.charset.css - - 2 - - name - punctuation.definition.keyword.css - - - end - \s*((?=;|$)) - name - meta.at-rule.charset.css - patterns - - - include - #string-double - - - include - #string-single - - - - - begin - \s*((@)import\b)\s* - captures - - 1 - - name - keyword.control.at-rule.import.css - - 2 - - name - punctuation.definition.keyword.css - - - end - \s*((?=;|\})) - name - meta.at-rule.import.css - patterns - - - include - #string-double - - - include - #string-single - - - begin - \s*(url)\s*(\()\s* - beginCaptures - - 1 - - name - support.function.url.css - - 2 - - name - punctuation.section.function.css - - - end - \s*(\))\s* - endCaptures - - 1 - - name - punctuation.section.function.css - - - patterns - - - match - [^'") \t]+ - name - variable.parameter.url.css - - - include - #string-single - - - include - #string-double - - - - - include - #media-query-list - - - - - begin - ^\s*((@)font-face)\s*(?=\{) - beginCaptures - - 1 - - name - keyword.control.at-rule.font-face.css - - 2 - - name - punctuation.definition.keyword.css - - - end - (?!\G) - name - meta.at-rule.font-face.css - patterns - - - include - #rule-list - - - - - begin - (?=^\s*@media\s*.*?\{) - end - \s*(\}) - endCaptures - - 1 - - name - punctuation.section.property-list.end.css - - - patterns - - - begin - ^\s*((@)media)(?=.*?\{) - beginCaptures - - 1 - - name - keyword.control.at-rule.media.css - - 2 - - name - punctuation.definition.keyword.css - - 3 - - name - support.constant.media.css - - - end - \s*(?=\{) - name - meta.at-rule.media.css - patterns - - - include - #media-query-list - - - - - begin - \s*(\{) - beginCaptures - - 1 - - name - punctuation.section.property-list.begin.css - - - end - (?=\}) - patterns - - - include - $self - - - - - - - begin - ^\s*((@)(-(o|ms)-)?viewport)\s*(?=\{) - beginCaptures - - 1 - - name - keyword.control.at-rule.viewport.css - - 2 - - name - punctuation.definition.keyword.css - - - end - (?!\G) - name - meta.at-rule.viewport.css - patterns - - - include - #rule-list - - - - - begin - (?=\{) - end - (?!\G) - patterns - - - include - #rule-list - - - - - repository - - color-values - - patterns - - - comment - Basic color keywords: http://www.w3.org/TR/css3-color/#html4 - match - \b(aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow)\b - name - support.constant.color.w3c-standard-color-name.css - - - comment - Extended color keywords: http://www.w3.org/TR/css3-color/#svg-color - match - \b(aliceblue|antiquewhite|aquamarine|azure|beige|bisque|blanchedalmond|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|gainsboro|ghostwhite|gold|goldenrod|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|limegreen|linen|magenta|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|oldlace|olivedrab|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|rebeccapurple|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|thistle|tomato|turquoise|violet|wheat|whitesmoke|yellowgreen)\b - name - support.constant.color.w3c-extended-color-name.css - - - begin - (hsla?|rgba?)\s*(\() - beginCaptures - - 1 - - name - support.function.misc.css - - 2 - - name - punctuation.section.function.css - - - end - (\)) - endCaptures - - 1 - - name - punctuation.section.function.css - - - patterns - - - match - (?x)\b - (0*((1?[0-9]{1,2})|(2([0-4][0-9]|5[0-5])))\s*,\s*){2} - (0*((1?[0-9]{1,2})|(2([0-4][0-9]|5[0-5])))\b) - (\s*,\s*((0?\.[0-9]+)|[0-1]))? - - name - constant.other.color.rgb-value.css - - - match - \b([0-9]{1,2}|100)\s*%,\s*([0-9]{1,2}|100)\s*%,\s*([0-9]{1,2}|100)\s*% - name - constant.other.color.rgb-percentage.css - - - include - #numeric-values - - - - - - comment-block - - begin - /\* - captures - - 0 - - name - punctuation.definition.comment.css - - - end - \*/ - name - comment.block.css - - media-query - - begin - (?i)\s*(only|not)?\s*(all|aural|braille|embossed|handheld|print|projection|screen|speech|tty|tv)? - beginCaptures - - 1 - - name - keyword.operator.logic.media.css - - 2 - - name - support.constant.media.css - - - end - \s*(?:(,)|(?=[{;])) - endCaptures - - 1 - - name - punctuation.definition.arbitrary-repitition.css - - - patterns - - - begin - \s*(and)?\s*(\()\s* - beginCaptures - - 1 - - name - keyword.operator.logic.media.css - - - end - \) - patterns - - - begin - (?x) - ( - ((min|max)-)? - ( - ((device-)?(height|width|aspect-ratio))| - (color(-index)?)|monochrome|resolution - ) - )|grid|scan|orientation|((any-)?(pointer|hover)) - \s*(?=[:)]) - beginCaptures - - 0 - - name - support.type.property-name.media.css - - - end - (:)|(?=\)) - endCaptures - - 1 - - name - punctuation.separator.key-value.css - - - - - match - \b(portrait|landscape|progressive|interlace|none|coarse|fine|on-demand|hover) - name - support.constant.property-value.css - - - captures - - 1 - - name - constant.numeric.css - - 2 - - name - keyword.operator.arithmetic.css - - 3 - - name - constant.numeric.css - - - match - \s*(\d+)(/)(\d+) - - - include - #numeric-values - - - - - - media-query-list - - begin - \s*(?=[^{;]) - end - \s*(?=[{;]) - patterns - - - include - #media-query - - - - numeric-values - - patterns - - - captures - - 1 - - name - punctuation.definition.constant.css - - - match - (#)([0-9a-fA-F]{3}|[0-9a-fA-F]{6})\b - name - constant.other.color.rgb-value.css - - - captures - - 1 - - name - keyword.other.unit.css - - - match - (?x) - (?:-|\+)?(?:(?:[0-9]+(?:\.[0-9]+)?)|(?:\.[0-9]+)) - ((?:px|pt|ch|cm|mm|in|r?em|ex|pc|vw|vh|vmin|vmax|deg|g?rad|turn|dpi|dpcm|dppx|fr|s|ms|Hz|kHz)\b|%)? - - name - constant.numeric.css - - - - property-values - - patterns - - - match - \b(absolute|add|additive|all(-scroll)?|allow-end|alpha|alphabetic|alternate(-reverse)?|always|any|armenian|auto|avoid(-(column|flex|line|page|region))?|backwards|balance(-all)?|bar|baseline|below|bengali|bevel|bidi-override|block(-(end|start))?|bold|bolder|border-box|both|bottom|box-decoration|break-(all|word)|bullets|cambodian|capitalize|center|central|char|circle|cjk-(decimal|earthly-branch|heavenly-stem|ideographic)|clear|clip|clone|coarse|col-resize|collapse|color(-(burn|dodge))?|column(-reverse)?|contain|content(-box)?|contents|cover|create|crisp-edges|currentcolor|cyclic|darken|densedashed|decimal-leading-zero|decimal|default|dense|devanagari|difference|digits|disabled|disc|disclosure-(closed|open)|display|distribute-all-lines|distribute(-(letter|space))?|dot|dotted|double(-circle)?|e-resize|each-line|ease(-(in(-out)?|out))?|economy|edges|ellipsis|embed|end|ethiopic-numeric|evenodd|exact|exclude|exclusion|extends|fade|fill(-(available|box))?|filled|first(-baseline)?|fit-content|fixed|flex(-(end|start))?|flow(-root)?|force-end|forwards|fragments|from-image|full-width|geometricPrecision|georgian|grid|groove|gujarati|gurmukhi|hand|hanging|hard-light|hebrew|help|hidden|hiragana(-iroha)?|horizontal(-tb)?|hue|ideograph-(alpha|numeric|parenthesis|space)|ideographic|inactive|infinite|inherit|initial|ink|inline(-(block|end|flex|grid|list-item|start|table))?|inset|inside|inter-(character|ideograph|word)|intersect|invalid|invert|isolate(-override)?|italic|japanese-(formal|informal)|justify(-all)?|katakana(-iroha)?|keep-all|khmer|korean-(hangul-formal|hanja-(formal|informal))|landscape|lao|last(-baseline)?|leading-spaces|left|legacy|lighter|line(-(edge|through))?|list-(container|item)|local|logical|loose|lower-(alpha|armenian|greek|latin|roman)|lowercase|lr-tb|ltr|luminance|luminosity|malayalam|mandatory|manipulation|manual|margin-box|marker|match-parent|mathematical|max-content|maximum|medium|middle|minimum|mixed|mongolian|move|multiply|myanmar|n-resize|ne-resize|newspaper|no-(clip|close-quote|composite|compress|drop|open-quote|repeat)|non-blocking|none|nonzero|normal|notch|not-allowed|nowrap|numbers|numeric|nw-resize|objects|oblique|open(-quote)?|oriya|optimize(Legibility|Quality|Speed)|outset|outside(-shape)?|overlay|overline|padding-box|page|paginate|paint|pan-(x|y)|paused|persian|physical|pixelated|plaintext|pointer|portrait|pre(-(line|wrap(-auto)?))?|preserve(-(auto|breaks|spaces|trim))?|progress|proximity|punctuation|region|relative|repeat(-(x|y))?|reverse|revert|ridge|right|rotate|row(-reverse)?|row-resize|rtl|ruby(-((base|text)(-container)?))?|run-in|running|s-resize|saturation|scale-down|scroll(-position)?|se-resize|self-(end|start)|separate|sesame|show|sideways(-(left|lr|right|rl))?|simp-chinese-(formal|informal)|slice|small-caps|smooth|snap(-(block|inline))?|soft-light|solid|space(-(adjacent|around|between|end|evenly|start))?|spaces|spell-out|spread|square|start|static|step-(end|start)|sticky|stretch|strict|stroke-box|sub|subgrid|subtract|super|sw-resize|symbolic|table(-(caption|cell|(column|row)(-group)?|footer-group|header-group))?|tamil|tb-rl|telugu|text(-(bottom|top))?|thai|thick|thin|tibetan|top|transparent|triangle|trim-(adjacent|end|inner|start)|true|under|underline|underscore|unsafe|unset|upper-(alpha|latin|roman)|uppercase|upright|use-glyph-orientation|vertical(-(ideographic|lr|rl|text))?|view-box|visible(Painted|Fill|Stroke)?|w-resize|wait|whitespace|words|wrap|zero|smaller|larger|((xx?-)?(small|large))|painted|fill|stroke)\b - name - support.constant.property-value.css - - - match - (\b(?i:arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace)\b) - name - support.constant.font-name.css - - - include - #numeric-values - - - include - #color-values - - - include - #string-double - - - include - #string-single - - - begin - (blur|drop-shadow|perspective|rect|translate(3d|X|Y|Z)?)\s*(\() - beginCaptures - - 1 - - name - support.function.misc.css - - 2 - - name - punctuation.section.function.css - - - end - (\)) - endCaptures - - 1 - - name - punctuation.section.function.css - - - patterns - - - include - #numeric-values - - - - - begin - (cubic-bezier|matrix(3d)?|scale(3d|X|Y|Z)?)\s*(\() - beginCaptures - - 1 - - name - support.function.misc.css - - 2 - - name - punctuation.section.function.css - - - end - (\)) - endCaptures - - 1 - - name - punctuation.section.function.css - - - patterns - - - match - (?:-|\+)?(?:(?:[0-9]+(?:\.[0-9]+)?)|(?:\.[0-9]+)) - name - constant.numeric.css - - - - - begin - ((hue-)?rotate|skew(X|Y|Z)?)\s*(\() - beginCaptures - - 1 - - name - support.function.misc.css - - 2 - - name - punctuation.section.function.css - - - end - (\)) - endCaptures - - 1 - - name - punctuation.section.function.css - - - patterns - - - match - (?x) - (?:-|\+)?(?:(?:[0-9]+(?:\.[0-9]+)?)|(?:\.[0-9]+)) - ((?:deg|g?rad|turn)\b) - - name - constant.numeric.css - - - - - begin - (brightness|contrast|grayscale|invert|opacity|saturate|sepia)\s*(\() - beginCaptures - - 1 - - name - support.function.misc.css - - 2 - - name - punctuation.section.function.css - - - end - (\)) - endCaptures - - 1 - - name - punctuation.section.function.css - - - patterns - - - match - (?x) - (?:-|\+)?(?:(?:[0-9]+(?:\.[0-9]+)?)|(?:\.[0-9]+)) - (%)? - - name - constant.numeric.css - - - - - begin - (format|local|url|attr|counter|counters)\s*(\() - beginCaptures - - 1 - - name - support.function.misc.css - - 2 - - name - punctuation.section.function.css - - - end - (\)) - endCaptures - - 1 - - name - punctuation.section.function.css - - - patterns - - - include - #string-single - - - include - #string-double - - - match - [^'") \t]+ - name - variable.parameter.misc.css - - - - - begin - (var)\s*(\() - beginCaptures - - 1 - - name - support.function.misc.css - - 2 - - name - punctuation.section.function.css - - - end - (\)) - endCaptures - - 1 - - name - punctuation.section.function.css - - - patterns - - - include - #variable-name - - - - - match - \!\s*important - name - keyword.other.important.css - - - - rule-list - - begin - \{ - beginCaptures - - 0 - - name - punctuation.section.property-list.begin.css - - - end - \} - endCaptures - - 0 - - name - punctuation.section.property-list.end.css - - - name - meta.property-list.css - patterns - - - include - #comment-block - - - begin - (?<![-a-z])(?=[-a-z]) - end - $|(?![-a-z]) - name - meta.property-name.css - patterns - - - include - #variable-name - - - match - (-(webkit|moz|o|ms|khtml)-)?(zoom|z-index|y|x|writing-mode|wrap|wrap-through|wrap-inside|wrap-flow|wrap-before|wrap-after|word-wrap|word-spacing|word-break|word|will-change|width|widows|white-space-collapse|white-space|white|weight|volume|voice-volume|voice-stress|voice-rate|voice-pitch-range|voice-pitch|voice-family|voice-duration|voice-balance|voice|visibility|vertical-align|vector-effect|variant|user-zoom|user-select|up|unicode-(bidi|range)|trim|translate|transition-timing-function|transition-property|transition-duration|transition-delay|transition|transform-style|transform-origin|transform-box|transform|touch-action|top-width|top-style|top-right-radius|top-left-radius|top-color|top|timing-function|text-wrap|text-underline-position|text-transform|text-spacing|text-space-trim|text-space-collapse|text-size-adjust|text-shadow|text-replace|text-rendering|text-overflow|text-outline|text-orientation|text-justify|text-indent|text-height|text-emphasis-style|text-emphasis-skip|text-emphasis-position|text-emphasis-color|text-emphasis|text-decoration-style|text-decoration-stroke|text-decoration-skip|text-decoration-line|text-decoration-fill|text-decoration-color|text-decoration|text-combine-upright|text-anchor|text-align-last|text-align-all|text-align|text|target-position|target-new|target-name|target|table-layout|tab-size|system|symbols|suffix|style-type|style-position|style-image|style|stroke-width|stroke-opacity|stroke-miterlimit|stroke-linejoin|stroke-linecap|stroke-dashoffset|stroke-dasharray|stroke|string-set|stretch|stress|stop-opacity|stop-color|stacking-strategy|stacking-shift|stacking-ruby|stacking|src|speed|speech-rate|speech|speak-punctuation|speak-numeral|speak-header|speak-as|speak|span|spacing|space-collapse|space|solid-opacity|solid-color|sizing|size-adjust|size|shape-rendering|shape-padding|shape-outside|shape-margin|shape-inside|shape-image-threshold|shadow|scroll-snap-type|scroll-snap-points-y|scroll-snap-points-x|scroll-snap-destination|scroll-snap-coordinate|scroll-behavior|scale|ry|rx|respond-to|rule-width|rule-style|rule-color|rule|ruby-span|ruby-position|ruby-overhang|ruby-merge|ruby-align|ruby|rows|rotation-point|rotation|rotate|role|right-width|right-style|right-color|right|richness|rest-before|rest-after|rest|resource|resolution|resize|reset|replace|repeat|rendering-intent|region-fragment|rate|range|radius|r|quotes|punctuation-trim|punctuation|property|profile|presentation-level|presentation|prefix|position|pointer-events|point|play-state|play-during|play-count|pitch-range|pitch|phonemes|perspective-origin|perspective|pause-before|pause-after|pause|page-policy|page-break-inside|page-break-before|page-break-after|page|padding-top|padding-right|padding-left|padding-inline-start|padding-inline-end|padding-bottom|padding-block-start|padding-block-end|padding|pad|pack|overhang|overflow-y|overflow-x|overflow-wrap|overflow-style|overflow-inline|overflow-block|overflow|outline-width|outline-style|outline-offset|outline-color|outline|orphans|origin|orientation|orient|ordinal-group|order|opacity|offset-start|offset-inline-start|offset-inline-end|offset-end|offset-block-start|offset-block-end|offset-before|offset-after|offset|object-position|object-fit|numeral|new|negative|nav-up|nav-right|nav-left|nav-index|nav-down|nav|name|move-to|motion-rotation|motion-path|motion-offset|motion|model|mix-blend-mode|min-zoom|min-width|min-inline-size|min-height|min-block-size|min|max-zoom|max-width|max-lines|max-inline-size|max-height|max-block-size|max|mask-type|mask-size|mask-repeat|mask-position|mask-origin|mask-mode|mask-image|mask-composite|mask-clip|mask-border-width|mask-border-source|mask-border-slice|mask-border-repeat|mask-border-outset|mask-border-mode|mask-border|mask|marquee-style|marquee-speed|marquee-play-count|marquee-loop|marquee-direction|marquee|marks|marker-start|marker-side|marker-mid|marker-end|marker|margin-top|margin-right|margin-left|margin-inline-start|margin-inline-end|margin-bottom|margin-block-start|margin-block-end|margin|list-style-type|list-style-position|list-style-image|list-style|list|lines|line-stacking-strategy|line-stacking-shift|line-stacking-ruby|line-stacking|line-snap|line-height|line-grid|line-break|line|lighting-color|level|letter-spacing|length|left-width|left-style|left-color|left|label|kerning|justify-self|justify-items|justify-content|justify|iteration-count|isolation|inline-size|inline-box-align|initial-value|initial-size|initial-letter-wrap|initial-letter-align|initial-letter|initial-before-align|initial-before-adjust|initial-after-align|initial-after-adjust|index|indent|increment|image-rendering|image-resolution|image-orientation|image|icon|hyphens|hyphenate-limit-zone|hyphenate-limit-lines|hyphenate-limit-last|hyphenate-limit-chars|hyphenate-character|hyphenate|height|header|hanging-punctuation|grid-template-rows|grid-template-columns|grid-template-areas|grid-template|grid-row-start|grid-row-gap|grid-row-end|grid-row|grid-rows|grid-gap|grid-column-start|grid-column-gap|grid-column-end|grid-column|grid-columns|grid-auto-rows|grid-auto-flow|grid-auto-columns|grid-area|grid|glyph-orientation-vertical|glyph-orientation-horizontal|gap|font-weight|font-variant-position|font-variant-numeric|font-variant-ligatures|font-variant-east-asian|font-variant-caps|font-variant-alternates|font-variant|font-synthesis|font-style|font-stretch|font-size-adjust|font-size|font-language-override|font-kerning|font-feature-settings|font-family|font|flow-into|flow-from|flow|flood-opacity|flood-color|float-offset|float|flex-wrap|flex-shrink|flex-grow|flex-group|flex-flow|flex-direction|flex-basis|flex|fit-position|fit|filter|fill-rule|fill-opacity|fill|family|fallback|enable-background|empty-cells|emphasis|elevation|duration|drop-initial-value|drop-initial-size|drop-initial-before-align|drop-initial-before-adjust|drop-initial-after-align|drop-initial-after-adjust|drop|down|dominant-baseline|display-role|display-model|display|direction|delay|decoration-break|decoration|cy|cx|cursor|cue-before|cue-after|cue|crop|counter-set|counter-reset|counter-increment|counter|count|corner-shape|corners|continue|content|contain|columns|column-width|column-span|column-rule-width|column-rule-style|column-rule-color|column-rule|column-gap|column-fill|column-count|column-break-before|column-break-after|column|color-rendering|color-profile|color-interpolation-filters|color-interpolation|color-adjust|color|collapse|clip-rule|clip-path|clip|clear|character|caret-shape|caret-color|caret|caption-side|buffered-rendering|break-inside|break-before|break-after|break|box-suppress|box-snap|box-sizing|box-shadow|box-pack|box-orient|box-ordinal-group|box-lines|box-flex-group|box-flex|box-direction|box-decoration-break|box-align|box|bottom-width|bottom-style|bottom-right-radius|bottom-left-radius|bottom-color|bottom|border-width|border-top-width|border-top-style|border-top-right-radius|border-top-left-radius|border-top-color|border-top|border-style|border-spacing|border-right-width|border-right-style|border-right-color|border-right|border-radius|border-limit|border-length|border-left-width|border-left-style|border-left-color|border-left|border-inline-start-width|border-inline-start-style|border-inline-start-color|border-inline-start|border-inline-end-width|border-inline-end-style|border-inline-end-color|border-inline-end|border-image-width|border-image-transform|border-image-source|border-image-slice|border-image-repeat|border-image-outset|border-image|border-color|border-collapse|border-clip-top|border-clip-right|border-clip-left|border-clip-bottom|border-clip|border-bottom-width|border-bottom-style|border-bottom-right-radius|border-bottom-left-radius|border-bottom-color|border-bottom|border-block-start-width|border-block-start-style|border-block-start-color|border-block-start|border-block-end-width|border-block-end-style|border-block-end-color|border-block-end|border|bookmark-target|bookmark-level|bookmark-label|bookmark|block-size|binding|bidi|before|baseline-shift|baseline|balance|background-size|background-repeat|background-position-y|background-position-x|background-position-inline|background-position-block|background-position|background-origin|background-image|background-color|background-clip|background-blend-mode|background-attachment|background|backface-visibility|backdrop-filter|azimuth|attachment|appearance|animation-timing-function|animation-play-state|animation-name|animation-iteration-count|animation-fill-mode|animation-duration|animation-direction|animation-delay|animation|alt|all|alignment-baseline|alignment-adjust|alignment|align-last|align-self|align-items|align-content|align|after|adjust|additive-symbols) - name - support.type.property-name.css - - - - - begin - (:)\s* - beginCaptures - - 1 - - name - punctuation.separator.key-value.css - - - end - \s*(;|(?=\})) - endCaptures - - 1 - - name - punctuation.terminator.rule.css - - - name - meta.property-value.css - patterns - - - include - #property-values - - - - - - selector - - begin - \s*(?=[:.*#a-zA-Z]) - end - (?=[/@{)]) - name - meta.selector.css - patterns - - - match - \b(a|abbr|address|area|article|aside|audio|b|base|bdi|bdo|blockquote|body|br|button|canvas|caption|cite|code|col|colgroup|data|datalist|dd|del|details|dfn|dialog|div|dl|dt|em|embed|fieldset|figcaption|figure|footer|form|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|input|ins|kbd|label|legend|li|link|main|map|mark|menu|menuitem|meta|meter|nav|noscript|object|ol|optgroup|option|output|p|param|picture|pre|progress|q|rb|rp|rt|rtc|ruby|s|samp|script|section|select|small|source|span|strong|style|sub|summary|sup|svg|table|tbody|td|template|textarea|tfoot|th|thead|time|title|tr|track|u|ul|var|video|wbr)\b - name - entity.name.tag.css - - - captures - - 1 - - name - punctuation.definition.entity.css - - - match - (\.)[a-zA-Z0-9_-]+ - name - entity.other.attribute-name.class.css - - - captures - - 1 - - name - punctuation.definition.entity.css - - - match - (#)[a-zA-Z][a-zA-Z0-9_-]* - name - entity.other.attribute-name.id.css - - - match - \* - name - entity.name.tag.wildcard.css - - - captures - - 1 - - name - punctuation.definition.entity.css - - - match - (:+)(after|backdrop|before|first-letter|first-line|placeholder|selection)\b - name - entity.other.attribute-name.pseudo-element.css - - - captures - - 1 - - name - punctuation.definition.entity.css - - - match - (:)((first|last)-child|(first|last|only)-of-type|empty|root|target|fullscreen|first|left|right|scope)\b - name - entity.other.attribute-name.pseudo-class.css - - - captures - - 1 - - name - punctuation.definition.entity.css - - - match - (:)(checked|enabled|default|disabled|indeterminate|in-range|invalid|optional|out-of-range|read-only|read-write|required|valid)\b - name - entity.other.attribute-name.pseudo-class.ui-state.css - - - begin - ((:)not)(\() - beginCaptures - - 1 - - name - entity.other.attribute-name.pseudo-class.css - - 2 - - name - punctuation.definition.entity.css - - 3 - - name - punctuation.section.function.css - - - end - \) - endCaptures - - 0 - - name - punctuation.section.function.css - - - patterns - - - include - #selector - - - - - captures - - 1 - - name - entity.other.attribute-name.pseudo-class.css - - 2 - - name - punctuation.definition.entity.css - - 3 - - name - punctuation.section.function.css - - 4 - - name - constant.numeric.css - - 5 - - name - punctuation.section.function.css - - - match - ((:)nth-(?:(?:last-)?child|(?:last-)?of-type))(\()(\-?(?:\d+n?|n)(?:\+\d+)?|even|odd)(\)) - - - captures - - 1 - - name - punctuation.definition.entity.css - - - match - (:)(active|hover|(any-)?link|visited|focus)\b - name - entity.other.attribute-name.pseudo-class.css - - - captures - - 1 - - name - punctuation.definition.entity.css - - 2 - - name - entity.other.attribute-name.attribute.css - - 3 - - name - punctuation.separator.operator.css - - 4 - - name - string.unquoted.attribute-value.css - - 5 - - name - string.quoted.double.attribute-value.css - - 6 - - name - punctuation.definition.string.begin.css - - 7 - - name - punctuation.definition.string.end.css - - - match - (?i)(\[)\s*(-?[_a-z\\[[:^ascii:]]][_a-z0-9\-\\[[:^ascii:]]]*)(?:\s*([~|^$*]?=)\s*(?:(-?[_a-z\\[[:^ascii:]]][_a-z0-9\-\\[[:^ascii:]]]*)|((?>(['"])(?:[^\\]|\\.)*?(\6)))))?\s*(\]) - name - meta.attribute-selector.css - - - - string-double - - 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 - \\. - name - constant.character.escape.css - - - - string-single - - 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 - - - - variable-name - - match - \-\-[^:\),]+ - name - support.type.property-name.variable.css - - - scopeName - source.css - uuid - 69AA0917-B7BB-11D9-A7E2-000D93C8BE28 - - - diff --git a/lib/shiki-languages/data/grammars/diff.tmLanguage b/lib/shiki-languages/data/grammars/diff.tmLanguage deleted file mode 100644 index d0c5d154..00000000 --- a/lib/shiki-languages/data/grammars/diff.tmLanguage +++ /dev/null @@ -1,268 +0,0 @@ - - - - - fileTypes - - patch - diff - rej - - firstLineMatch - (?x)^ - (===\ modified\ file - |==== \s* // .+ \s - \s .+ \s+ ==== - |Index:\ - |---\ [^%\n] - |\*\*\*.*\d{4}\s*$ - |\d+(,\d+)* (a|d|c) \d+(,\d+)* $ - |diff\ --git\ - |commit\ [0-9a-f]{40}$ - ) - keyEquivalent - ^~D - 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.line-number.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.inserted.diff - - - match - ^(!).*$\n? - name - markup.changed.diff - - - captures - - 3 - - name - punctuation.definition.inserted.diff - - 6 - - name - punctuation.definition.inserted.diff - - - match - ^(((<)( .*)?)|((-).*))$\n? - name - markup.deleted.diff - - - begin - ^(#) - captures - - 1 - - name - punctuation.definition.comment.diff - - - comment - Git produces unified diffs with embedded comments" - end - \n - name - comment.line.number-sign.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 - uuid - 7E848FF4-708E-11D9-97B4-0011242E4184 - - diff --git a/lib/shiki-languages/data/grammars/fsharp.json b/lib/shiki-languages/data/grammars/fsharp.json deleted file mode 100644 index f65bba13..00000000 --- a/lib/shiki-languages/data/grammars/fsharp.json +++ /dev/null @@ -1,533 +0,0 @@ -{ - "name": "F#", - "scopeName": "source.fsharp", - "fileTypes": [ - "fs" - ], - "foldingStartMarker": "", - "foldingStopMarker": "", - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#constants" - }, - { - "include": "#structure" - }, - { - "include": "#attributes" - }, - { - "include": "#strings" - }, - { - "include": "#chars" - }, - { - "include": "#double_tick" - }, - { - "include": "#definition" - }, - { - "include": "#method_calls" - }, - { - "include": "#modules" - }, - { - "include": "#anonymous_functions" - }, - { - "include": "#keywords" - }, - { - "include": "#records" - }, - { - "include": "#cexprs" - }, - { - "include": "#text" - } - ], - "repository": { - "anonymous_functions": { - "patterns": [ - { - "name": "meta.function.anonymous", - "begin": "\\b(fun)\\b", - "end": "(->)", - "beginCaptures": { - "1": { - "name": "keyword.other.function-definition.fsharp" - } - }, - "endCaptures": { - "1": { - "name": "keyword.other.fsharp" - } - }, - "patterns": [ - { - "include": "#variables" - } - ] - } - ] - }, - "attributes": { - "patterns": [ - { - "name": "support.function.attribute.fsharp", - "begin": "\\[\\<", - "end": "\\>\\]", - "patterns": [ - { - "include": "$self" - } - ] - } - ] - }, - "comments": { - "patterns": [ - { - "name": "comment.block.fsharp", - "begin": "(\\(\\*(?!\\)))", - "end": "(\\*\\))", - "beginCaptures": { - "1": { - "name": "comment.block.fsharp" - } - }, - "endCaptures": { - "1": { - "name": "comment.block.fsharp" - } - } - - }, - { - "name": "comment.line.double-slash.fsharp", - "match": "//.*$" - } - ] - }, - "constants": { - "patterns": [ - { - "name": "constant.language.unit.fsharp", - "match": "\\(\\)" - }, - { - "name": "constant.numeric.floating-point.fsharp", - "match": "\\b-?[0-9][0-9_]*((\\.([0-9][0-9_]*([eE][+-]??[0-9][0-9_]*)?)?)|([eE][+-]??[0-9][0-9_]*))" - }, - { - "name": "constant.numeric.integer.nativeint.fsharp", - "match": "\\b(-?((0(x|X)[0-9a-fA-F][0-9a-fA-F_]*)|(0(o|O)[0-7][0-7_]*)|(0(b|B)[01][01_]*)|([0-9][0-9_]*)))" - }, - { - "name": "constant.others.fsharp", - "match": "\\b(true|false|null|unit)\\b" - } - ] - }, - "definition": { - "patterns": [ - { - "name": "meta.binding.fsharp", - "begin": "(val mutable|val|let mutable|let|member|static member|override|let!)(\\s+rec|mutable)?(\\s+private|internal|public)?\\s+(\\([^\\s-]*\\)|[_a-zA-Z]([_a-zA-Z0-9,\\.]|(?<=,)\\s)*)", - "end": "((``.*``)|(with)|=|$)", - "beginCaptures": { - "1": { - "name": "keyword.other.binding.fsharp" - }, - "2": { - "name": "keyword.other.function-recursive.fsharp" - }, - "3": { - "name": "keyword.other.access.fsharp" - }, - "4": { - "name": "variable.other.binding.fsharp" - } - }, - "endCaptures": { - "1": { - "name": "keyword.other.fsharp" - }, - "2": { - "name": "variable.other.binding.fsharp" - }, - "3": { - "name": "keyword.other.fsharp" - } - }, - "patterns": [ - { - "include": "#variables" - } - ] - } - ] - }, - "keywords": { - "patterns": [ - { - "name": "keyword.other.fsharp", - "match": "\\b(function|yield!|yield|class|match|delegate|of|new|in|as|if|then|else|elif|for|begin|end|inherit|do|let\\!|return\\!|return|interface|with|member|try|finally|and|when|use|use\\!)\\b" - }, - { - "name": "meta.preprocessor.fsharp", - "begin": "^\\s*#\\s*(light)\\b", - "end": "(\\s|$)" - }, - { - "name": "keyword.other.fsharp", - "match": "(\\|>|\\->|\\<\\-|:>|:\\?>|:|\\[|\\]|\\;|<>|=|@|\\|\\||&&|{|}|\\||_|\\.\\.|\\+|\\-|\\*|\\/|\\^|\\!|\\>|\\>\\=|\\>\\>|\\<|\\<\\=|\\<\\<)" - } - ] - }, - "modules": { - "patterns": [ - { - "name": "entity.name.section.fsharp", - "begin": "\\b(namespace|module)(\\s+public|internal|private)?\\s+([a-zA-Z][a-zA-Z0-9'_. ]*)", - "end": "(\\s|$)", - "beginCaptures": { - "1": { - "name": "keyword.other.fsharp" - }, - "2": { - "name": "keyword.other.fsharp" - }, - "3": { - "name": "entity.name.section.fsharp" - } - }, - "patterns": [ - { - "name": "entity.name.section.fsharp", - "match": "(\\.)([A-Z][a-zA-Z0-9'_]*)", - "captures": { - "1": { - "name": "punctuation.separator.namespace-reference.fsharp" - }, - "2": { - "name": "entity.name.section.fsharp" - } - } - } - ] - }, - { - "name": "meta.namespace.open.fsharp", - "begin": "\\b(open)\\s+([A-Z][a-zA-Z0-9'_]*)(?=(\\.[A-Z][a-zA-Z0-9_]*)*)", - "end": "(\\s|$)", - "beginCaptures": { - "1": { - "name": "keyword.other.fsharp" - }, - "2": { - "name": "entity.name.section.fsharp" - } - }, - "patterns": [ - { - "name": "entity.name.section.fsharp", - "match": "(\\.)([a-zA-Z][a-zA-Z0-9'_]*)", - "captures": { - "1": { - "name": "punctuation.separator.namespace-reference.fsharp" - }, - "2": { - "name": "entity.name.section.fsharp" - } - } - } - ] - }, - { - "name": "meta.namespace.alias.fsharp", - "begin": "^\\s*(module)\\s+([A-Z][a-zA-Z0-9'_]*)\\s*(=)\\s*([A-Z][a-zA-Z0-9'_]*)", - "end": "(\\s|$)", - "beginCaptures": { - "1": { - "name": "keyword.other.namespace-definition.fsharp" - }, - "2": { - "name": "entity.name.type.namespace.fsharp" - }, - "3": { - "name": "punctuation.separator.namespace-definition.fsharp" - }, - "4": { - "name": "entity.name.section.fsharp" - } - }, - "patterns": [ - { - "name": "entity.name.section.fsharp", - "match": "(\\.)([A-Z][a-zA-Z0-9'_]*)", - "captures": { - "1": { - "name": "punctuation.separator.namespace-reference.fsharp" - }, - "2": { - "name": "entity.name.section.fsharp" - } - } - } - ] - } - ] - }, - "strings": { - "patterns": [ - { - "contentName": "string.quoted.literalprintf.fsharp", - "begin": "(sprintf|printf[n]|failwithf)\\s+((?=[^\\\\])(@\"))", - "end": "(\")", - "beginCaptures": { - "2": { - "name": "punctuation.definition.string.begin.fsharp" - } - }, - "endCaptures": { - "1": { - "name": "punctuation.definition.string.end.fsharp" - } - }, - "patterns": [ - { - "name": "constant.character.string.escape.fsharp", - "match": "\"(\")" - }, - { - "name": "constant.character.string.escape.format.fsharp", - "match": "%[0\\-\\+# ]{0,3}(\\*|[0-9]{0,2})(\\.[0-9]{1,2})?([bcsdiuxXoeEfFgGMOAt]|\\+A)" - } - ] - }, - { - "name": "string.quoted.literal.fsharp", - "begin": "(?=[^\\\\])(@\")", - "end": "(\")", - "beginCaptures": { - "1": { - "name": "punctuation.definition.string.begin.fsharp" - } - }, - "endCaptures": { - "1": { - "name": "punctuation.definition.string.end.fsharp" - } - }, - "patterns": [ - { - "name": "constant.character.string.escape.fsharp", - "match": "\"(\")" - } - ] - }, - { - "contentName": "string.quoted.tripleprintf.fsharp", - "begin": "(sprintf|printf[n]|failwithf)\\s+((?=[^\\\\])(\"\"\"))", - "end": "(\"\"\")", - "beginCaptures": { - "2": { - "name": "punctuation.definition.string.begin.fsharp" - } - }, - "endCaptures": { - "1": { - "name": "punctuation.definition.string.end.fsharp" - } - }, - "patterns": [ - { - "name": "constant.character.string.escape.format.fsharp", - "match": "%[0\\-\\+# ]{0,3}(\\*|[0-9]{0,2})(\\.[0-9]{1,2})?([bcsdiuxXoeEfFgGMOAt]|\\+A)" - } - ] - }, - { - "name": "string.quoted.triple.fsharp", - "begin": "(?=[^\\\\])(\"\"\")", - "end": "(\"\"\")", - "beginCaptures": { - "1": { - "name": "punctuation.definition.string.begin.fsharp" - } - }, - "endCaptures": { - "1": { - "name": "punctuation.definition.string.end.fsharp" - } - } - }, - { - "contentName": "string.quoted.doubleprintf.fsharp", - "begin": "(sprintf|printf[n]|failwithf)\\s+((?=[^\\\\])(\"))", - "end": "(\")", - "beginCaptures": { - "2": { - "name": "punctuation.definition.string.begin.fsharp" - } - }, - "endCaptures": { - "1": { - "name": "punctuation.definition.string.end.fsharp" - } - }, - "patterns": [ - { - "name": "punctuation.separator.string.ignore-eol.fsharp", - "match": "\\\\$[ \\t]*" - }, - { - "name": "constant.character.string.escape.format.fsharp", - "match": "%[0\\-\\+# ]{0,3}(\\*|[0-9]{0,2})(\\.[0-9]{1,2})?([bcsdiuxXoeEfFgGMOAt]|\\+A)" - }, - { - "name": "constant.character.string.escape.fsharp", - "match": "\\\\([\\\\''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8})" - }, - { - "name": "invalid.illeagal.character.string.fsharp", - "match": "\\\\(?![\\\\''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8})." - } - ] - }, - - { - "name": "string.quoted.double.fsharp", - "begin": "(?=[^\\\\])(\")", - "end": "(\")", - "beginCaptures": { - "1": { - "name": "punctuation.definition.string.begin.fsharp" - } - }, - "endCaptures": { - "1": { - "name": "punctuation.definition.string.end.fsharp" - } - }, - "patterns": [ - { - "name": "punctuation.separator.string.ignore-eol.fsharp", - "match": "\\\\$[ \\t]*" - }, - { - "name": "constant.character.string.escape.fsharp", - "match": "\\\\([\\\\''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8})" - }, - { - "name": "invalid.illeagal.character.string.fsharp", - "match": "\\\\(?![\\\\''ntbr]|u[a-fA-F0-9]{4}|u[a-fA-F0-9]{8})." - } - ] - } - ] - }, - "variables": { - "patterns": [ - { - "name": "constant.language.unit.fsharp", - "match": "\\(\\)" - }, - { - "name": "variable.parameter.fsharp", - "match": "[a-zA-Z']\\w*" - } - ] - }, - "double_tick": { - "patterns": [ - { - "name": "variable.other.binding.fsharp", - "match": "(``)(.*)(``)", - "captures": { - "1": { - "name": "string.quoted.single.fsharp" - }, - "1": { - "name": "variable.other.binding.fsharp" - }, - "3": { - "name": "string.quoted.single.fsharp" - } - } - } - ] - }, - "records": { - "patterns": [ - { - "name": "record.fsharp", - "match": "(type)[\\s]+(private|internal|public)?[\\s]*([a-zA-Z0-9'<>^:,. ]+)((with)|(=)|(\\(\\)))", - - "captures": { - "1": { - "name": "keyword.other.fsharp" - }, - "2": { - "name": "keyword.other.fsharp" - }, - "3": { - "name": "entity.name.type.fsharp" - }, - "5": { - "name": "keyword.other.fsharp" - }, - "6": { - "name": "keyword.other.fsharp" - }, - "7": { - "name": "constant.language.unit.fsharp" - } - } - } - ] - }, - "cexprs": { - "patterns": [ - { - "name": "cexpr.fsharp", - "match": "\\b([a-zA-Z]*\\s+\\{)", - "captures": { - "1": { - "name": "keyword.other.fsharp" - } - } - } - ] - }, - "chars": { - "patterns": [ - { - "name": "char.fsharp", - "match": "('\\\\?.')", - "captures": { - "1": { - "name": "string.quoted.single.fsharp" - } - } - } - ] - }, - "text": { - "patterns": [ - { - "name": "text.fsharp", - "match": "\\\\" - } - ] - } - } -} \ No newline at end of file diff --git a/lib/shiki-languages/data/grammars/git-commit.tmLanguage b/lib/shiki-languages/data/grammars/git-commit.tmLanguage deleted file mode 100644 index 705fc0a3..00000000 --- a/lib/shiki-languages/data/grammars/git-commit.tmLanguage +++ /dev/null @@ -1,221 +0,0 @@ - - - - - fileTypes - - COMMIT_EDITMSG - MERGE_MSG - - foldingStartMarker - ^\+\+\+ - foldingStopMarker - ^--- - name - Git Commit Message - patterns - - - begin - \A(?!# Please enter the commit message) - end - ^(?=# Please enter the commit message) - name - meta.scope.message.git-commit - patterns - - - begin - \A(?=#) - end - ^(?!#) - patterns - - - include - #comment - - - - - begin - ^(?!# Please enter the commit message) - end - ^(?=# Please enter the commit message) - patterns - - - begin - \G - end - ^(?!\G) - name - meta.scope.subject.git-commit - patterns - - - captures - - 1 - - name - keyword.other.$2.git-commit - - - match - \G((fixup|squash)!)\s* - - - match - .{66,}$ - name - invalid.illegal.line-too-long.git-commit - - - match - .{51,}$ - name - invalid.deprecated.line-too-long.git-commit - - - - - begin - ^(?!# Please enter the commit message) - end - ^(?=# Please enter the commit message) - patterns - - - include - #comment - - - - - - - - - begin - ^(?=# Please enter the commit message) - end - \z - name - meta.scope.metadata.git-commit - patterns - - - include - #metadata - - - - - repository - - comment - - begin - ^(#) - captures - - 1 - - name - punctuation.definition.comment.git-commit - - - end - \n - name - comment.line.number-sign.git-commit - - metadata - - patterns - - - begin - (?=^# Changes to be committed:) - end - (?!\G)((?=^# \w)|(?!^#)) - patterns - - - begin - (^[ \t]+)?(?=#) - beginCaptures - - 1 - - name - punctuation.whitespace.comment.leading.git-commit - - - contentName - comment.line.number-sign.git-commit - end - (?!\G)^ - patterns - - - match - \G# - name - punctuation.definition.comment.git-commit - - - match - ((modified|renamed):.*)$\n? - name - markup.changed.git-commit - - - match - (new file:.*)$\n? - name - markup.inserted.git-commit - - - match - (deleted:.*)$\n? - name - markup.deleted.git-commit - - - - - - - include - #comment - - - begin - (?=diff\ \-\-git) - comment - diff presented at the end of the commit message when using commit -v. - contentName - source.diff - end - \z - name - meta.embedded.diff.git-commit - patterns - - - include - source.diff - - - - - - - scopeName - text.git-commit - uuid - BFE83C06-8508-44BE-A975-95A57BF619A7 - - diff --git a/lib/shiki-languages/data/grammars/git-rebase.tmLanguage b/lib/shiki-languages/data/grammars/git-rebase.tmLanguage deleted file mode 100644 index a53ee153..00000000 --- a/lib/shiki-languages/data/grammars/git-rebase.tmLanguage +++ /dev/null @@ -1,57 +0,0 @@ - - - - - fileTypes - - git-rebase-todo - - name - Git Rebase Message - patterns - - - captures - - 1 - - name - punctuation.definition.comment.git-rebase - - - match - ^\s*(#).*$\n? - name - comment.line.number-sign.git-rebase - - - captures - - 1 - - name - support.function.git-rebase - - 2 - - name - constant.sha.git-rebase - - 3 - - name - meta.commit-message.git-rebase - - - match - ^\s*(pick|p|reword|r|edit|e|squash|s|fixup|f|d|drop|x|exec)\s+([0-9a-f]+)\s+(.*)$ - name - meta.commit-command.git-rebase - - - scopeName - text.git-rebase - uuid - 7F1CC209-5F6D-486A-8180-09FA282381A1 - - diff --git a/lib/shiki-languages/data/grammars/go.json b/lib/shiki-languages/data/grammars/go.json deleted file mode 100644 index b4983d40..00000000 --- a/lib/shiki-languages/data/grammars/go.json +++ /dev/null @@ -1,611 +0,0 @@ -{ - "scopeName": "source.go", - "name": "Go", - "comment": "Go language", - "fileTypes": [ - "go" - ], - "foldingStartMarker": "({|\\()\\s*$", - "foldingStopMarker": "(}|\\))\\s*$", - "patterns": [ - { - "comment": "Block comments", - "begin": "/\\*", - "end": "\\*/", - "captures": { - "0": { - "name": "punctuation.definition.comment.go" - } - }, - "name": "comment.block.go" - }, - { - "comment": "Line comments", - "begin": "//", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.go" - } - }, - "end": "$", - "name": "comment.line.double-slash.go" - }, - { - "comment": "Interpreted string literals", - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.go" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.go" - } - }, - "name": "string.quoted.double.go", - "patterns": [ - { - "include": "#string_escaped_char" - }, - { - "include": "#string_placeholder" - } - ] - }, - { - "comment": "Raw string literals", - "begin": "`", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.go" - } - }, - "end": "`", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.go" - } - }, - "name": "string.quoted.raw.go", - "patterns": [ - { - "include": "#string_placeholder" - } - ] - }, - { - "comment": "Syntax error receiving channels", - "match": "<\\-([\\t ]+)chan\\b", - "captures": { - "1": { - "name": "invalid.illegal.receive-channel.go" - } - } - }, - { - "comment": "Syntax error sending channels", - "match": "\\bchan([\\t ]+)<-", - "captures": { - "1": { - "name": "invalid.illegal.send-channel.go" - } - } - }, - { - "comment": "Syntax error using slices", - "match": "\\[\\](\\s+)", - "captures": { - "1": { - "name": "invalid.illegal.slice.go" - } - } - }, - { - "comment": "Syntax error numeric literals", - "match": "\\b0[0-7]*[89]\\d*\\b", - "name": "invalid.illegal.numeric.go" - }, - { - "comment": "Built-in functions", - "match": "\\b(append|cap|close|complex|copy|delete|imag|len|make|new|panic|print|println|real|recover)\\b(?=\\()", - "name": "support.function.builtin.go" - }, - { - "comment": "Function declarations", - "match": "^(\\bfunc\\b)(?:\\s+(\\([^\\)]+\\)\\s+)?([a-zA-Z_]\\w*)(?=\\())?", - "captures": { - "1": { - "name": "keyword.function.go" - }, - "2": { - "patterns": [ - { - "include": "#brackets" - }, - { - "include": "#operators" - } - ] - }, - "3": { - "name": "entity.name.function" - } - } - }, - { - "comment": "Functions", - "match": "(\\bfunc\\b)|([a-zA-Z_]\\w*)(?=\\()", - "captures": { - "1": { - "name": "keyword.function.go" - }, - "2": { - "name": "support.function.go" - } - } - }, - { - "comment": "Floating-point literals", - "match": "(\\.\\d+([Ee][-+]\\d+)?i?)\\b|\\b\\d+\\.\\d*(([Ee][-+]\\d+)?i?\\b)?", - "name": "constant.numeric.floating-point.go" - }, - { - "comment": "Integers", - "match": "\\b((0x[0-9a-fA-F]+)|(0[0-7]+i?)|(\\d+([Ee]\\d+)?i?)|(\\d+[Ee][-+]\\d+i?))\\b", - "name": "constant.numeric.integer.go" - }, - { - "comment": "Language constants", - "match": "\\b(true|false|nil|iota)\\b", - "name": "constant.language.go" - }, - { - "comment": "Package declarations", - "match": "(?<=package)\\s+([a-zA-Z_]\\w*)", - "captures": { - "1": { - "name": "entity.name.package.go" - } - } - }, - { - "comment": "Single line import declarations", - "match": "(?<=import)(\\s+((?!\\s+\")[^\\s]*)?\\s*)((\")([^\"]*)(\"))", - "captures": { - "2": { - "name": "entity.alias.import.go" - }, - "3": { - "name": "string.quoted.double.go" - }, - "4": { - "name": "punctuation.definition.string.begin.go" - }, - "5": { - "name": "entity.name.import.go" - }, - "6": { - "name": "punctuation.definition.string.end.go" - } - } - }, - { - "comment": "Multiline import declarations", - "begin": "(?<=import)\\s+(\\()", - "beginCaptures": { - "1": { - "name": "punctuation.other.bracket.round.go" - } - }, - "patterns": [ - { - "match": "((?!\\s+\")[^\\s]*)?\\s+((\")([^\"]*)(\"))", - "captures": { - "1": { - "name": "entity.alias.import.go" - }, - "2": { - "name": "string.quoted.double.go" - }, - "3": { - "name": "punctuation.definition.string.begin.go" - }, - "4": { - "name": "entity.name.import.go" - }, - "5": { - "name": "punctuation.definition.string.end.go" - } - } - } - ], - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.other.bracket.round.go" - } - } - }, - { - "comment": "Type declarations", - "match": "(?<=type)\\s+([a-zA-Z_]\\w*)", - "captures": { - "1": { - "name": "entity.name.type.go" - } - } - }, - { - "comment": "Shorthand variable declaration and assignments", - "match": "[a-zA-Z_]\\w*(?:,\\s*[a-zA-Z_]\\w*)*(?=\\s*:=)", - "captures": { - "0": { - "patterns": [ - { - "match": "[a-zA-Z_]\\w*", - "name": "variable.other.assignment.go" - }, - { - "include": "#delimiters" - } - ] - } - } - }, - { - "comment": "Assignments to existing variables", - "match": "(?=|<[^<]|>[^>])", - "name": "keyword.operator.comparison.go" - }, - { - "match": "(&&|\\|\\||!)", - "name": "keyword.operator.logical.go" - }, - { - "match": "(=|\\+=|\\-=|\\|=|\\^=|\\*=|/=|:=|%=|<<=|>>=|&\\^=|&=)", - "name": "keyword.operator.assignment.go" - }, - { - "match": "(\\+|\\-|\\*|/|%)", - "name": "keyword.operator.arithmetic.go" - }, - { - "match": "(&(?!\\^)|\\||\\^|&\\^|<<|>>)", - "name": "keyword.operator.arithmetic.bitwise.go" - }, - { - "match": "\\.\\.\\.", - "name": "keyword.operator.ellipsis.go" - } - ] - }, - "runes": { - "patterns": [ - { - "match": "\\'(\\\\([0-7]{3}|[abfnrtv\\\\'\"]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})|\\p{Any})\\'", - "name": "constant.other.rune.go" - }, - { - "match": "\\'.*\\'", - "name": "invalid.illegal.unknown-rune.go" - } - ] - }, - "storage_types": { - "patterns": [ - { - "match": "\\bbool\\b", - "name": "storage.type.boolean.go" - }, - { - "match": "\\bbyte\\b", - "name": "storage.type.byte.go" - }, - { - "match": "\\berror\\b", - "name": "storage.type.error.go" - }, - { - "match": "\\b(complex(64|128)|float(32|64)|u?int(8|16|32|64)?)\\b", - "name": "storage.type.numeric.go" - }, - { - "match": "\\brune\\b", - "name": "storage.type.rune.go" - }, - { - "match": "\\bstring\\b", - "name": "storage.type.string.go" - }, - { - "match": "\\buintptr\\b", - "name": "storage.type.uintptr.go" - } - ] - }, - "string_escaped_char": { - "patterns": [ - { - "match": "\\\\([0-7]{3}|[abfnrtv\\\\'\"]|x[0-9a-fA-F]{2}|u[0-9a-fA-F]{4}|U[0-9a-fA-F]{8})", - "name": "constant.character.escape.go" - }, - { - "match": "\\\\[^0-7xuUabfnrtv\\'\"]", - "name": "invalid.illegal.unknown-escape.go" - } - ] - }, - "string_placeholder": { - "patterns": [ - { - "match": "%(\\[\\d+\\])?([\\+#\\-0\\x20]{,2}((\\d+|\\*)?(\\.?(\\d+|\\*|(\\[\\d+\\])\\*?)?(\\[\\d+\\])?)?))?[vT%tbcdoqxXUbeEfFgGsp]", - "name": "constant.other.placeholder.go" - } - ] - }, - "variables": { - "comment": "First add tests and make sure existing tests still pass when changing anything here!", - "patterns": [ - { - "match": "([a-zA-Z_]\\w*(?:,\\s*[a-zA-Z_]\\w*)*)\\s*(=.*)", - "captures": { - "1": { - "patterns": [ - { - "match": "[a-zA-Z_]\\w*", - "name": "variable.other.assignment.go" - }, - { - "include": "#delimiters" - } - ] - }, - "2": { - "patterns": [ - { - "include": "$self" - } - ] - } - } - }, - { - "match": "([a-zA-Z_]\\w*(?:,\\s*[a-zA-Z_]\\w*)*)(\\s+[\\*]?[a-zA-Z_]\\w*\\s*)(=.*)", - "captures": { - "1": { - "patterns": [ - { - "match": "[a-zA-Z_]\\w*", - "name": "variable.other.assignment.go" - }, - { - "include": "#delimiters" - } - ] - }, - "2": { - "patterns": [ - { - "include": "$self" - } - ] - }, - "3": { - "patterns": [ - { - "include": "$self" - } - ] - } - } - }, - { - "match": "([a-zA-Z_]\\w*(?:,\\s*[a-zA-Z_]\\w*)*)(\\s+[\\[\\]\\*]{0,3}[a-zA-Z_]\\w*\\s*[^=].*)", - "captures": { - "1": { - "patterns": [ - { - "match": "[a-zA-Z_]\\w*", - "name": "variable.other.declaration.go" - }, - { - "include": "#delimiters" - } - ] - }, - "2": { - "patterns": [ - { - "include": "$self" - } - ] - } - } - } - ] - } - }, - "version": "https://github.com/atom/language-go/commit/d941ce3155b500e65b4d7fbc53ea51b9c92ec1cb" -} \ No newline at end of file diff --git a/lib/shiki-languages/data/grammars/html.json b/lib/shiki-languages/data/grammars/html.json deleted file mode 100644 index 04a0769e..00000000 --- a/lib/shiki-languages/data/grammars/html.json +++ /dev/null @@ -1,553 +0,0 @@ -{ - "fileTypes": [ - "html", - "htm", - "shtml", - "xhtml", - "inc", - "tmpl", - "tpl" - ], - "firstLineMatch": "<(?i:(!DOCTYPE\\s*)?html)", - "injections": { - "R:text.html - comment.block": { - "comment": "Use R: to ensure this matches after any other injections.", - "patterns": [ - { - "match": "<", - "name": "invalid.illegal.bad-angle-bracket.html" - } - ] - } - }, - "keyEquivalent": "^~H", - "name": "HTML", - "patterns": [ - { - "begin": "(<)([a-zA-Z0-9:\\-]++)(?=[^>]*>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.html" - }, - "2": { - "name": "entity.name.tag.html" - } - }, - "end": "(>(<)/)(\\2)(>)", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.html" - }, - "2": { - "name": "meta.scope.between-tag-pair.html" - }, - "3": { - "name": "entity.name.tag.html" - }, - "4": { - "name": "punctuation.definition.tag.html" - } - }, - "name": "meta.tag.any.html", - "patterns": [ - { - "include": "#tag-stuff" - } - ] - }, - { - "begin": "(<\\?)(xml)", - "captures": { - "1": { - "name": "punctuation.definition.tag.html" - }, - "2": { - "name": "entity.name.tag.xml.html" - } - }, - "end": "(\\?>)", - "name": "meta.tag.preprocessor.xml.html", - "patterns": [ - { - "include": "#tag-generic-attribute" - }, - { - "include": "#string-double-quoted" - }, - { - "include": "#string-single-quoted" - } - ] - }, - { - "begin": " - - - (^|\G)(?!\s*$|#|[ ]{0,3}((([*_][ ]{0,2}\2){2,}[ \t]*$\n?)|([*+-]([ ]{1,3}|\t)))|\s*\[.+?\]:|>) - - raw_block - - begin - (^|\G)([ ]{4}|\t) - name - markup.raw.block.markdown - while - (^|\G)([ ]{4}|\t) - - fenced_code_block_css - - begin - (^|\G)\s*([`~]{3,})\s*(css|css.erb)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.css - - - - fenced_code_block_basic - - begin - (^|\G)\s*([`~]{3,})\s*(html|htm|shtml|xhtml|inc|tmpl|tpl)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - text.html.basic - - - - fenced_code_block_ini - - begin - (^|\G)\s*([`~]{3,})\s*(ini|conf)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.ini - - - - fenced_code_block_java - - begin - (^|\G)\s*([`~]{3,})\s*(java|bsh)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.java - - - - fenced_code_block_lua - - begin - (^|\G)\s*([`~]{3,})\s*(lua)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.lua - - - - fenced_code_block_makefile - - begin - (^|\G)\s*([`~]{3,})\s*(Makefile|makefile|GNUmakefile|OCamlMakefile)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.makefile - - - - fenced_code_block_perl - - begin - (^|\G)\s*([`~]{3,})\s*(perl|pl|pm|pod|t|PL|psgi|vcl)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.perl - - - - fenced_code_block_r - - begin - (^|\G)\s*([`~]{3,})\s*(R|r|s|S|Rprofile)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.r - - - - fenced_code_block_ruby - - begin - (^|\G)\s*([`~]{3,})\s*(ruby|rb|rbx|rjs|Rakefile|rake|cgi|fcgi|gemspec|irbrc|Capfile|ru|prawn|Cheffile|Gemfile|Guardfile|Hobofile|Vagrantfile|Appraisals|Rantfile|Berksfile|Berksfile.lock|Thorfile|Puppetfile)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.ruby - - - - fenced_code_block_php - - begin - (^|\G)\s*([`~]{3,})\s*(php|php3|php4|php5|phpt|phtml|aw|ctp)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - text.html.php - - - - fenced_code_block_sql - - begin - (^|\G)\s*([`~]{3,})\s*(sql|ddl|dml)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.sql - - - - fenced_code_block_vs_net - - begin - (^|\G)\s*([`~]{3,})\s*(vb)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.asp.vb.net - - - - fenced_code_block_xml - - begin - (^|\G)\s*([`~]{3,})\s*(xml|xsd|tld|jsp|pt|cpt|dtml|rss|opml)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - text.xml - - - - fenced_code_block_xsl - - begin - (^|\G)\s*([`~]{3,})\s*(xsl|xslt)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - text.xml.xsl - - - - fenced_code_block_yaml - - begin - (^|\G)\s*([`~]{3,})\s*(yaml|yml)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.yaml - - - - fenced_code_block_dosbatch - - begin - (^|\G)\s*([`~]{3,})\s*(bat|batch)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.dosbatch - - - - fenced_code_block_clojure - - begin - (^|\G)\s*([`~]{3,})\s*(clj|cljs|clojure)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.clojure - - - - fenced_code_block_coffee - - begin - (^|\G)\s*([`~]{3,})\s*(coffee|Cakefile|coffee.erb)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.coffee - - - - fenced_code_block_c - - begin - (^|\G)\s*([`~]{3,})\s*(c|h)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.c - - - - fenced_code_block_diff - - begin - (^|\G)\s*([`~]{3,})\s*(patch|diff|rej)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.diff - - - - fenced_code_block_dockerfile - - begin - (^|\G)\s*([`~]{3,})\s*(dockerfile|Dockerfile)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.dockerfile - - - - fenced_code_block_git_commit - - begin - (^|\G)\s*([`~]{3,})\s*(COMMIT_EDITMSG|MERGE_MSG)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - text.git-commit - - - - fenced_code_block_git_rebase - - begin - (^|\G)\s*([`~]{3,})\s*(git-rebase-todo)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - text.git-rebase - - - - fenced_code_block_groovy - - begin - (^|\G)\s*([`~]{3,})\s*(groovy|gvy)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.groovy - - - - fenced_code_block_jade - - begin - (^|\G)\s*([`~]{3,})\s*(jade)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - text.jade - - - - fenced_code_block_js - - begin - (^|\G)\s*([`~]{3,})\s*(js|jsx|javascript)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.js - - - - fenced_code_block_js_regexp - - begin - (^|\G)\s*([`~]{3,})\s*(regexp)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.js.regexp - - - - fenced_code_block_json - - begin - (^|\G)\s*([`~]{3,})\s*(json|sublime-settings|sublime-menu|sublime-keymap|sublime-mousemap|sublime-theme|sublime-build|sublime-project|sublime-completions)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.json - - - - fenced_code_block_less - - begin - (^|\G)\s*([`~]{3,})\s*(less)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.css.less - - - - fenced_code_block_objc - - begin - (^|\G)\s*([`~]{3,})\s*(objectivec|mm|objc|obj-c|m|h)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.objc - - - - fenced_code_block_perl6 - - begin - (^|\G)\s*([`~]{3,})\s*(perl6|p6|pl6|pm6|nqp)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.perl.6 - - - - fenced_code_block_powershell - - begin - (^|\G)\s*([`~]{3,})\s*(powershell|ps1|psm1|psd1)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.powershell - - - - fenced_code_block_python - - begin - (^|\G)\s*([`~]{3,})\s*(python|py|py3|rpy|pyw|cpy|SConstruct|Sconstruct|sconstruct|SConscript|gyp|gypi)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.python - - - - fenced_code_block_regexp_python - - begin - (^|\G)\s*([`~]{3,})\s*(re)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.regexp.python - - - - fenced_code_block_shell - - begin - (^|\G)\s*([`~]{3,})\s*(shell|sh|bash|zsh|bashrc|bash_profile|bash_login|profile|bash_logout|.textmate_init)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.shell - - - - fenced_code_block_ts - - begin - (^|\G)\s*([`~]{3,})\s*(typescript|ts)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.ts - - - - fenced_code_block_tsx - - begin - (^|\G)\s*([`~]{3,})\s*(tsx)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)[ ]{0,3}(\2)\s*\n - patterns - - - include - source.tsx - - - - fenced_code_block_csharp - - begin - (^|\G)\s*([`~]{3,})\s*(cs|csharp|c#)\s*$ - name - markup.fenced_code.block.markdown - end - (^|\G)(\2)\n - patterns - - - include - source.cs - - - - separator - - match - (^|\G)[ ]{0,3}([*-_])([ ]{0,2}\2){2,}[ \t]*$\n? - name - meta.separator.markdown - - - - inline - - patterns - - - include - #ampersand - - - include - #bracket - - - include - #bold - - - include - #italic - - - include - #raw - - - include - #escape - - - include - #image-inline - - - include - #image-ref - - - include - #link-email - - - include - #link-inet - - - include - #link-inline - - - include - #link-ref - - - include - #link-ref-literal - - - repository - - ampersand - - comment - - Markdown will convert this for us. We match it so that the - HTML grammar will not mark it up as invalid. - - match - &(?!([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+);) - name - meta.other.valid-ampersand.markdown - - bold - - begin - (?x) - (\*\*|__)(?=\S) # Open - (?= - ( - <[^>]*+> # HTML tags - | (?<raw>`+)([^`]|(?!(?<!`)\k<raw>(?!`))`)*+\k<raw> - # Raw - | \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes - | \[ - ( - (?<square> # Named group - [^\[\]\\] # Match most chars - | \\. # Escaped chars - | \[ \g<square>*+ \] # Nested brackets - )*+ - \] - ( - ( # Reference Link - [ ]? # Optional space - \[[^\]]*+\] # Ref name - ) - | ( # Inline Link - \( # Opening paren - [ \t]*+ # Optional whtiespace - <?(.*?)>? # URL - [ \t]*+ # Optional whtiespace - ( # Optional Title - (?<title>['"]) - (.*?) - \k<title> - )? - \) - ) - ) - ) - | (?!(?<=\S)\1). # Everything besides - # style closer - )++ - (?<=\S)\1 # Close - ) - - captures - - 1 - - name - punctuation.definition.bold.markdown - - - end - (?<=\S)(\1) - name - markup.bold.markdown - patterns - - - applyEndPatternLast - 1 - begin - (?=<[^>]*?>) - end - (?<=>) - patterns - - - include - text.html.basic - - - - - include - #escape - - - include - #ampersand - - - include - #bracket - - - include - #raw - - - include - #italic - - - include - #image-inline - - - include - #link-inline - - - include - #link-inet - - - include - #link-email - - - include - #image-ref - - - include - #link-ref-literal - - - include - #link-ref - - - - bracket - - comment - - Markdown will convert this for us. We match it so that the - HTML grammar will not mark it up as invalid. - - match - <(?![a-z/?\$!]) - name - meta.other.valid-bracket.markdown - - escape - - match - \\[-`*_#+.!(){}\[\]\\>] - name - constant.character.escape.markdown - - image-inline - - captures - - 1 - - name - punctuation.definition.string.begin.markdown - - 10 - - name - string.other.link.description.title.markdown - - 11 - - name - punctuation.definition.string.markdown - - 12 - - name - punctuation.definition.string.markdown - - 13 - - name - string.other.link.description.title.markdown - - 14 - - name - punctuation.definition.string.markdown - - 15 - - name - punctuation.definition.string.markdown - - 16 - - name - punctuation.definition.metadata.markdown - - 2 - - name - string.other.link.description.markdown - - 4 - - name - punctuation.definition.string.end.markdown - - 5 - - name - invalid.illegal.whitespace.markdown - - 6 - - name - punctuation.definition.metadata.markdown - - 7 - - name - punctuation.definition.link.markdown - - 8 - - name - markup.underline.link.image.markdown - - 9 - - name - punctuation.definition.link.markdown - - - match - (?x: - (\!\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\]) - # Match the link text. - ([ ])? # Space not allowed - (\() # Opening paren for url - (<?)(\S+?)(>?) # The url - [ \t]* # Optional whitespace - (?: - ((\().+?(\))) # Match title in parens… - | ((").+?(")) # or in quotes. - )? # Title is optional - \s* # Optional whitespace - (\)) - ) - name - meta.image.inline.markdown - - image-ref - - captures - - 1 - - name - punctuation.definition.string.begin.markdown - - 2 - - name - string.other.link.description.markdown - - 4 - - name - punctuation.definition.string.begin.markdown - - 5 - - name - punctuation.definition.constant.markdown - - 6 - - name - constant.other.reference.link.markdown - - 7 - - name - punctuation.definition.constant.markdown - - - match - (\!\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)(.*?)(\]) - name - meta.image.reference.markdown - - italic - - begin - (?x) - (\*|_)(?=\S) # Open - (?= - ( - <[^>]*+> # HTML tags - | (?<raw>`+)([^`]|(?!(?<!`)\k<raw>(?!`))`)*+\k<raw> - # Raw - | \\[\\`*_{}\[\]()#.!+\->]?+ # Escapes - | \[ - ( - (?<square> # Named group - [^\[\]\\] # Match most chars - | \\. # Escaped chars - | \[ \g<square>*+ \] # Nested brackets - )*+ - \] - ( - ( # Reference Link - [ ]? # Optional space - \[[^\]]*+\] # Ref name - ) - | ( # Inline Link - \( # Opening paren - [ \t]*+ # Optional whtiespace - <?(.*?)>? # URL - [ \t]*+ # Optional whtiespace - ( # Optional Title - (?<title>['"]) - (.*?) - \k<title> - )? - \) - ) - ) - ) - | \1\1 # Must be bold closer - | (?!(?<=\S)\1). # Everything besides - # style closer - )++ - (?<=\S)\1 # Close - ) - - captures - - 1 - - name - punctuation.definition.italic.markdown - - - end - (?<=\S)(\1)((?!\1)|(?=\1\1)) - name - markup.italic.markdown - patterns - - - applyEndPatternLast - 1 - begin - (?=<[^>]*?>) - end - (?<=>) - patterns - - - include - text.html.basic - - - - - include - #escape - - - include - #ampersand - - - include - #bracket - - - include - #raw - - - include - #bold - - - include - #image-inline - - - include - #link-inline - - - include - #link-inet - - - include - #link-email - - - include - #image-ref - - - include - #link-ref-literal - - - include - #link-ref - - - - link-email - - captures - - 1 - - name - punctuation.definition.link.markdown - - 2 - - name - markup.underline.link.markdown - - 4 - - name - punctuation.definition.link.markdown - - - match - (<)((?:mailto:)?[-.\w]+@[-a-z0-9]+(\.[-a-z0-9]+)*\.[a-z]+)(>) - name - meta.link.email.lt-gt.markdown - - link-inet - - captures - - 1 - - name - punctuation.definition.link.markdown - - 2 - - name - markup.underline.link.markdown - - 3 - - name - punctuation.definition.link.markdown - - - match - (<)((?:https?|ftp)://.*?)(>) - name - meta.link.inet.markdown - - link-inline - - captures - - 1 - - name - punctuation.definition.string.begin.markdown - - 10 - - name - string.other.link.description.title.markdown - - 11 - - name - punctuation.definition.string.begin.markdown - - 12 - - name - punctuation.definition.string.end.markdown - - 13 - - name - string.other.link.description.title.markdown - - 14 - - name - punctuation.definition.string.begin.markdown - - 15 - - name - punctuation.definition.string.end.markdown - - 16 - - name - punctuation.definition.metadata.markdown - - 2 - - name - string.other.link.title.markdown - - 4 - - name - punctuation.definition.string.end.markdown - - 5 - - name - invalid.illegal.whitespace.markdown - - 6 - - name - punctuation.definition.metadata.markdown - - 7 - - name - punctuation.definition.link.markdown - - 8 - - name - markup.underline.link.markdown - - 9 - - name - punctuation.definition.link.markdown - - - match - (?x: - (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\]) - # Match the link text. - ([ ])? # Space not allowed - (\() # Opening paren for url - (<?)(.*?)(>?) # The url - [ \t]* # Optional whitespace - (?: - ((\().+?(\))) # Match title in parens… - | ((").+?(")) # or in quotes. - )? # Title is optional - \s* # Optional whitespace - (\)) - ) - name - meta.link.inline.markdown - - link-ref - - captures - - 1 - - name - punctuation.definition.string.begin.markdown - - 2 - - name - string.other.link.title.markdown - - 4 - - name - punctuation.definition.string.end.markdown - - 5 - - name - punctuation.definition.constant.begin.markdown - - 6 - - name - constant.other.reference.link.markdown - - 7 - - name - punctuation.definition.constant.end.markdown - - - match - (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)([^\]]*+)(\]) - name - meta.link.reference.markdown - - link-ref-literal - - captures - - 1 - - name - punctuation.definition.string.begin.markdown - - 2 - - name - string.other.link.title.markdown - - 4 - - name - punctuation.definition.string.end.markdown - - 5 - - name - punctuation.definition.constant.begin.markdown - - 6 - - name - punctuation.definition.constant.end.markdown - - - match - (\[)((?<square>[^\[\]\\]|\\.|\[\g<square>*+\])*+)(\])[ ]?(\[)(\]) - name - meta.link.reference.literal.markdown - - raw - - captures - - 1 - - name - punctuation.definition.raw.markdown - - 3 - - name - punctuation.definition.raw.markdown - - - match - (`+)([^`]|(?!(?<!`)\1(?!`))`)*+(\1) - name - markup.inline.raw.markdown - - - - - scopeName - text.html.markdown - uuid - 0A1D9874-B448-11D9-BD50-000D93B6E43C - - diff --git a/lib/shiki-languages/data/grammars/php.json b/lib/shiki-languages/data/grammars/php.json deleted file mode 100644 index d42cb29a..00000000 --- a/lib/shiki-languages/data/grammars/php.json +++ /dev/null @@ -1,2638 +0,0 @@ -{ - "scopeName": "text.html.php", - "name": "PHP", - "fileTypes": [ - "aw", - "ctp", - "inc", - "install", - "module", - "php", - "php_cs", - "php3", - "php4", - "php5", - "phpt", - "phtml", - "profile" - ], - "firstLineMatch": "^#!.*(?))", - "beginCaptures": { - "0": { - "name": "punctuation.whitespace.embedded.leading.php" - } - }, - "end": "(?!\\G)(\\s*$\\n)?", - "endCaptures": { - "0": { - "name": "punctuation.whitespace.embedded.trailing.php" - } - }, - "patterns": [ - { - "begin": "<\\?(?i:php|=)?", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.metatag.begin.php" - } - }, - "contentName": "source.php", - "end": "(\\?)>", - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.metatag.end.php" - }, - "1": { - "name": "source.php" - } - }, - "name": "meta.embedded.block.php", - "patterns": [ - { - "include": "#language" - } - ] - } - ] - }, - { - "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": "#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": "#language" - } - ] - } - ] - } - ] - } - }, - "patterns": [ - { - "include": "text.html.basic" - } - ], - "repository": { - "class-builtin": { - "patterns": [ - { - "captures": { - "1": { - "name": "punctuation.separator.inheritance.php" - } - }, - "match": "(?i)(\\\\)?\\b(st(dClass|reamWrapper)|R(RD(Graph|Creator|Updater)|untimeException|e(sourceBundle|cursive(RegexIterator|Ca(chingIterator|llbackFilterIterator)|TreeIterator|Iterator(Iterator)?|DirectoryIterator|FilterIterator|ArrayIterator)|flect(ion(Method|Class|ZendExtension|Object|P(arameter|roperty)|Extension|Function(Abstract)?)?|or)|gexIterator)|angeException)|G(ender\\Gender|lobIterator|magick(Draw|Pixel)?)|X(sltProcessor|ML(Reader|Diff\\\\(Memory|Base|DOM|File)|Writer)|SLTProcessor)|M(ysqlndUh(Connection|PreparedStatement)|ongo(Re(sultException|gex)|Grid(fsFile|FS(Cursor|File)?)|BinData|C(o(de|llection|mmandCursor)|ursor(Exception)?|lient)|Timestamp|I(n(sertBatch|t(32|64))|d)|D(B(Ref)?|eleteBatch|ate)|UpdateBatch|Pool|Write(Batch|ConcernException)|Log)?|u(tex|ltipleIterator)|e(ssageFormatter|mcache(d)?))|Bad(MethodCallException|FunctionCallException)|tidy(Node)?|S(ync(ReaderWriter|Mutex|Semaphore|Event)|impleXML(Iterator|Element)|oap(Server|Header|Client|Param|Var|Fault)|NMP|CA(_(SoapProxy|LocalProxy))?|p(hinxClient|oofchecker|l(M(inHeap|axHeap)|S(tack|ubject)|Heap|T(ype|empFileObject)|Ob(server|jectStorage)|DoublyLinkedList|PriorityQueue|Enum|Queue|Fi(le(Info|Object)|xedArray)))|e(ssionHandler(Interface)?|ekableIterator|rializable)|DO_(Model_(ReflectionDataObject|Type|Property)|Sequence|D(ata(Object|Factory)|AS_(Relational|XML(_Document)?|Setting|ChangeSummary|Data(Object|Factory)))|Exception|List)|wish(Result(s)?|Search)?|VM(Model)?|QLite(Result|3(Result|Stmt)?|Database|Unbuffered)|AM(Message|Connection))|H(RTime\\\\(StopWatch|PerformanceCounter)|ttp(Re(sponse|quest(Pool)?)|Message|InflateStream|DeflateStream|QueryString)|aru(Image|Outline|D(oc|estination)|Page|Encoder|Font|Annotation))|Ya(f_(R(oute(_(Re(write|gex)|Map|S(tatic|imple|upervar)|Interface)|r)|e(sponse_Abstract|quest_(Simple|Http|Abstract)|gistry))|Session|Con(troller_Abstract|fig_(Simple|Ini|Abstract))|Dispatcher|Plugin_Abstract|Exception|View_(Simple|Interface)|Loader|A(ction_Abstract|pplication))|r_(Server(_Exception)?|C(oncurrent_Client|lient(_Exception)?)))|N(o(RewindIterator|rmalizer)|umberFormatter)|C(o(nd|untable|ll(ectable|ator))|URLFile|a(chingIterator|llbackFilterIterator))|T(hread(ed)?|okyoTyrant(Table|Iterator|Query)?|ra(nsliterator|versable))|I(n(tl(RuleBasedBreakIterator|BreakIterator|C(odePointBreakIterator|alendar)|TimeZone|Iterator|DateFormatter|PartsIterator)|validArgumentException|finiteIterator)|terator(Iterator|Aggregate)?|magick(Draw|Pixel(Iterator)?)?)|php_user_filter|Z(MQ(Socket|Context|Device|Poll)?|ipArchive)|O(CI-(Collection|Lob)|ut(erIterator|Of(RangeException|BoundsException))|verflowException)|D(irectory(Iterator)?|omainException|OM(XPath|N(ode(list)?|amedNodeMap)|C(haracterData|omment|dataSection)|Text|Implementation|Document(Fragment)?|ProcessingInstruction|E(ntityReference|lement)|Attr)|ate(Time(I(nterface|mmutable)|Zone)?|Interval|Period))|U(n(derflowException|expectedValueException)|Converter)|JsonSerializable|finfo|P(har(Data|FileInfo)?|ool|DO(Statement)?|arentIterator)|E(v(S(tat|ignal)|Ch(ild|eck)|Timer|I(o|dle)|ent(B(uffer(Event)?|ase)|SslContext|Http(Request|Connection)?|Config|DnsBase|Util|Listener)?|P(eriodic|repare)|Embed|Fork|Watcher|Loop)?|rrorException|xception|mptyIterator)|V(8Js(Exception)?|arnish(Stat|Log|Admin))|KTaglib_(MPEG_(File|AudioProperties)|Tag|ID3v2_(Tag|Frame|AttachedPictureFrame))|QuickHash(StringIntHash|Int(S(tringHash|et)|Hash))|F(il(terIterator|esystemIterator)|ANNConnection)|mysqli(_(stmt|driver|warning|result))?|W(orker|eak(Map|ref))|L(imitIterator|o(cale|gicException)|ua(Closure)?|engthException|apack)|A(ppendIterator|PCIterator|rray(Iterator|Object|Access)))\\b", - "name": "support.class.builtin.php" - } - ] - }, - "class-name": { - "patterns": [ - { - "begin": "(?i)(?=\\\\?[a-z_0-9]+\\\\)", - "end": "(?i)([a-z_][a-z_0-9]*)?(?=[^a-z0-9_\\\\])", - "endCaptures": { - "1": { - "name": "support.class.php" - } - }, - "patterns": [ - { - "include": "#namespace" - } - ] - }, - { - "include": "#class-builtin" - }, - { - "begin": "(?=[\\\\a-zA-Z_])", - "end": "(?i)([a-z_][a-z_0-9]*)?(?=[^a-z0-9_\\\\])", - "endCaptures": { - "1": { - "name": "support.class.php" - } - }, - "patterns": [ - { - "include": "#namespace" - } - ] - } - ] - }, - "comments": { - "patterns": [ - { - "begin": "/\\*\\*(?:#@\\+)?\\s*$", - "captures": { - "0": { - "name": "punctuation.definition.comment.php" - } - }, - "comment": "This now only highlights a docblock if the first line contains only /**\n\t\t\t\t\t\t\t\t- this is to stop highlighting everything as invalid when people do comment banners with /******** ...\n\t\t\t\t\t\t\t\t- Now matches /**#@+ too - used for docblock templates: http://manual.phpdoc.org/HTMLframesConverter/default/phpDocumentor/tutorial_phpDocumentor.howto.pkg.html#basics.docblocktemplate", - "end": "\\*/", - "name": "comment.block.documentation.phpdoc.php", - "patterns": [ - { - "include": "#php_doc" - } - ] - }, - { - "begin": "/\\*", - "captures": { - "0": { - "name": "punctuation.definition.comment.php" - } - }, - "end": "\\*/", - "name": "comment.block.php" - }, - { - "begin": "(^[ \\t]+)?(?=//)", - "beginCaptures": { - "1": { - "name": "punctuation.whitespace.comment.leading.php" - } - }, - "end": "(?!\\G)", - "patterns": [ - { - "begin": "//", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.php" - } - }, - "end": "\\n|(?=\\?>)", - "name": "comment.line.double-slash.php" - } - ] - }, - { - "begin": "(^[ \\t]+)?(?=#)", - "beginCaptures": { - "1": { - "name": "punctuation.whitespace.comment.leading.php" - } - }, - "end": "(?!\\G)", - "patterns": [ - { - "begin": "#", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.php" - } - }, - "end": "\\n|(?=\\?>)", - "name": "comment.line.number-sign.php" - } - ] - } - ] - }, - "constants": { - "patterns": [ - { - "begin": "(?xi)(?=\n\t\t\t (\n\t\t\t (\\\\[a-z_][a-z_0-9]*\\\\[a-z_][a-z_0-9\\\\]*)|\n\t\t\t ([a-z_][a-z_0-9]*\\\\[a-z_][a-z_0-9\\\\]*)\n\t\t\t )\n\t\t\t [^a-z_0-9\\\\])", - "end": "(?i)([a-z_][a-z_0-9]*)?(?=[^a-z0-9_\\\\])", - "endCaptures": { - "1": { - "name": "constant.other.php" - } - }, - "patterns": [ - { - "include": "#namespace" - } - ] - }, - { - "begin": "(?=\\\\?[a-zA-Z_\\x{7f}-\\x{ff}])", - "end": "(?=[^\\\\a-zA-Z_\\x{7f}-\\x{ff}])", - "patterns": [ - { - "match": "(?i)\\b(TRUE|FALSE|NULL|__(FILE|DIR|FUNCTION|CLASS|METHOD|LINE|NAMESPACE)__|ON|OFF|YES|NO|NL|BR|TAB)\\b", - "name": "constant.language.php" - }, - { - "captures": { - "1": { - "name": "punctuation.separator.inheritance.php" - } - }, - "match": "(\\\\)?\\b(STD(IN|OUT|ERR)|ZEND_(THREAD_SAFE|DEBUG_BUILD)|DEFAULT_INCLUDE_PATH|P(HP_(R(OUND_HALF_(ODD|DOWN|UP|EVEN)|ELEASE_VERSION)|M(INOR_VERSION|A(XPATHLEN|JOR_VERSION))|BINDIR|S(HLIB_SUFFIX|YSCONFDIR|API)|CONFIG_FILE_(SCAN_DIR|PATH)|INT_(MAX|SIZE)|ZTS|O(S|UTPUT_HANDLER_(START|CONT|END))|D(EBUG|ATADIR)|URL_(SCHEME|HOST|USER|P(ORT|A(SS|TH))|QUERY|FRAGMENT)|PREFIX|E(XT(RA_VERSION|ENSION_DIR)|OL)|VERSION(_ID)?|WINDOWS_(NT_(SERVER|DOMAIN_CONTROLLER|WORKSTATION)|VERSION_(M(INOR|AJOR)|BUILD|S(UITEMASK|P_M(INOR|AJOR))|P(RODUCTTYPE|LATFORM)))|L(IBDIR|OCALSTATEDIR))|EAR_(INSTALL_DIR|EXTENSION_DIR))|E_(RECOVERABLE_ERROR|STRICT|NOTICE|CO(RE_(ERROR|WARNING)|MPILE_(ERROR|WARNING))|DEPRECATED|USER_(NOTICE|DEPRECATED|ERROR|WARNING)|PARSE|ERROR|WARNING|ALL))\\b", - "name": "support.constant.core.php" - }, - { - "captures": { - "1": { - "name": "punctuation.separator.inheritance.php" - } - }, - "match": "(\\\\)?\\b(RADIXCHAR|GROUPING|M(_(1_PI|SQRT(1_2|2|3|PI)|2_(SQRTPI|PI)|PI(_(2|4))?|E(ULER)?|L(N(10|2|PI)|OG(10E|2E)))|ON_(GROUPING|1(1|2|0)?|7|2|8|THOUSANDS_SEP|3|DECIMAL_POINT|9|4|5|6))|S(TR_PAD_(RIGHT|BOTH|LEFT)|ORT_(REGULAR|STRING|NUMERIC|DESC|LOCALE_STRING|ASC)|EEK_(SET|CUR|END))|H(TML_(SPECIALCHARS|ENTITIES)|ASH_HMAC)|YES(STR|EXPR)|N(_(S(IGN_POSN|EP_BY_SPACE)|CS_PRECEDES)|O(STR|EXPR)|EGATIVE_SIGN|AN)|C(R(YPT_(MD5|BLOWFISH|S(HA(256|512)|TD_DES|ALT_LENGTH)|EXT_DES)|NCYSTR|EDITS_(G(ROUP|ENERAL)|MODULES|SAPI|DOCS|QA|FULLPAGE|ALL))|HAR_MAX|O(NNECTION_(NORMAL|TIMEOUT|ABORTED)|DESET|UNT_(RECURSIVE|NORMAL))|URRENCY_SYMBOL|ASE_(UPPER|LOWER))|__COMPILER_HALT_OFFSET__|T(HOUS(EP|ANDS_SEP)|_FMT(_AMPM)?)|IN(T_(CURR_SYMBOL|FRAC_DIGITS)|I_(S(YSTEM|CANNER_(RAW|NORMAL))|USER|PERDIR|ALL)|F(O_(GENERAL|MODULES|C(REDITS|ONFIGURATION)|ENVIRONMENT|VARIABLES|LICENSE|ALL))?)|D(_(T_FMT|FMT)|IRECTORY_SEPARATOR|ECIMAL_POINT|A(Y_(1|7|2|3|4|5|6)|TE_(R(SS|FC(1(123|036)|2822|8(22|50)|3339))|COOKIE|ISO8601|W3C|ATOM)))|UPLOAD_ERR_(NO_(TMP_DIR|FILE)|CANT_WRITE|INI_SIZE|OK|PARTIAL|EXTENSION|FORM_SIZE)|P(M_STR|_(S(IGN_POSN|EP_BY_SPACE)|CS_PRECEDES)|OSITIVE_SIGN|ATH(_SEPARATOR|INFO_(BASENAME|DIRNAME|EXTENSION|FILENAME)))|E(RA(_(YEAR|T_FMT|D_(T_FMT|FMT)))?|XTR_(REFS|SKIP|IF_EXISTS|OVERWRITE|PREFIX_(SAME|I(NVALID|F_EXISTS)|ALL))|NT_(NOQUOTES|COMPAT|IGNORE|QUOTES))|FRAC_DIGITS|L(C_(M(ONETARY|ESSAGES)|NUMERIC|C(TYPE|OLLATE)|TIME|ALL)|O(G_(MAIL|SYSLOG|N(O(TICE|WAIT)|DELAY|EWS)|C(R(IT|ON)|ONS)|INFO|ODELAY|D(EBUG|AEMON)|U(SER|UCP)|P(ID|ERROR)|E(RR|MERG)|KERN|WARNING|L(OCAL(1|7|2|3|4|5|0|6)|PR)|A(UTH(PRIV)?|LERT))|CK_(SH|NB|UN|EX)))|A(M_STR|B(MON_(1(1|2|0)?|7|2|8|3|9|4|5|6)|DAY_(1|7|2|3|4|5|6))|SSERT_(BAIL|CALLBACK|QUIET_EVAL|WARNING|ACTIVE)|LT_DIGITS))\\b", - "name": "support.constant.std.php" - }, - { - "captures": { - "1": { - "name": "punctuation.separator.inheritance.php" - } - }, - "match": "(\\\\)?\\b(GLOB_(MARK|BRACE|NO(SORT|CHECK|ESCAPE)|ONLYDIR|ERR|AVAILABLE_FLAGS)|XML_(SAX_IMPL|HTML_DOCUMENT_NODE|N(OTATION_NODE|AMESPACE_DECL_NODE)|C(OMMENT_NODE|DATA_SECTION_NODE)|TEXT_NODE|OPTION_(SKIP_(TAGSTART|WHITE)|CASE_FOLDING|TARGET_ENCODING)|D(TD_NODE|OCUMENT_(NODE|TYPE_NODE|FRAG_NODE))|PI_NODE|E(RROR_(RECURSIVE_ENTITY_REF|MISPLACED_XML_PI|B(INARY_ENTITY_REF|AD_CHAR_REF)|SYNTAX|NO(NE|_(MEMORY|ELEMENTS))|TAG_MISMATCH|IN(CORRECT_ENCODING|VALID_TOKEN)|DUPLICATE_ATTRIBUTE|UN(CLOSED_(CDATA_SECTION|TOKEN)|DEFINED_ENTITY|KNOWN_ENCODING)|JUNK_AFTER_DOC_ELEMENT|PAR(TIAL_CHAR|AM_ENTITY_REF)|EXTERNAL_ENTITY_HANDLING|A(SYNC_ENTITY|TTRIBUTE_EXTERNAL_ENTITY_REF))|NTITY_(REF_NODE|NODE|DECL_NODE)|LEMENT_(NODE|DECL_NODE))|LOCAL_NAMESPACE|ATTRIBUTE_(N(MTOKEN(S)?|O(TATION|DE))|CDATA|ID(REF(S)?)?|DECL_NODE|EN(TITY|UMERATION)))|M(HASH_(RIPEMD(1(28|60)|256|320)|GOST|MD(2|4|5)|S(HA(1|2(24|56)|384|512)|NEFRU256)|HAVAL(1(28|92|60)|2(24|56))|CRC32(B)?|TIGER(1(28|60))?|WHIRLPOOL|ADLER32)|YSQL(_(BOTH|NUM|CLIENT_(SSL|COMPRESS|I(GNORE_SPACE|NTERACTIVE))|ASSOC)|I_(RE(PORT_(STRICT|INDEX|OFF|ERROR|ALL)|FRESH_(GRANT|MASTER|BACKUP_LOG|S(TATUS|LAVE)|HOSTS|T(HREADS|ABLES)|LOG)|AD_DEFAULT_(GROUP|FILE))|GROUP_FLAG|MULTIPLE_KEY_FLAG|B(INARY_FLAG|OTH|LOB_FLAG)|S(T(MT_ATTR_(CURSOR_TYPE|UPDATE_MAX_LENGTH|PREFETCH_ROWS)|ORE_RESULT)|E(RVER_QUERY_(NO_(GOOD_INDEX_USED|INDEX_USED)|WAS_SLOW)|T_(CHARSET_NAME|FLAG)))|N(O(_D(EFAULT_VALUE_FLAG|ATA)|T_NULL_FLAG)|UM(_FLAG)?)|C(URSOR_TYPE_(READ_ONLY|SCROLLABLE|NO_CURSOR|FOR_UPDATE)|LIENT_(SSL|NO_SCHEMA|COMPRESS|I(GNORE_SPACE|NTERACTIVE)|FOUND_ROWS))|T(YPE_(GEOMETRY|MEDIUM_BLOB|B(IT|LOB)|S(HORT|TRING|ET)|YEAR|N(ULL|EWD(ECIMAL|ATE))|CHAR|TI(ME(STAMP)?|NY(_BLOB)?)|INT(24|ERVAL)|D(OUBLE|ECIMAL|ATE(TIME)?)|ENUM|VAR_STRING|FLOAT|LONG(_BLOB|LONG)?)|IMESTAMP_FLAG)|INIT_COMMAND|ZEROFILL_FLAG|O(N_UPDATE_NOW_FLAG|PT_(NET_(READ_BUFFER_SIZE|CMD_BUFFER_SIZE)|CONNECT_TIMEOUT|INT_AND_FLOAT_NATIVE|LOCAL_INFILE))|D(EBUG_TRACE_ENABLED|ATA_TRUNCATED)|U(SE_RESULT|N(SIGNED_FLAG|IQUE_KEY_FLAG))|P(RI_KEY_FLAG|ART_KEY_FLAG)|ENUM_FLAG|A(S(SOC|YNC)|UTO_INCREMENT_FLAG)))|CRYPT_(R(C(2|6)|IJNDAEL_(1(28|92)|256)|AND)|GOST|XTEA|M(ODE_(STREAM|NOFB|C(BC|FB)|OFB|ECB)|ARS)|BLOWFISH(_COMPAT)?|S(ERPENT|KIPJACK|AFER(128|PLUS|64))|C(RYPT|AST_(128|256))|T(RIPLEDES|HREEWAY|WOFISH)|IDEA|3DES|DE(S|CRYPT|V_(RANDOM|URANDOM))|PANAMA|EN(CRYPT|IGNA)|WAKE|LOKI97|ARCFOUR(_IV)?))|S(TREAM_(REPORT_ERRORS|M(UST_SEEK|KDIR_RECURSIVE)|BUFFER_(NONE|FULL|LINE)|S(HUT_(RD(WR)?|WR)|OCK_(R(DM|AW)|S(TREAM|EQPACKET)|DGRAM)|ERVER_(BIND|LISTEN))|NOTIFY_(RE(SOLVE|DIRECTED)|MIME_TYPE_IS|SEVERITY_(INFO|ERR|WARN)|CO(MPLETED|NNECT)|PROGRESS|F(ILE_SIZE_IS|AILURE)|AUTH_RE(SULT|QUIRED))|C(RYPTO_METHOD_(SSLv(2(_(SERVER|CLIENT)|3_(SERVER|CLIENT))|3_(SERVER|CLIENT))|TLS_(SERVER|CLIENT))|LIENT_(CONNECT|PERSISTENT|ASYNC_CONNECT)|AST_(FOR_SELECT|AS_STREAM))|I(GNORE_URL|S_URL|PPROTO_(RAW|TCP|I(CMP|P)|UDP))|O(OB|PTION_(READ_(BUFFER|TIMEOUT)|BLOCKING|WRITE_BUFFER))|U(RL_STAT_(QUIET|LINK)|SE_PATH)|P(EEK|F_(INET(6)?|UNIX))|ENFORCE_SAFE_MODE|FILTER_(READ|WRITE|ALL))|UNFUNCS_RET_(STRING|TIMESTAMP|DOUBLE)|QLITE(_(R(OW|EADONLY)|MIS(MATCH|USE)|B(OTH|USY)|SCHEMA|N(O(MEM|T(FOUND|ADB)|LFS)|UM)|C(O(RRUPT|NSTRAINT)|ANTOPEN)|TOOBIG|I(NTER(RUPT|NAL)|OERR)|OK|DONE|P(ROTOCOL|ERM)|E(RROR|MPTY)|F(ORMAT|ULL)|LOCKED|A(BORT|SSOC|UTH))|3_(B(OTH|LOB)|NU(M|LL)|TEXT|INTEGER|OPEN_(READ(ONLY|WRITE)|CREATE)|FLOAT|ASSOC)))|CURL(M(SG_DONE|_(BAD_(HANDLE|EASY_HANDLE)|CALL_MULTI_PERFORM|INTERNAL_ERROR|O(UT_OF_MEMORY|K)))|SSH_AUTH_(HOST|NONE|DEFAULT|P(UBLICKEY|ASSWORD)|KEYBOARD)|CLOSEPOLICY_(SLOWEST|CALLBACK|OLDEST|LEAST_(RECENTLY_USED|TRAFFIC))|_(HTTP_VERSION_(1_(1|0)|NONE)|NETRC_(REQUIRED|IGNORED|OPTIONAL)|TIMECOND_(IF(MODSINCE|UNMODSINCE)|LASTMOD)|IPRESOLVE_(V(4|6)|WHATEVER)|VERSION_(SSL|IPV6|KERBEROS4|LIBZ))|INFO_(RE(DIRECT_(COUNT|TIME)|QUEST_SIZE)|S(SL_VERIFYRESULT|TARTTRANSFER_TIME|IZE_(DOWNLOAD|UPLOAD)|PEED_(DOWNLOAD|UPLOAD))|H(TTP_CODE|EADER_(SIZE|OUT))|NAMELOOKUP_TIME|C(ON(NECT_TIME|TENT_(TYPE|LENGTH_(DOWNLOAD|UPLOAD)))|ERTINFO)|TOTAL_TIME|PR(IVATE|ETRANSFER_TIME)|EFFECTIVE_URL|FILETIME)|OPT_(R(E(SUME_FROM|TURNTRANSFER|DIR_PROTOCOLS|FERER|AD(DATA|FUNCTION))|AN(GE|DOM_FILE))|MAX(REDIRS|CONNECTS)|B(INARYTRANSFER|UFFERSIZE)|S(S(H_(HOST_PUBLIC_KEY_MD5|P(RIVATE_KEYFILE|UBLIC_KEYFILE)|AUTH_TYPES)|L(CERT(TYPE|PASSWD)?|_(CIPHER_LIST|VERIFY(HOST|PEER))|ENGINE(_DEFAULT)?|VERSION|KEY(TYPE|PASSWD)?))|TDERR)|H(TTP(GET|HEADER|200ALIASES|_VERSION|PROXYTUNNEL|AUTH)|EADER(FUNCTION)?)|N(O(BODY|SIGNAL|PROGRESS)|ETRC)|C(RLF|O(NNECTTIMEOUT(_MS)?|OKIE(SESSION|JAR|FILE)?)|USTOMREQUEST|ERTINFO|LOSEPOLICY|A(INFO|PATH))|T(RANSFERTEXT|CP_NODELAY|IME(CONDITION|OUT(_MS)?|VALUE))|I(N(TERFACE|FILE(SIZE)?)|PRESOLVE)|DNS_(CACHE_TIMEOUT|USE_GLOBAL_CACHE)|U(RL|SER(PWD|AGENT)|NRESTRICTED_AUTH|PLOAD)|P(R(IVATE|O(GRESSFUNCTION|XY(TYPE|USERPWD|PORT|AUTH)?|TOCOLS))|O(RT|ST(REDIR|QUOTE|FIELDS)?)|UT)|E(GDSOCKET|NCODING)|VERBOSE|K(RB4LEVEL|EYPASSWD)|QUOTE|F(RESH_CONNECT|TP(SSLAUTH|_(S(SL|KIP_PASV_IP)|CREATE_MISSING_DIRS|USE_EP(RT|SV)|FILEMETHOD)|PORT|LISTONLY|APPEND)|ILE(TIME)?|O(RBID_REUSE|LLOWLOCATION)|AILONERROR)|WRITE(HEADER|FUNCTION)|LOW_SPEED_(TIME|LIMIT)|AUTOREFERER)|PRO(XY_(SOCKS(4|5)|HTTP)|TO_(S(CP|FTP)|HTTP(S)?|T(ELNET|FTP)|DICT|F(TP(S)?|ILE)|LDAP(S)?|ALL))|E_(RE(CV_ERROR|AD_ERROR)|GOT_NOTHING|MALFORMAT_USER|BAD_(C(ONTENT_ENCODING|ALLING_ORDER)|PASSWORD_ENTERED|FUNCTION_ARGUMENT)|S(S(H|L_(C(IPHER|ONNECT_ERROR|ERTPROBLEM|ACERT)|PEER_CERTIFICATE|ENGINE_(SETFAILED|NOTFOUND)))|HARE_IN_USE|END_ERROR)|HTTP_(RANGE_ERROR|NOT_FOUND|PO(RT_FAILED|ST_ERROR))|COULDNT_(RESOLVE_(HOST|PROXY)|CONNECT)|T(OO_MANY_REDIRECTS|ELNET_OPTION_SYNTAX)|O(BSOLETE|UT_OF_MEMORY|PERATION_TIMEOUTED|K)|U(RL_MALFORMAT(_USER)?|N(SUPPORTED_PROTOCOL|KNOWN_TELNET_OPTION))|PARTIAL_FILE|F(TP_(BAD_DOWNLOAD_RESUME|SSL_FAILED|C(OULDNT_(RETR_FILE|GET_SIZE|S(TOR_FILE|ET_(BINARY|ASCII))|USE_REST)|ANT_(RECONNECT|GET_HOST))|USER_PASSWORD_INCORRECT|PORT_FAILED|QUOTE_ERROR|W(RITE_ERROR|EIRD_(SERVER_REPLY|227_FORMAT|USER_REPLY|PAS(S_REPLY|V_REPLY)))|ACCESS_DENIED)|ILE(SIZE_EXCEEDED|_COULDNT_READ_FILE)|UNCTION_NOT_FOUND|AILED_INIT)|WRITE_ERROR|L(IBRARY_NOT_FOUND|DAP_(SEARCH_FAILED|CANNOT_BIND|INVALID_URL))|ABORTED_BY_CALLBACK)|VERSION_NOW|FTP(METHOD_(MULTICWD|SINGLECWD|NOCWD)|SSL_(NONE|CONTROL|TRY|ALL)|AUTH_(SSL|TLS|DEFAULT))|AUTH_(GSSNEGOTIATE|BASIC|NTLM|DIGEST|ANY(SAFE)?))|I(MAGETYPE_(GIF|XBM|BMP|SWF|COUNT|TIFF_(MM|II)|I(CO|FF)|UNKNOWN|J(B2|P(X|2|C|EG(2000)?))|P(SD|NG)|WBMP)|NPUT_(REQUEST|GET|SE(RVER|SSION)|COOKIE|POST|ENV)|CONV_(MIME_DECODE_(STRICT|CONTINUE_ON_ERROR)|IMPL|VERSION))|D(NS_(MX|S(RV|OA)|HINFO|N(S|APTR)|CNAME|TXT|PTR|A(NY|LL|AAA|6)?)|OM(STRING_SIZE_ERR|_(SYNTAX_ERR|HIERARCHY_REQUEST_ERR|N(O(_(MODIFICATION_ALLOWED_ERR|DATA_ALLOWED_ERR)|T_(SUPPORTED_ERR|FOUND_ERR))|AMESPACE_ERR)|IN(DEX_SIZE_ERR|USE_ATTRIBUTE_ERR|VALID_(MODIFICATION_ERR|STATE_ERR|CHARACTER_ERR|ACCESS_ERR))|PHP_ERR|VALIDATION_ERR|WRONG_DOCUMENT_ERR)))|JSON_(HEX_(TAG|QUOT|A(MP|POS))|NUMERIC_CHECK|ERROR_(S(YNTAX|TATE_MISMATCH)|NONE|CTRL_CHAR|DEPTH|UTF8)|FORCE_OBJECT)|P(REG_(RECURSION_LIMIT_ERROR|GREP_INVERT|BA(CKTRACK_LIMIT_ERROR|D_UTF8_(OFFSET_ERROR|ERROR))|S(PLIT_(NO_EMPTY|OFFSET_CAPTURE|DELIM_CAPTURE)|ET_ORDER)|NO_ERROR|INTERNAL_ERROR|OFFSET_CAPTURE|PATTERN_ORDER)|SFS_(PASS_ON|ERR_FATAL|F(EED_ME|LAG_(NORMAL|FLUSH_(CLOSE|INC))))|CRE_VERSION|OSIX_(R_OK|X_OK|S_IF(REG|BLK|SOCK|CHR|IFO)|F_OK|W_OK))|F(NM_(NOESCAPE|CASEFOLD|P(ERIOD|ATHNAME))|IL(TER_(REQUIRE_(SCALAR|ARRAY)|SANITIZE_(MAGIC_QUOTES|S(TRI(NG|PPED)|PECIAL_CHARS)|NUMBER_(INT|FLOAT)|URL|E(MAIL|NCODED)|FULL_SPECIAL_CHARS)|NULL_ON_FAILURE|CALLBACK|DEFAULT|UNSAFE_RAW|VALIDATE_(REGEXP|BOOLEAN|I(NT|P)|URL|EMAIL|FLOAT)|F(ORCE_ARRAY|LAG_(S(CHEME_REQUIRED|TRIP_(BACKTICK|HIGH|LOW))|HOST_REQUIRED|NO(NE|_(RES_RANGE|PRIV_RANGE|ENCODE_QUOTES))|IPV(4|6)|PATH_REQUIRED|E(MPTY_STRING_NULL|NCODE_(HIGH|LOW|AMP))|QUERY_REQUIRED|ALLOW_(SCIENTIFIC|HEX|THOUSAND|OCTAL|FRACTION))))|E(_(BINARY|SKIP_EMPTY_LINES|NO_DEFAULT_CONTEXT|TEXT|IGNORE_NEW_LINES|USE_INCLUDE_PATH|APPEND)|INFO_(RAW|MIME(_(TYPE|ENCODING))?|SYMLINK|NONE|CONTINUE|DEVICES|PRESERVE_ATIME)))|ORCE_(GZIP|DEFLATE))|LIBXML_(XINCLUDE|N(SCLEAN|O(XMLDECL|BLANKS|NET|CDATA|E(RROR|MPTYTAG|NT)|WARNING))|COMPACT|D(TD(VALID|LOAD|ATTR)|OTTED_VERSION)|PARSEHUGE|ERR_(NONE|ERROR|FATAL|WARNING)|VERSION|LOADED_VERSION))\\b", - "name": "support.constant.ext.php" - }, - { - "captures": { - "1": { - "name": "punctuation.separator.inheritance.php" - } - }, - "match": "(\\\\)?\\bT_(RE(TURN|QUIRE(_ONCE)?)|G(OTO|LOBAL)|XOR_EQUAL|M(INUS_EQUAL|OD_EQUAL|UL_EQUAL|ETHOD_C|L_COMMENT)|B(REAK|OOL(_CAST|EAN_(OR|AND))|AD_CHARACTER)|S(R(_EQUAL)?|T(RING(_(CAST|VARNAME))?|A(RT_HEREDOC|TIC))|WITCH|L(_EQUAL)?)|HALT_COMPILER|N(S_(SEPARATOR|C)|UM_STRING|EW|AMESPACE)|C(HARACTER|O(MMENT|N(ST(ANT_ENCAPSED_STRING)?|CAT_EQUAL|TINUE))|URLY_OPEN|L(O(SE_TAG|NE)|ASS(_C)?)|A(SE|TCH))|T(RY|HROW)|I(MPLEMENTS|S(SET|_(GREATER_OR_EQUAL|SMALLER_OR_EQUAL|NOT_(IDENTICAL|EQUAL)|IDENTICAL|EQUAL))|N(STANCEOF|C(LUDE(_ONCE)?)?|T(_CAST|ERFACE)|LINE_HTML)|F)|O(R_EQUAL|BJECT_(CAST|OPERATOR)|PEN_TAG(_WITH_ECHO)?|LD_FUNCTION)|D(NUMBER|I(R|V_EQUAL)|O(C_COMMENT|UBLE_(C(OLON|AST)|ARROW)|LLAR_OPEN_CURLY_BRACES)?|E(C(LARE)?|FAULT))|U(SE|NSET(_CAST)?)|P(R(I(NT|VATE)|OTECTED)|UBLIC|LUS_EQUAL|AAMAYIM_NEKUDOTAYIM)|E(X(TENDS|IT)|MPTY|N(CAPSED_AND_WHITESPACE|D(SWITCH|_HEREDOC|IF|DECLARE|FOR(EACH)?|WHILE))|CHO|VAL|LSE(IF)?)|VAR(IABLE)?|F(I(NAL|LE)|OR(EACH)?|UNC(_C|TION))|WHI(TESPACE|LE)|L(NUMBER|I(ST|NE)|OGICAL_(XOR|OR|AND))|A(RRAY(_CAST)?|BSTRACT|S|ND_EQUAL))\\b", - "name": "support.constant.parser-token.php" - }, - { - "comment": "In PHP, any identifier which is not a variable is taken to be a constant.\n \t\t\t\tHowever, if there is no constant defined with the given name then a notice\n \t\t\t\tis generated and the constant is assumed to have the value of its name.", - "match": "[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*", - "name": "constant.other.php" - } - ] - } - ] - }, - "function-arguments": { - "patterns": [ - { - "include": "#comments" - }, - { - "begin": "(?xi)\n\t\t\t\t\t\t\t\\s*(array) # Typehint\n\t\t\t\t\t\t\t\\s*(&)? \t\t\t\t\t# Reference\n\t\t\t\t\t\t\t\\s*((\\$+)[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*) # The variable name\n\t\t\t\t\t\t\t\\s*(=)\t# A default value\n\t\t\t\t\t\t\t\\s*(array)\\s*(\\()\n\t\t\t\t\t\t\t", - "beginCaptures": { - "1": { - "name": "storage.type.php" - }, - "2": { - "name": "storage.modifier.reference.php" - }, - "3": { - "name": "variable.other.php" - }, - "4": { - "name": "punctuation.definition.variable.php" - }, - "5": { - "name": "keyword.operator.assignment.php" - }, - "6": { - "name": "support.function.construct.php" - }, - "7": { - "name": "punctuation.definition.array.begin.php" - } - }, - "contentName": "meta.array.php", - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.definition.array.end.php" - } - }, - "name": "meta.function.argument.array.php", - "patterns": [ - { - "include": "#comments" - }, - { - "include": "#strings" - }, - { - "include": "#numbers" - } - ] - }, - { - "captures": { - "1": { - "name": "storage.type.php" - }, - "2": { - "name": "storage.modifier.reference.php" - }, - "3": { - "name": "variable.other.php" - }, - "4": { - "name": "punctuation.definition.variable.php" - }, - "5": { - "name": "keyword.operator.assignment.php" - }, - "6": { - "name": "constant.language.php" - }, - "7": { - "name": "punctuation.section.array.begin.php" - }, - "8": { - "patterns": [ - { - "include": "#parameter-default-types" - } - ] - }, - "9": { - "name": "punctuation.section.array.end.php" - }, - "10": { - "name": "invalid.illegal.non-null-typehinted.php" - } - }, - "match": "(?xi)\n\t\t\t\t\t\t\t\\s*(array|callable) # Typehint\n\t\t\t\t\t\t\t\\s*(&)? \t\t\t\t\t# Reference\n\t\t\t\t\t\t\t\\s*((\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*) # The variable name\n\t\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\t\\s*(?:(=)\\s*(?:(null)|(\\[)((?>[^\\[\\]]+|\\[\\g<8>\\])*)(\\])|((?:\\S*?\\(\\))|(?:\\S*?))))\t# A default value\n\t\t\t\t\t\t\t)?\n\t\t\t\t\t\t\t\\s*(?=,|\\)|/[/*]|\\#|$) # A closing parentheses (end of argument list) or a comma or a comment\n\t\t\t\t\t\t\t", - "name": "meta.function.argument.array.php" - }, - { - "begin": "(?i)(?=[a-z_0-9\\\\]*[a-z_][a-z_0-9]*\\s*&?\\s*(?:\\.\\.\\.)?\\$)", - "end": "(?=,|\\)|/[/*]|\\#|$)", - "name": "meta.function.argument.typehinted.php", - "patterns": [ - { - "include": "#class-name" - }, - { - "captures": { - "1": { - "name": "support.class.php" - }, - "2": { - "name": "storage.modifier.reference.php" - }, - "3": { - "name": "variable.other.php" - }, - "4": { - "name": "punctuation.definition.variable.php" - }, - "5": { - "name": "keyword.operator.assignment.php" - }, - "6": { - "name": "constant.language.php" - }, - "7": { - "name": "invalid.illegal.non-null-typehinted.php" - } - }, - "match": "(?xi)\n \t\t\t\t\t\t\t\\s*([a-z_][a-z_0-9]*)? # Typehinted class name\n \t\t\t\t\t\t\t\\s*(&)? \t\t\t\t\t# Reference\n \t\t\t\t\t\t\t\\s*(((?:\\.\\.\\.)?\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*) # The variable name\n \t\t\t\t\t\t\t(?:\n \t\t\t\t\t\t\t\t\\s*(?:(=)\\s*(?:(null)|((?:\\S*?\\(\\))|(?:\\S*?))))\t# A default value\n \t\t\t\t\t\t\t)?\n \t\t\t\t\t\t\t\\s*(?=,|\\)|/[/*]|\\#|$) # A closing parentheses (end of argument list) or a comma\n\t\t\t\t\t " - } - ] - }, - { - "captures": { - "1": { - "name": "storage.modifier.reference.php" - }, - "2": { - "name": "variable.other.php" - }, - "3": { - "name": "punctuation.definition.variable.php" - } - }, - "match": "(?:\\s*(&))?\\s*(((?:\\.\\.\\.)?\\$+)[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)\\s*(?=,|\\)|/[/*]|\\#)", - "name": "meta.function.argument.no-default.php" - }, - { - "begin": "(?:\\s*(&))?\\s*((\\$+)[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)(?:\\s*(=)\\s*)\\s*(?:(\\[)((?>[^\\[\\]]+|\\[\\g<6>\\])*)(\\]))?", - "captures": { - "1": { - "name": "storage.modifier.reference.php" - }, - "2": { - "name": "variable.other.php" - }, - "3": { - "name": "punctuation.definition.variable.php" - }, - "4": { - "name": "keyword.operator.assignment.php" - }, - "5": { - "name": "punctuation.section.array.begin.php" - }, - "6": { - "patterns": [ - { - "include": "#parameter-default-types" - } - ] - }, - "7": { - "name": "punctuation.section.array.end.php" - } - }, - "end": "(?=,|\\)|/[/*]|\\#)", - "name": "meta.function.argument.default.php", - "patterns": [ - { - "include": "#parameter-default-types" - } - ] - } - ] - }, - "function-call": { - "patterns": [ - { - "begin": "(?i)(?=\\\\?[a-z_0-9\\\\]+\\\\[a-z_][a-z0-9_]*\\s*\\()", - "comment": "Functions in a user-defined namespace (overrides any built-ins)", - "end": "(?=\\s*\\()", - "patterns": [ - { - "include": "#user-function-call" - } - ] - }, - { - "match": "(?i)\\b(print|echo)\\b", - "name": "support.function.construct.output.php" - }, - { - "begin": "(?i)(\\\\)?(?=\\b[a-z_][a-z_0-9]*\\s*\\()", - "beginCaptures": { - "1": { - "name": "punctuation.separator.inheritance.php" - } - }, - "comment": "Root namespace function calls (built-in or user)", - "end": "(?=\\s*\\()", - "patterns": [ - { - "match": "(?i)\\b(isset|unset|e(val|mpty)|list)(?=\\s*\\()", - "name": "support.function.construct.php" - }, - { - "include": "#support" - }, - { - "include": "#user-function-call" - } - ] - } - ] - }, - "heredoc": { - "patterns": [ - { - "begin": "(?=<<<\\s*(\"?)([a-zA-Z_]+[a-zA-Z0-9_]*)(\\1)\\s*$)", - "end": "(?!\\G)", - "injections": { - "*": { - "patterns": [ - { - "include": "#interpolation" - } - ] - } - }, - "name": "string.unquoted.heredoc.php", - "patterns": [ - { - "include": "#heredoc_interior" - } - ] - }, - { - "begin": "(?=<<<\\s*('?)([a-zA-Z_]+[a-zA-Z0-9_]*)(\\1)\\s*$)", - "end": "(?!\\G)", - "name": "string.unquoted.heredoc.nowdoc.php", - "patterns": [ - { - "include": "#heredoc_interior" - } - ] - } - ], - "repository": { - "heredoc_interior": { - "patterns": [ - { - "begin": "(<<<)\\s*(['\"]?)(HTML)(\\2)\\s*$\\n?", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.php" - }, - "1": { - "name": "punctuation.definition.string.php" - }, - "3": { - "name": "keyword.operator.heredoc.php" - } - }, - "contentName": "text.html", - "end": "^(\\3)\\b", - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.php" - }, - "1": { - "name": "keyword.operator.heredoc.php" - } - }, - "name": "meta.embedded.html", - "patterns": [ - { - "include": "text.html.basic" - } - ] - }, - { - "begin": "(<<<)\\s*(['\"]?)(XML)(\\2)\\s*$\\n?", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.php" - }, - "1": { - "name": "punctuation.definition.string.php" - }, - "3": { - "name": "keyword.operator.heredoc.php" - } - }, - "contentName": "text.xml", - "end": "^(\\3)\\b", - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.php" - }, - "1": { - "name": "keyword.operator.heredoc.php" - } - }, - "name": "meta.embedded.xml", - "patterns": [ - { - "include": "text.xml" - } - ] - }, - { - "begin": "(<<<)\\s*(['\"]?)(SQL)(\\2)\\s*$\\n?", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.php" - }, - "1": { - "name": "punctuation.definition.string.php" - }, - "3": { - "name": "keyword.operator.heredoc.php" - } - }, - "contentName": "source.sql", - "end": "^(\\3)\\b", - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.php" - }, - "1": { - "name": "keyword.operator.heredoc.php" - } - }, - "name": "meta.embedded.sql", - "patterns": [ - { - "include": "source.sql" - } - ] - }, - { - "begin": "(<<<)\\s*(['\"]?)(JAVASCRIPT)(\\2)\\s*$\\n?", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.php" - }, - "1": { - "name": "punctuation.definition.string.php" - }, - "3": { - "name": "keyword.operator.heredoc.php" - } - }, - "contentName": "source.js", - "end": "^(\\3)\\b", - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.php" - }, - "1": { - "name": "keyword.operator.heredoc.php" - } - }, - "name": "meta.embedded.js", - "patterns": [ - { - "include": "source.js" - } - ] - }, - { - "begin": "(<<<)\\s*(['\"]?)(JSON)(\\2)\\s*$\\n?", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.php" - }, - "1": { - "name": "punctuation.definition.string.php" - }, - "3": { - "name": "keyword.operator.heredoc.php" - } - }, - "contentName": "source.json", - "end": "^(\\3)\\b", - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.php" - }, - "1": { - "name": "keyword.operator.heredoc.php" - } - }, - "name": "meta.embedded.json", - "patterns": [ - { - "include": "source.json" - } - ] - }, - { - "begin": "(<<<)\\s*(['\"]?)(CSS)(\\2)\\s*$\\n?", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.php" - }, - "1": { - "name": "punctuation.definition.string.php" - }, - "3": { - "name": "keyword.operator.heredoc.php" - } - }, - "contentName": "source.css", - "end": "^(\\3)\\b", - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.php" - }, - "1": { - "name": "keyword.operator.heredoc.php" - } - }, - "name": "meta.embedded.css", - "patterns": [ - { - "include": "source.css" - } - ] - }, - { - "begin": "(<<<)\\s*(['\"]?)(REGEX)(\\2)\\s*$\\n?", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.php" - }, - "1": { - "name": "punctuation.definition.string.php" - }, - "3": { - "name": "keyword.operator.heredoc.php" - } - }, - "contentName": "string.regexp.heredoc.php", - "end": "^(\\3)\\b", - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.php" - }, - "1": { - "name": "keyword.operator.heredoc.php" - } - }, - "patterns": [ - { - "comment": "Escaped from the regexp – there can also be 2 backslashes (since 1 will escape the first)", - "match": "(\\\\){1,2}[.$^\\[\\]{}]", - "name": "constant.character.escape.regex.php" - }, - { - "captures": { - "1": { - "name": "punctuation.definition.arbitrary-repitition.php" - }, - "3": { - "name": "punctuation.definition.arbitrary-repitition.php" - } - }, - "match": "(\\{)\\d+(,\\d+)?(\\})", - "name": "string.regexp.arbitrary-repitition.php" - }, - { - "begin": "\\[(?:\\^?\\])?", - "captures": { - "0": { - "name": "punctuation.definition.character-class.php" - } - }, - "end": "\\]", - "name": "string.regexp.character-class.php", - "patterns": [ - { - "match": "\\\\[\\\\'\\[\\]]", - "name": "constant.character.escape.php" - } - ] - }, - { - "match": "[$^+*]", - "name": "keyword.operator.regexp.php" - }, - { - "begin": "(?<=^|\\s)(#)\\s(?=[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.comment.php" - } - }, - "comment": "We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.", - "end": "$\\n?", - "endCaptures": { - "0": { - "name": "punctuation.definition.comment.php" - } - }, - "name": "comment.line.number-sign.php" - } - ] - }, - { - "begin": "(<<<)\\s*(['\"]?)([a-zA-Z_]+[a-zA-Z0-9_]*)(\\2)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.string.php" - }, - "3": { - "name": "keyword.operator.heredoc.php" - } - }, - "end": "^(\\3)\\b", - "endCaptures": { - "1": { - "name": "keyword.operator.heredoc.php" - } - } - } - ] - } - } - }, - "instantiation": { - "begin": "(?i)(new)\\s+", - "beginCaptures": { - "1": { - "name": "keyword.other.new.php" - } - }, - "end": "(?i)(?=[^$a-z0-9_\\\\])", - "patterns": [ - { - "match": "(parent|static|self)(?=[^a-z0-9_])", - "name": "storage.type.php" - }, - { - "include": "#class-name" - }, - { - "include": "#variable-name" - } - ] - }, - "interpolation": { - "comment": "http://www.php.net/manual/en/language.types.string.php#language.types.string.parsing", - "patterns": [ - { - "match": "\\\\[0-7]{1,3}", - "name": "constant.numeric.octal.php" - }, - { - "match": "\\\\x[0-9A-Fa-f]{1,2}", - "name": "constant.numeric.hex.php" - }, - { - "match": "\\\\[enrt\\\\\\$\\\"]", - "name": "constant.character.escape.php" - }, - { - "begin": "(\\{)(?=\\$.*?\\})", - "beginCaptures": { - "1": { - "name": "punctuation.definition.variable.php" - } - }, - "end": "(\\})", - "endCaptures": { - "1": { - "name": "punctuation.definition.variable.php" - } - }, - "patterns": [ - { - "include": "#language" - } - ] - }, - { - "include": "#variable-name" - } - ] - }, - "invoke-call": { - "captures": { - "1": { - "name": "punctuation.definition.variable.php" - }, - "2": { - "name": "variable.other.php" - } - }, - "match": "(?i)(\\$+)([a-z_][a-z_0-9]*)(?=\\s*\\()", - "name": "meta.function-call.invoke.php" - }, - "language": { - "patterns": [ - { - "include": "#comments" - }, - { - "match": "\\{", - "name": "punctuation.section.scope.begin.php" - }, - { - "match": "\\}", - "name": "punctuation.section.scope.end.php" - }, - { - "begin": "(?i)^\\s*(interface)\\s+([a-z0-9_]+)\\s*(extends)?\\s*", - "beginCaptures": { - "1": { - "name": "storage.type.interface.php" - }, - "2": { - "name": "entity.name.type.interface.php" - }, - "3": { - "name": "storage.modifier.extends.php" - } - }, - "end": "((?:[a-zA-Z0-9_]+\\s*,\\s*)*)([a-zA-Z0-9_]+)?\\s*(?:(?=\\{)|$)", - "endCaptures": { - "1": { - "patterns": [ - { - "match": "[a-zA-Z0-9_]+", - "name": "entity.other.inherited-class.php" - }, - { - "match": ",", - "name": "punctuation.separator.classes.php" - } - ] - }, - "2": { - "name": "entity.other.inherited-class.php" - } - }, - "name": "meta.interface.php", - "patterns": [ - { - "include": "#namespace" - } - ] - }, - { - "begin": "(?i)^\\s*(trait)\\s+([a-z0-9_]+)", - "beginCaptures": { - "1": { - "name": "storage.type.trait.php" - }, - "2": { - "name": "entity.name.type.trait.php" - } - }, - "end": "(?=[{])", - "name": "meta.trait.php", - "patterns": [ - { - "include": "#comments" - } - ] - }, - { - "begin": "(?i)(?:^|(?<=<\\?php))\\s*(namespace)\\b\\s+(?=([a-z0-9_\\\\]+\\s*($|[;{]|(\\/[\\/*])))|$)", - "beginCaptures": { - "1": { - "name": "keyword.other.namespace.php" - } - }, - "contentName": "entity.name.type.namespace.php", - "end": "(?i)(?=\\s*$|[^a-z0-9_\\\\])", - "name": "meta.namespace.php", - "patterns": [ - { - "match": "\\\\", - "name": "punctuation.separator.inheritance.php" - } - ] - }, - { - "begin": "(?i)\\s*\\b(use)\\s+(?:((const)|(function))\\s+)?", - "beginCaptures": { - "1": { - "name": "keyword.other.use.php" - }, - "3": { - "name": "storage.type.const.php" - }, - "4": { - "name": "storage.type.function.php" - } - }, - "end": "(?=;|(?:^\\s*$))", - "name": "meta.use.php", - "patterns": [ - { - "include": "#comments" - }, - { - "begin": "(?i)\\s*(?=[a-z_0-9\\\\])", - "end": "(?xi)(?:\n \t\t\t (?:\\s*(as)\\b\\s*([a-z_0-9]*)\\s*(?=,|;|$))\n \t\t\t |(?=,|;|$)\n \t\t\t )", - "endCaptures": { - "1": { - "name": "keyword.other.use-as.php" - }, - "2": { - "name": "support.other.namespace.use-as.php" - } - }, - "patterns": [ - { - "include": "#class-builtin" - }, - { - "begin": "(?i)\\s*(?=[\\\\a-z_0-9])", - "end": "$|(?=[\\s,;])", - "name": "support.other.namespace.use.php", - "patterns": [ - { - "match": "\\\\", - "name": "punctuation.separator.inheritance.php" - } - ] - } - ] - }, - { - "match": "\\s*,\\s*" - } - ] - }, - { - "begin": "(?i)^\\s*(abstract|final)?\\s*(class)\\s+([a-z0-9_]+)\\s*", - "beginCaptures": { - "1": { - "name": "storage.modifier.abstract.php" - }, - "2": { - "name": "storage.type.class.php" - }, - "3": { - "name": "entity.name.type.class.php" - } - }, - "end": "(?=[;{])", - "name": "meta.class.php", - "patterns": [ - { - "include": "#comments" - }, - { - "begin": "(?i)(extends)\\s+", - "beginCaptures": { - "1": { - "name": "storage.modifier.extends.php" - } - }, - "contentName": "meta.other.inherited-class.php", - "end": "(?i)(?=[^a-z_0-9\\\\])", - "patterns": [ - { - "begin": "(?i)(?=\\\\?[a-z_0-9]+\\\\)", - "end": "(?i)([a-z_][a-z_0-9]*)?(?=[^a-z0-9_\\\\])", - "endCaptures": { - "1": { - "name": "entity.other.inherited-class.php" - } - }, - "patterns": [ - { - "include": "#namespace" - } - ] - }, - { - "include": "#class-builtin" - }, - { - "include": "#namespace" - }, - { - "match": "(?i)[a-z_][a-z_0-9]*", - "name": "entity.other.inherited-class.php" - } - ] - }, - { - "begin": "(?i)(implements)\\s+", - "beginCaptures": { - "1": { - "name": "storage.modifier.implements.php" - } - }, - "end": "(?i)(?=[;{])", - "patterns": [ - { - "include": "#comments" - }, - { - "begin": "(?i)(?=[a-z0-9_\\\\]+)", - "contentName": "meta.other.inherited-class.php", - "end": "(?i)(?:\\s*(?:,|(?=[^a-z0-9_\\\\\\s]))\\s*)", - "patterns": [ - { - "begin": "(?i)(?=\\\\?[a-z_0-9]+\\\\)", - "end": "(?i)([a-z_][a-z_0-9]*)?(?=[^a-z0-9_\\\\])", - "endCaptures": { - "1": { - "name": "entity.other.inherited-class.php" - } - }, - "patterns": [ - { - "include": "#namespace" - } - ] - }, - { - "include": "#class-builtin" - }, - { - "include": "#namespace" - }, - { - "match": "(?i)[a-z_][a-z_0-9]*", - "name": "entity.other.inherited-class.php" - } - ] - } - ] - } - ] - }, - { - "captures": { - "1": { - "name": "keyword.control.php" - } - }, - "match": "\\s*\\b((break|c(ase|ontinue)|d(e(clare|fault)|ie|o)|e(lse(if)?|nd(declare|for(each)?|if|switch|while)|xit)|for(each)?|if|return|switch|use|while|yield))\\b" - }, - { - "begin": "(?i)\\b((?:require|include)(?:_once)?)\\b\\s*", - "beginCaptures": { - "1": { - "name": "keyword.control.import.include.php" - } - }, - "end": "(?=\\s|;|$)", - "name": "meta.include.php", - "patterns": [ - { - "include": "#language" - } - ] - }, - { - "begin": "\\b(catch)\\b\\s*\\(\\s*", - "beginCaptures": { - "1": { - "name": "keyword.control.exception.catch.php" - } - }, - "end": "([A-Za-z_][A-Za-z_0-9]*)\\s*((\\$+)[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)\\s*\\)", - "endCaptures": { - "1": { - "name": "support.class.exception.php" - }, - "2": { - "name": "variable.other.php" - }, - "3": { - "name": "punctuation.definition.variable.php" - } - }, - "name": "meta.catch.php", - "patterns": [ - { - "include": "#namespace" - } - ] - }, - { - "match": "\\b(catch|try|throw|exception|finally)\\b", - "name": "keyword.control.exception.php" - }, - { - "begin": "(?i)\\b(function)\\s*(&\\s*)?(?=\\()", - "beginCaptures": { - "1": { - "name": "storage.type.function.php" - }, - "2": { - "name": "storage.modifier.reference.php" - } - }, - "end": "(?=\\{)", - "name": "meta.function.closure.php", - "patterns": [ - { - "begin": "(\\()", - "beginCaptures": { - "1": { - "name": "punctuation.definition.parameters.begin.php" - } - }, - "contentName": "meta.function.arguments.php", - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.definition.parameters.end.php" - } - }, - "patterns": [ - { - "include": "#function-arguments" - } - ] - }, - { - "begin": "(?i)(use)\\s*(\\()", - "beginCaptures": { - "1": { - "name": "keyword.other.function.use.php" - }, - "2": { - "name": "punctuation.definition.parameters.begin.php" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.definition.parameters.end.php" - } - }, - "patterns": [ - { - "captures": { - "1": { - "name": "storage.modifier.reference.php" - }, - "2": { - "name": "variable.other.php" - }, - "3": { - "name": "punctuation.definition.variable.php" - } - }, - "match": "(?:\\s*(&))?\\s*((\\$+)[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)\\s*(?=,|\\))", - "name": "meta.function.closure.use.php" - } - ] - } - ] - }, - { - "begin": "(?x)\\s*\n\t\t\t\t\t ((?:(?:final|abstract|public|private|protected|static)\\s+)*)\n\t\t\t\t (function)\n\t\t\t\t (?:\\s+|(\\s*&\\s*))\n\t\t\t\t (?:\n\t\t\t\t (__(?:call|construct|debugInfo|destruct|get|set|isset|unset|tostring|clone|set_state|sleep|wakeup|autoload|invoke|callStatic))\n\t\t\t\t |([a-zA-Z0-9_]+)\n\t\t\t\t )\n\t\t\t\t \\s*\n\t\t\t\t (\\()", - "beginCaptures": { - "1": { - "patterns": [ - { - "match": "final|abstract|public|private|protected|static", - "name": "storage.modifier.php" - } - ] - }, - "2": { - "name": "storage.type.function.php" - }, - "3": { - "name": "storage.modifier.reference.php" - }, - "4": { - "name": "support.function.magic.php" - }, - "5": { - "name": "entity.name.function.php" - }, - "6": { - "name": "punctuation.definition.parameters.begin.php" - } - }, - "contentName": "meta.function.arguments.php", - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.definition.parameters.end.php" - } - }, - "name": "meta.function.php", - "patterns": [ - { - "include": "#function-arguments" - } - ] - }, - { - "include": "#invoke-call" - }, - { - "begin": "(?xi)\\s*(?=\n\t\t\t\t [a-z_0-9$\\\\]+(::)\n (?:\n \t\t\t\t ([a-z_][a-z_0-9]*)\\s*\\(\n \t\t\t\t |\n \t\t\t\t ((\\$+)[a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\n \t\t\t\t |\n \t\t\t\t ([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)\n \t\t\t\t)?\n\t\t\t\t )", - "end": "(?x)(::)\n (?:\n \t\t\t\t ([A-Za-z_][A-Za-z_0-9]*)\\s*\\(\n \t\t\t\t |\n \t\t\t\t ((\\$+)[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)\n \t\t\t\t |\n \t\t\t\t ([a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)\n \t\t\t\t)?", - "endCaptures": { - "1": { - "name": "keyword.operator.class.php" - }, - "2": { - "name": "meta.function-call.static.php" - }, - "3": { - "name": "variable.other.class.php" - }, - "4": { - "name": "punctuation.definition.variable.php" - }, - "5": { - "name": "constant.other.class.php" - } - }, - "patterns": [ - { - "match": "(self|static|parent)\\b", - "name": "storage.type.php" - }, - { - "include": "#class-name" - }, - { - "include": "#variable-name" - } - ] - }, - { - "include": "#variables" - }, - { - "include": "#strings" - }, - { - "captures": { - "1": { - "name": "support.function.construct.php" - }, - "2": { - "name": "punctuation.definition.array.begin.php" - }, - "3": { - "name": "punctuation.definition.array.end.php" - } - }, - "match": "(array)(\\()(\\))", - "name": "meta.array.empty.php" - }, - { - "begin": "(array)(\\()", - "beginCaptures": { - "1": { - "name": "support.function.construct.php" - }, - "2": { - "name": "punctuation.definition.array.begin.php" - } - }, - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.definition.array.end.php" - } - }, - "name": "meta.array.php", - "patterns": [ - { - "include": "#language" - } - ] - }, - { - "captures": { - "1": { - "name": "storage.type.php" - } - }, - "match": "(?i)\\s*\\(\\s*(array|real|double|float|int(eger)?|bool(ean)?|string|object|binary|unset)\\s*\\)" - }, - { - "match": "(?i)\\b(array|real|double|float|int(eger)?|bool(ean)?|string|class|clone|var|function|interface|trait|parent|self|object)\\b", - "name": "storage.type.php" - }, - { - "match": "(?i)\\b(global|abstract|const|extends|implements|final|p(r(ivate|otected)|ublic)|static)\\b", - "name": "storage.modifier.php" - }, - { - "include": "#object" - }, - { - "match": ";", - "name": "punctuation.terminator.expression.php" - }, - { - "include": "#heredoc" - }, - { - "match": "\\.=?", - "name": "keyword.operator.string.php" - }, - { - "match": "=>", - "name": "keyword.operator.key.php" - }, - { - "captures": { - "1": { - "name": "keyword.operator.assignment.php" - }, - "2": { - "name": "storage.modifier.reference.php" - }, - "3": { - "name": "storage.modifier.reference.php" - } - }, - "match": "(?:(\\=)(&))|(&(?=[$A-Za-z_]))" - }, - { - "match": "(@)", - "name": "keyword.operator.error-control.php" - }, - { - "match": "(===|==|!==|!=|<>)", - "name": "keyword.operator.comparison.php" - }, - { - "match": "=|\\+=|\\-=|\\*=|/=|%=|&=|\\|=|\\^=|<<=|>>=", - "name": "keyword.operator.assignment.php" - }, - { - "match": "(<=|>=|<|>)", - "name": "keyword.operator.comparison.php" - }, - { - "match": "(\\-\\-|\\+\\+)", - "name": "keyword.operator.increment-decrement.php" - }, - { - "match": "(\\-|\\+|\\*|/|%)", - "name": "keyword.operator.arithmetic.php" - }, - { - "match": "(?i)(!|&&|\\|\\|)|\\b(and|or|xor|as)\\b", - "name": "keyword.operator.logical.php" - }, - { - "include": "#function-call" - }, - { - "match": "<<|>>|~|\\^|&|\\|", - "name": "keyword.operator.bitwise.php" - }, - { - "begin": "(?i)\\b(instanceof)\\b\\s+(?=[\\\\$a-z_])", - "beginCaptures": { - "1": { - "name": "keyword.operator.type.php" - } - }, - "end": "(?=[^\\\\$A-Za-z_0-9])", - "patterns": [ - { - "include": "#class-name" - }, - { - "include": "#variable-name" - } - ] - }, - { - "include": "#numbers" - }, - { - "include": "#instantiation" - }, - { - "captures": { - "1": { - "name": "keyword.control.goto.php" - }, - "2": { - "name": "support.other.php" - } - }, - "match": "(?i)(goto)\\s+([a-z_][a-z_0-9]*)" - }, - { - "captures": { - "1": { - "name": "entity.name.goto-label.php" - } - }, - "match": "(?i)^\\s*([a-z_][a-z_0-9]*)\\s*:" - }, - { - "include": "#string-backtick" - }, - { - "begin": "\\[", - "beginCaptures": { - "0": { - "name": "punctuation.section.array.begin.php" - } - }, - "end": "\\]", - "endCaptures": { - "0": { - "name": "punctuation.section.array.end.php" - } - }, - "patterns": [ - { - "include": "#language" - } - ] - }, - { - "include": "#constants" - } - ] - }, - "namespace": { - "begin": "(?i)(?:(namespace)|[a-z0-9_]+)?(\\\\)(?=.*?[^a-z_0-9\\\\])", - "beginCaptures": { - "1": { - "name": "variable.language.namespace.php" - }, - "2": { - "name": "punctuation.separator.inheritance.php" - } - }, - "end": "(?i)(?=[a-z0-9_]*[^a-z0-9_\\\\])", - "name": "support.other.namespace.php", - "patterns": [ - { - "captures": { - "1": { - "name": "punctuation.separator.inheritance.php" - } - }, - "match": "(?i)(\\\\)" - } - ] - }, - "numbers": { - "match": "\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)\\b", - "name": "constant.numeric.php" - }, - "object": { - "patterns": [ - { - "begin": "(->)(\\$?\\{)", - "beginCaptures": { - "1": { - "name": "keyword.operator.class.php" - }, - "2": { - "name": "punctuation.definition.variable.php" - } - }, - "end": "(\\})", - "endCaptures": { - "1": { - "name": "punctuation.definition.variable.php" - } - }, - "patterns": [ - { - "include": "#language" - } - ] - }, - { - "captures": { - "1": { - "name": "keyword.operator.class.php" - }, - "2": { - "name": "meta.function-call.object.php" - }, - "3": { - "name": "variable.other.property.php" - }, - "4": { - "name": "punctuation.definition.variable.php" - } - }, - "match": "(?x)(->)\n \t\t\t\t(?:\n \t\t\t\t ([A-Za-z_][A-Za-z_0-9]*)\\s*\\(\n \t\t\t\t |\n \t\t\t\t ((\\$+)?[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)\n \t\t\t\t)?" - } - ] - }, - "parameter-default-types": { - "patterns": [ - { - "include": "#strings" - }, - { - "include": "#numbers" - }, - { - "include": "#string-backtick" - }, - { - "include": "#variables" - }, - { - "match": "=>", - "name": "keyword.operator.key.php" - }, - { - "match": "=", - "name": "keyword.operator.assignment.php" - }, - { - "match": "&(?=\\s*\\$)", - "name": "storage.modifier.reference.php" - }, - { - "begin": "(array)\\s*(\\()", - "beginCaptures": { - "1": { - "name": "support.function.construct.php" - }, - "2": { - "name": "punctuation.definition.array.begin.php" - } - }, - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.definition.array.end.php" - } - }, - "name": "meta.array.php", - "patterns": [ - { - "include": "#parameter-default-types" - } - ] - }, - { - "include": "#instantiation" - }, - { - "begin": "(?xi)\\s*(?=\n\t\t\t\t [a-z_0-9\\\\]+(::)\n \t\t\t\t ([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)?\n\t\t\t\t )", - "end": "(?i)(::)([a-z_\\x{7f}-\\x{ff}][a-z0-9_\\x{7f}-\\x{ff}]*)?", - "endCaptures": { - "1": { - "name": "keyword.operator.class.php" - }, - "2": { - "name": "constant.other.class.php" - } - }, - "patterns": [ - { - "include": "#class-name" - } - ] - }, - { - "include": "#constants" - } - ] - }, - "php_doc": { - "patterns": [ - { - "comment": "PHPDocumentor only recognises lines with an asterisk as the first non-whitespaces character", - "match": "^(?!\\s*\\*).*$\\n?", - "name": "invalid.illegal.missing-asterisk.phpdoc.php" - }, - { - "captures": { - "1": { - "name": "keyword.other.phpdoc.php" - }, - "3": { - "name": "storage.modifier.php" - }, - "4": { - "name": "invalid.illegal.wrong-access-type.phpdoc.php" - } - }, - "match": "^\\s*\\*\\s*(@access)\\s+((public|private|protected)|(.+))\\s*$" - }, - { - "captures": { - "1": { - "name": "keyword.other.phpdoc.php" - }, - "2": { - "name": "markup.underline.link.php" - } - }, - "match": "(@xlink)\\s+(.+)\\s*$" - }, - { - "match": "\\@(a(pi|bstract|uthor)|c(ategory|opyright)|example|global|internal|li(cense|nk)|method|p(roperty(\\-read|\\-write|)|ackage|aram)|return|s(ee|ince|ource|tatic|ubpackage)|t(hrows|odo)|v(ar|ersion)|uses|deprecated|final|ignore)\\b", - "name": "keyword.other.phpdoc.php" - }, - { - "captures": { - "1": { - "name": "keyword.other.phpdoc.php" - } - }, - "match": "\\{(@(link)).+?\\}", - "name": "meta.tag.inline.phpdoc.php" - } - ] - }, - "regex-double-quoted": { - "begin": "(?x)\"/ (?= (\\\\.|[^\"/])++/[imsxeADSUXu]*\" )", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.php" - } - }, - "end": "(/)([imsxeADSUXu]*)(\")", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.php" - } - }, - "name": "string.regexp.double-quoted.php", - "patterns": [ - { - "comment": "Escaped from the regexp – there can also be 2 backslashes (since 1 will escape the first)", - "match": "(\\\\){1,2}[.$^\\[\\]{}]", - "name": "constant.character.escape.regex.php" - }, - { - "include": "#interpolation" - }, - { - "captures": { - "1": { - "name": "punctuation.definition.arbitrary-repetition.php" - }, - "3": { - "name": "punctuation.definition.arbitrary-repetition.php" - } - }, - "match": "(\\{)\\d+(,\\d+)?(\\})", - "name": "string.regexp.arbitrary-repetition.php" - }, - { - "begin": "\\[(?:\\^?\\])?", - "captures": { - "0": { - "name": "punctuation.definition.character-class.php" - } - }, - "end": "\\]", - "name": "string.regexp.character-class.php", - "patterns": [ - { - "include": "#interpolation" - } - ] - }, - { - "match": "[$^+*]", - "name": "keyword.operator.regexp.php" - } - ] - }, - "regex-single-quoted": { - "begin": "(?x)'/ (?= ( \\\\ (?: \\\\ (?: \\\\ [\\\\']? | [^'] ) | . ) | [^'/] )++/[imsxeADSUXu]*' )", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.php" - } - }, - "end": "(/)([imsxeADSUXu]*)(')", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.php" - } - }, - "name": "string.regexp.single-quoted.php", - "patterns": [ - { - "captures": { - "1": { - "name": "punctuation.definition.arbitrary-repetition.php" - }, - "3": { - "name": "punctuation.definition.arbitrary-repetition.php" - } - }, - "match": "(\\{)\\d+(,\\d+)?(\\})", - "name": "string.regexp.arbitrary-repetition.php" - }, - { - "begin": "\\[(?:\\^?\\])?", - "captures": { - "0": { - "name": "punctuation.definition.character-class.php" - } - }, - "end": "\\]", - "name": "string.regexp.character-class.php", - "patterns": [ - { - "include": "#single_quote_regex_escape" - } - ] - }, - { - "match": "[$^+*]", - "name": "keyword.operator.regexp.php" - }, - { - "include": "#single_quote_regex_escape" - } - ], - "repository": { - "single_quote_regex_escape": { - "comment": "Support both PHP string and regex escaping", - "match": "(?x) \\\\ (?: \\\\ (?: \\\\ [\\\\']? | [^'] ) | . )", - "name": "constant.character.escape.php" - } - } - }, - "sql-string-double-quoted": { - "begin": "\"\\s*(?=(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER)\\b)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.php" - } - }, - "contentName": "source.sql.embedded.php", - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.php" - } - }, - "name": "string.quoted.double.sql.php", - "patterns": [ - { - "match": "#(\\\\\"|[^\"])*(?=\"|$\\n?)", - "name": "comment.line.number-sign.sql" - }, - { - "match": "--(\\\\\"|[^\"])*(?=\"|$\\n?)", - "name": "comment.line.double-dash.sql" - }, - { - "match": "\\\\[\\\\\"`']", - "name": "constant.character.escape.php" - }, - { - "comment": "Unclosed strings must be captured to avoid them eating the remainder of the PHP script\n\t\t\t\t\tSample case: $sql = \"SELECT * FROM bar WHERE foo = '\" . $variable . \"'\"", - "match": "'(?=((\\\\')|[^'\"])*(\"|$))", - "name": "string.quoted.single.unclosed.sql" - }, - { - "comment": "Unclosed strings must be captured to avoid them eating the remainder of the PHP script\n\t\t\t\t\tSample case: $sql = \"SELECT * FROM bar WHERE foo = '\" . $variable . \"'\"", - "match": "`(?=((\\\\`)|[^`\"])*(\"|$))", - "name": "string.quoted.other.backtick.unclosed.sql" - }, - { - "begin": "'", - "end": "'", - "name": "string.quoted.single.sql", - "patterns": [ - { - "include": "#interpolation" - } - ] - }, - { - "begin": "`", - "end": "`", - "name": "string.quoted.other.backtick.sql", - "patterns": [ - { - "include": "#interpolation" - } - ] - }, - { - "include": "#interpolation" - }, - { - "include": "source.sql" - } - ] - }, - "sql-string-single-quoted": { - "begin": "'\\s*(?=(SELECT|INSERT|UPDATE|DELETE|CREATE|REPLACE|ALTER)\\b)", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.php" - } - }, - "contentName": "source.sql.embedded.php", - "end": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.php" - } - }, - "name": "string.quoted.single.sql.php", - "patterns": [ - { - "match": "#(\\\\'|[^'])*(?='|$\\n?)", - "name": "comment.line.number-sign.sql" - }, - { - "match": "--(\\\\'|[^'])*(?='|$\\n?)", - "name": "comment.line.double-dash.sql" - }, - { - "match": "\\\\[\\\\'`\"]", - "name": "constant.character.escape.php" - }, - { - "comment": "Unclosed strings must be captured to avoid them eating the remainder of the PHP script\n\t\t\t\t\tSample case: $sql = \"SELECT * FROM bar WHERE foo = '\" . $variable . \"'\"", - "match": "`(?=((\\\\`)|[^`'])*('|$))", - "name": "string.quoted.other.backtick.unclosed.sql" - }, - { - "comment": "Unclosed strings must be captured to avoid them eating the remainder of the PHP script\n\t\t\t\t\tSample case: $sql = \"SELECT * FROM bar WHERE foo = '\" . $variable . \"'\"", - "match": "\"(?=((\\\\\")|[^\"'])*('|$))", - "name": "string.quoted.double.unclosed.sql" - }, - { - "include": "source.sql" - } - ] - }, - "string-backtick": { - "begin": "`", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.php" - } - }, - "end": "`", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.php" - } - }, - "name": "string.interpolated.php", - "patterns": [ - { - "match": "\\\\.", - "name": "constant.character.escape.php" - }, - { - "include": "#interpolation" - } - ] - }, - "string-double-quoted": { - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.php" - } - }, - "comment": "This contentName is just to allow the usage of “select scope” to select the string contents first, then the string with quotes", - "contentName": "meta.string-contents.quoted.double.php", - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.php" - } - }, - "name": "string.quoted.double.php", - "patterns": [ - { - "include": "#interpolation" - } - ] - }, - "string-single-quoted": { - "begin": "'", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.php" - } - }, - "contentName": "meta.string-contents.quoted.single.php", - "end": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.php" - } - }, - "name": "string.quoted.single.php", - "patterns": [ - { - "match": "\\\\[\\\\']", - "name": "constant.character.escape.php" - } - ] - }, - "strings": { - "patterns": [ - { - "include": "#regex-double-quoted" - }, - { - "include": "#sql-string-double-quoted" - }, - { - "include": "#string-double-quoted" - }, - { - "include": "#regex-single-quoted" - }, - { - "include": "#sql-string-single-quoted" - }, - { - "include": "#string-single-quoted" - } - ] - }, - "support": { - "patterns": [ - { - "match": "(?i)\\bapc_(s(tore|ma_info)|c(ompile_file|lear_cache|a(s|che_info))|inc|de(c|fine_constants|lete(_file)?)|exists|fetch|load_constants|add|bin_(dump(file)?|load(file)?))\\b", - "name": "support.function.apc.php" - }, - { - "match": "(?i)\\b(s(huffle|izeof|ort)|n(ext|at(sort|casesort))|c(o(unt|mpact)|urrent)|in_array|u(sort|ksort|asort)|p(os|rev)|e(nd|ach|xtract)|k(sort|ey(_exists)?|rsort)|list|a(sort|r(sort|ray(_(s(hift|um|plice|earch|lice)|c(h(unk|ange_key_case)|o(unt_values|lumn|mbine))|intersect(_(u(key|assoc)|key|assoc))?|diff(_(u(key|assoc)|key|assoc))?|u(n(shift|ique)|intersect(_(uassoc|assoc))?|diff(_(uassoc|assoc))?)|p(op|ush|ad|roduct)|values|key(s|_exists)|f(il(ter|l(_keys)?)|lip)|walk(_recursive)?|r(e(duce|place(_recursive)?|verse)|and)|m(ultisort|erge(_recursive)?|ap)))?))|r(sort|eset|ange))\\b", - "name": "support.function.array.php" - }, - { - "match": "(?i)\\b(s(how_source|ys_getloadavg|leep)|highlight_(string|file)|con(stant|nection_(status|aborted))|time_(sleep_until|nanosleep)|ignore_user_abort|d(ie|efine(d)?)|u(sleep|n(iqid|pack))|__halt_compiler|p(hp_(strip_whitespace|check_syntax)|ack)|e(val|xit)|get_browser)\\b", - "name": "support.function.basic_functions.php" - }, - { - "match": "(?i)\\bbc(s(cale|ub|qrt)|comp|div|pow(mod)?|add|m(od|ul))\\b", - "name": "support.function.bcmath.php" - }, - { - "match": "(?i)\\bblenc_encrypt\\b", - "name": "support.function.blenc.php" - }, - { - "match": "(?i)\\bbz(c(ompress|lose)|open|decompress|err(str|no|or)|flush|write|read)\\b", - "name": "support.function.bz2.php" - }, - { - "match": "(?i)\\b(GregorianToJD|cal_(to_jd|info|days_in_month|from_jd)|unixtojd|jdto(unix|jewish)|easter_da(ys|te)|J(ulianToJD|ewishToJD|D(MonthName|To(Gregorian|Julian|French)|DayOfWeek))|FrenchToJD)\\b", - "name": "support.function.calendar.php" - }, - { - "match": "(?i)\\b(c(lass_(exists|alias)|all_user_method(_array)?)|trait_exists|i(s_(subclass_of|a)|nterface_exists)|__autoload|property_exists|get_(c(lass(_(vars|methods))?|alled_class)|object_vars|declared_(classes|traits|interfaces)|parent_class)|method_exists)\\b", - "name": "support.function.classobj.php" - }, - { - "match": "(?i)\\b(com_(create_guid|print_typeinfo|event_sink|load_typelib|get_active_object|message_pump)|variant_(s(ub|et(_type)?)|n(ot|eg)|c(a(st|t)|mp)|i(nt|div|mp)|or|d(iv|ate_(to_timestamp|from_timestamp))|pow|eqv|fix|a(nd|dd|bs)|round|get_type|xor|m(od|ul)))\\b", - "name": "support.function.com.php" - }, - { - "match": "(?i)\\bctype_(space|cntrl|digit|upper|p(unct|rint)|lower|al(num|pha)|graph|xdigit)\\b", - "name": "support.function.ctype.php" - }, - { - "match": "(?i)\\bcurl_(s(hare_(setopt|close|init)|trerror|etopt(_array)?)|c(opy_handle|lose)|init|unescape|pause|e(scape|rr(no|or)|xec)|version|file_create|reset|getinfo|multi_(s(trerror|e(topt|lect))|close|in(it|fo_read)|exec|add_handle|remove_handle|getcontent))\\b", - "name": "support.function.curl.php" - }, - { - "match": "(?i)\\b(str(totime|ptime|ftime)|checkdate|time(zone_(name_(from_abbr|get)|transitions_get|identifiers_list|o(pen|ffset_get)|version_get|location_get|abbreviations_list))?|idate|date(_(su(n(set|_info|rise)|b)|create(_(immutable(_from_format)?|from_format))?|time(stamp_(set|get)|zone_(set|get)|_set)|i(sodate_set|nterval_(create_from_date_string|format))|offset_get|d(iff|efault_timezone_(set|get)|ate_set)|parse(_from_format)?|format|add|get_last_errors|modify))?|localtime|g(et(timeofday|date)|m(strftime|date|mktime))|m(icrotime|ktime))\\b", - "name": "support.function.datetime.php" - }, - { - "match": "(?i)\\bdba_(sync|handlers|nextkey|close|insert|op(timize|en)|delete|popen|exists|key_split|f(irstkey|etch)|list|replace)\\b", - "name": "support.function.dba.php" - }, - { - "match": "(?i)\\bdbx_(sort|c(o(nnect|mpare)|lose)|e(scape_string|rror)|query|fetch_row)\\b", - "name": "support.function.dbx.php" - }, - { - "match": "(?i)\\b(scandir|c(h(dir|root)|losedir)|opendir|dir|re(winddir|addir)|getcwd)\\b", - "name": "support.function.dir.php" - }, - { - "match": "(?i)\\beio_(s(y(nc(_file_range|fs)?|mlink)|tat(vfs)?|e(ndfile|t_m(in_parallel|ax_(idle|p(oll_(time|reqs)|arallel)))|ek))|n(threads|op|pending|re(qs|ady))|c(h(own|mod)|ustom|lose|ancel)|truncate|init|open|dup2|u(nlink|time)|poll|event_loop|f(s(ync|tat(vfs)?)|ch(own|mod)|truncate|datasync|utime|allocate)|write|l(stat|ink)|r(e(name|a(d(dir|link|ahead)?|lpath))|mdir)|g(et_(event_stream|last_error)|rp(_(cancel|limit|add))?)|mk(nod|dir)|busy)\\b", - "name": "support.function.eio.php" - }, - { - "match": "(?i)\\benchant_(dict_(s(tore_replacement|uggest)|check|is_in_session|describe|quick_check|add_to_(session|personal)|get_error)|broker_(set_ordering|init|d(ict_exists|escribe)|free(_dict)?|list_dicts|request_(dict|pwl_dict)|get_error))\\b", - "name": "support.function.enchant.php" - }, - { - "match": "(?i)\\b(s(plit(i)?|ql_regcase)|ereg(i(_replace)?|_replace)?)\\b", - "name": "support.function.ereg.php" - }, - { - "match": "(?i)\\b(set_e(rror_handler|xception_handler)|trigger_error|debug_(print_backtrace|backtrace)|user_error|error_(log|reporting|get_last)|restore_e(rror_handler|xception_handler))\\b", - "name": "support.function.errorfunc.php" - }, - { - "match": "(?i)\\b(s(hell_exec|ystem)|p(assthru|roc_(nice|close|terminate|open|get_status))|e(scapeshell(cmd|arg)|xec))\\b", - "name": "support.function.exec.php" - }, - { - "match": "(?i)\\b(exif_(t(humbnail|agname)|imagetype|read_data)|read_exif_data)\\b", - "name": "support.function.exif.php" - }, - { - "match": "(?i)\\bfann_(s(huffle_train_data|cale_(train(_data)?|input(_train_data)?|output(_train_data)?)|ubset_train_data|et_(s(caling_params|arprop_(step_error_(shift|threshold_factor)|temperature|weight_decay_shift))|ca(scade_(num_candidate_groups|candidate_(stagnation_epochs|change_fraction|limit)|output_(stagnation_epochs|change_fraction)|weight_multiplier|activation_(steepnesses|functions)|m(in_(cand_epochs|out_epochs)|ax_(cand_epochs|out_epochs)))|llback)|train(ing_algorithm|_(stop_function|error_function))|input_scaling_params|output_scaling_params|error_log|quickprop_(decay|mu)|weight(_array)?|learning_(rate|momentum)|activation_(steepness(_(hidden|output|layer))?|function(_(hidden|output|layer))?)|rprop_(increase_factor|de(crease_factor|lta_(zero|m(in|ax))))|bit_fail_limit)|ave(_train)?)|num_(input_train_data|output_train_data)|c(opy|lear_scaling_params|ascadetrain_on_(data|file)|reate_(s(hortcut(_array)?|tandard(_array)?|parse(_array)?)|train(_from_callback)?|from_file))|t(est(_data)?|rain(_(on_(data|file)|epoch))?)|init_weights|d(uplicate_train_data|es(cale_(train|input|output)|troy(_train)?))|print_error|length_train_data|r(un|e(set_(MSE|err(str|no))|ad_train_from_file)|andomize_weights)|get_(sarprop_(step_error_(shift|threshold_factor)|temperature|weight_decay_shift)|n(um_(input|output|layers)|etwork_type)|MSE|c(onnection_(array|rate)|ascade_(num_candidate(s|_groups)|candidate_(stagnation_epochs|change_fraction|limit)|output_(stagnation_epochs|change_fraction)|weight_multiplier|activation_(steepnesses(_count)?|functions(_count)?)|m(in_(cand_epochs|out_epochs)|ax_(cand_epochs|out_epochs))))|t(otal_(neurons|connections)|rain(ing_algorithm|_(stop_function|error_function)))|err(str|no)|quickprop_(decay|mu)|l(earning_(rate|momentum)|ayer_array)|activation_(steepness|function)|rprop_(increase_factor|de(crease_factor|lta_(zero|m(in|ax))))|bi(t_fail(_limit)?|as_array))|merge_train_data)\\b", - "name": "support.function.fann.php" - }, - { - "match": "(?i)\\b(s(ymlink|tat|et_file_buffer)|c(h(own|grp|mod)|opy|learstatcache)|t(ouch|empnam|mpfile)|is_(dir|uploaded_file|executable|file|writ(eable|able)|link|readable)|d(i(sk(_(total_space|free_space)|freespace)|rname)|elete)|u(nlink|mask)|p(close|open|a(thinfo|rse_ini_(string|file)))|f(s(canf|tat|eek)|nmatch|close|t(ell|runcate)|ile(size|ctime|type|inode|owner|_(put_contents|exists|get_contents)|perms|atime|group|mtime)?|open|p(ut(s|csv)|assthru)|eof|flush|write|lock|read|get(s(s)?|c(sv)?))|l(stat|ch(own|grp)|ink(info)?)|r(e(name|wind|a(d(file|link)|lpath(_cache_(size|get))?))|mdir)|glob|m(ove_uploaded_file|kdir)|basename)\\b", - "name": "support.function.file.php" - }, - { - "match": "(?i)\\b(finfo_(set_flags|close|open|file|buffer)|mime_content_type)\\b", - "name": "support.function.fileinfo.php" - }, - { - "match": "(?i)\\bfilter_(has_var|i(nput(_array)?|d)|var(_array)?|list)\\b", - "name": "support.function.filter.php" - }, - { - "match": "(?i)\\bfastcgi_finish_request\\b", - "name": "support.function.fpm.php" - }, - { - "match": "(?i)\\b(c(all_user_func(_array)?|reate_function)|unregister_tick_function|f(orward_static_call(_array)?|unc(tion_exists|_(num_args|get_arg(s)?)))|register_(shutdown_function|tick_function)|get_defined_functions)\\b", - "name": "support.function.funchand.php" - }, - { - "match": "(?i)\\b(ngettext|textdomain|d(ngettext|c(ngettext|gettext)|gettext)|gettext|bind(textdomain|_textdomain_codeset))\\b", - "name": "support.function.gettext.php" - }, - { - "match": "(?i)\\bgmp_(s(can(1|0)|trval|ign|ub|etbit|qrt(rem)?)|hamdist|ne(g|xtprime)|c(om|lrbit|mp)|testbit|i(n(tval|it|vert)|mport)|or|div(_(q(r)?|r)|exact)?|jacobi|p(o(pcount|w(m)?)|erfect_square|rob_prime)|export|fact|legendre|a(nd|dd|bs)|r(oot(rem)?|andom(_(range|bits))?)|gcd(ext)?|xor|m(od|ul))\\b", - "name": "support.function.gmp.php" - }, - { - "match": "(?i)\\bhash(_(hmac(_file)?|copy|init|update(_(stream|file))?|pbkdf2|equals|fi(nal|le)|algos))?\\b", - "name": "support.function.hash.php" - }, - { - "match": "(?i)\\b(http_(s(upport|end_(st(atus|ream)|content_(type|disposition)|data|file|last_modified))|head|negotiate_(c(harset|ontent_type)|language)|c(hunked_decode|ache_(etag|last_modified))|throttle|inflate|d(eflate|ate)|p(ost_(data|fields)|ut_(stream|data|file)|ersistent_handles_(c(ount|lean)|ident)|arse_(headers|cookie|params|message))|re(direct|quest(_(method_(name|unregister|exists|register)|body_encode))?)|get(_request_(headers|body(_stream)?))?|match_(etag|request_header|modified)|build_(str|cookie|url))|ob_(inflatehandler|deflatehandler|etaghandler))\\b", - "name": "support.function.http.php" - }, - { - "match": "(?i)\\b(iconv(_(s(tr(pos|len|rpos)|ubstr|et_encoding)|get_encoding|mime_(decode(_headers)?|encode)))?|ob_iconv_handler)\\b", - "name": "support.function.iconv.php" - }, - { - "match": "(?i)\\biis_(s(t(op_serv(ice|er)|art_serv(ice|er))|et_(s(cript_map|erver_rights)|dir_security|app_settings))|add_server|remove_server|get_(s(cript_map|erv(ice_state|er_(rights|by_(comment|path))))|dir_security))\\b", - "name": "support.function.iisfunc.php" - }, - { - "match": "(?i)\\b(i(ptc(parse|embed)|mage(s(y|cale|tring(up)?|et(style|t(hickness|ile)|interpolation|pixel|brush)|avealpha|x)|c(har(up)?|o(nvolution|py(res(ized|ampled)|merge(gray)?)?|lor(s(total|et|forindex)|closest(hwb|alpha)?|transparent|deallocate|exact(alpha)?|a(t|llocate(alpha)?)|resolve(alpha)?|match))|r(op(auto)?|eate(truecolor|from(string|jpeg|png|w(ebp|bmp)|g(if|d(2(part)?)?)|x(pm|bm)))?))|t(ypes|tf(text|bbox)|ruecolortopalette)|i(struecolor|nterlace)|2wbmp|d(estroy|ashedline)|jpeg|_type_to_(extension|mime_type)|p(s(slantfont|text|e(ncodefont|xtendfont)|freefont|loadfont|bbox)|ng|olygon|alette(copy|totruecolor))|ellipse|f(t(text|bbox)|il(ter|l(toborder|ed(polygon|ellipse|arc|rectangle))?)|ont(height|width)|lip)|w(ebp|bmp)|l(ine|oadfont|ayereffect)|a(ntialias|ffine(matrix(concat|get))?|lphablending|rc)|r(otate|ectangle)|g(if|d(2)?|ammacorrect|rab(screen|window))|xbm))|jpeg2wbmp|png2wbmp|g(d_info|etimagesize(fromstring)?))\\b", - "name": "support.function.image.php" - }, - { - "match": "(?i)\\b(s(ys_get_temp_dir|et_(time_limit|include_path|magic_quotes_runtime))|cli_(set_process_title|get_process_title)|ini_(set|alter|restore|get(_all)?)|zend_(thread_id|version|logo_guid)|dl|p(hp(credits|info|_(sapi_name|ini_(scanned_files|loaded_file)|uname|logo_guid)|version)|utenv)|extension_loaded|version_compare|assert(_options)?|restore_include_path|g(c_(collect_cycles|disable|enable(d)?)|et(opt|_(c(urrent_user|fg_var)|include(d_files|_path)|defined_constants|extension_funcs|loaded_extensions|required_files|magic_quotes_(runtime|gpc))|env|lastmod|rusage|my(inode|uid|pid|gid)))|m(emory_get_(usage|peak_usage)|a(in|gic_quotes_runtime)))\\b", - "name": "support.function.info.php" - }, - { - "match": "(?i)\\bibase_(se(t_event_handler|rv(ice_(detach|attach)|er_info))|n(um_(params|fields)|ame_result)|c(o(nnect|mmit(_ret)?)|lose)|trans|d(elete_user|rop_db|b_info)|p(connect|aram_info|repare)|e(rr(code|msg)|xecute)|query|f(ield_info|etch_(object|assoc|row)|ree_(event_handler|query|result))|wait_event|a(dd_user|ffected_rows)|r(ollback(_ret)?|estore)|gen_id|m(odify_user|aintain_db)|b(lob_(c(lose|ancel|reate)|i(nfo|mport)|open|echo|add|get)|ackup))\\b", - "name": "support.function.interbase.php" - }, - { - "match": "(?i)\\b(n(ormalizer_(normalize|is_normalized)|umfmt_(set_(symbol|text_attribute|pattern|attribute)|create|parse(_currency)?|format(_currency)?|get_(symbol|text_attribute|pattern|error_(code|message)|locale|attribute)))|collator_(s(ort(_with_sort_keys)?|et_(strength|attribute))|c(ompare|reate)|asort|get_(s(trength|ort_key)|error_(code|message)|locale|attribute))|transliterator_(create(_(inverse|from_rules))?|transliterate|list_ids|get_error_(code|message))|i(ntl(cal_get_error_(code|message)|tz_get_error_(code|message)|_(is_failure|error_name|get_error_(code|message)))|dn_to_(u(nicode|tf8)|ascii))|datefmt_(set_(calendar|timezone(_id)?|pattern|lenient)|create|is_lenient|parse|format(_object)?|localtime|get_(calendar(_object)?|time(type|zone(_id)?)|datetype|pattern|error_(code|message)|locale))|locale_(set_default|c(ompose|anonicalize)|parse|filter_matches|lookup|accept_from_http|get_(script|d(isplay_(script|name|variant|language|region)|efault)|primary_language|keywords|all_variants|region))|resourcebundle_(c(ount|reate)|locales|get(_error_(code|message))?)|grapheme_(s(tr(str|i(str|pos)|pos|len|r(ipos|pos))|ubstr)|extract)|msgfmt_(set_pattern|create|parse(_message)?|format(_message)?|get_(pattern|error_(code|message)|locale)))\\b", - "name": "support.function.intl.php" - }, - { - "match": "(?i)\\bjson_(decode|encode|last_error(_msg)?)\\b", - "name": "support.function.json.php" - }, - { - "match": "(?i)\\bldap_(s(tart_tls|ort|e(t_(option|rebind_proc)|arch)|asl_bind)|next_(entry|attribute|reference)|c(o(n(nect|trol_paged_result(_response)?)|unt_entries|mpare)|lose)|t61_to_8859|d(n2ufn|elete)|8859_to_t61|unbind|parse_re(sult|ference)|e(scape|rr(no|2str|or)|xplode_dn)|f(irst_(entry|attribute|reference)|ree_result)|list|add|re(name|ad)|get_(option|dn|entries|values(_len)?|attributes)|mod(ify(_batch)?|_(del|add|replace))|bind)\\b", - "name": "support.function.ldap.php" - }, - { - "match": "(?i)\\blibxml_(set_(streams_context|external_entity_loader)|clear_errors|disable_entity_loader|use_internal_errors|get_(errors|last_error))\\b", - "name": "support.function.libxml.php" - }, - { - "match": "(?i)\\b(ezmlm_hash|mail)\\b", - "name": "support.function.mail.php" - }, - { - "match": "(?i)\\b(s(in(h)?|qrt|rand)|h(ypot|exdec)|c(os(h)?|eil)|tan(h)?|is_(nan|infinite|finite)|octdec|de(c(hex|oct|bin)|g2rad)|p(i|ow)|exp(m1)?|f(loor|mod)|l(cg_value|og(1(p|0))?)|a(sin(h)?|cos(h)?|tan(h|2)?|bs)|r(ound|a(nd|d2deg))|getrandmax|m(t_(srand|rand|getrandmax)|in|ax)|b(indec|ase_convert))\\b", - "name": "support.function.math.php" - }, - { - "match": "(?i)\\bmb_(s(tr(str|cut|to(upper|lower)|i(str|pos|mwidth)|pos|width|len|r(chr|i(chr|pos)|pos))|ubst(itute_character|r(_count)?)|plit|end_mail)|http_(input|output)|c(heck_encoding|onvert_(case|encoding|variables|kana))|internal_encoding|output_handler|de(code_(numericentity|mimeheader)|tect_(order|encoding))|p(arse_str|referred_mime_name)|e(ncod(ing_aliases|e_(numericentity|mimeheader))|reg(i(_replace)?|_(search(_(setpos|init|pos|regs|get(pos|regs)))?|replace(_callback)?|match))?)|l(ist_encodings|anguage)|regex_(set_options|encoding)|get_info)\\b", - "name": "support.function.mbstring.php" - }, - { - "match": "(?i)\\bm(crypt_(c(fb|reate_iv|bc)|ofb|decrypt|e(nc(_(self_test|is_block_(algorithm(_mode)?|mode)|get_(supported_key_sizes|iv_size|key_size|algorithms_name|modes_name|block_size))|rypt)|cb)|list_(algorithms|modes)|ge(neric(_(init|deinit|end))?|t_(cipher_name|iv_size|key_size|block_size))|module_(self_test|close|is_block_(algorithm(_mode)?|mode)|open|get_(supported_key_sizes|algo_(key_size|block_size))))|decrypt_generic)\\b", - "name": "support.function.mcrypt.php" - }, - { - "match": "(?i)\\bmemcache_debug\\b", - "name": "support.function.memcache.php" - }, - { - "match": "(?i)\\bmhash(_(count|keygen_s2k|get_(hash_name|block_size)))?\\b", - "name": "support.function.mhash.php" - }, - { - "match": "(?i)\\b(log_(cmd_(insert|delete|update)|killcursor|write_batch|reply|getmore)|bson_(decode|encode))\\b", - "name": "support.function.mongo.php" - }, - { - "match": "(?i)\\bmysql_(s(tat|e(t_charset|lect_db))|num_(fields|rows)|c(onnect|l(ient_encoding|ose)|reate_db)|t(hread_id|ablename)|in(sert_id|fo)|d(ata_seek|rop_db|b_(name|query))|unbuffered_query|p(connect|ing)|e(scape_string|rr(no|or))|query|f(ield_(seek|name|t(ype|able)|flags|len)|etch_(object|field|lengths|a(ssoc|rray)|row)|ree_result)|list_(tables|dbs|processes|fields)|affected_rows|re(sult|al_escape_string)|get_(server_info|host_info|client_info|proto_info))\\b", - "name": "support.function.mysql.php" - }, - { - "match": "(?i)\\bmysqli_(s(sl_set|t(ore_result|at|mt_(s(tore_result|end_long_data)|next_result|close|init|data_seek|prepare|execute|f(etch|ree_result)|attr_(set|get)|res(ult_metadata|et)|get_(warnings|result)|more_results|bind_(param|result)))|e(nd_(query|long_data)|t_(charset|opt|local_infile_(handler|default))|lect_db)|lave_query|avepoint)|next_result|c(ha(nge_user|racter_set_name)|o(nnect|mmit)|l(ient_encoding|ose))|thread_safe|init|options|d(isable_r(pl_parse|eads_from_master)|ump_debug_info|ebug|ata_seek)|use_result|p(ing|oll|aram_count|repare)|e(scape_string|nable_r(pl_parse|eads_from_master)|xecute|mbedded_server_(start|end))|kill|query|f(ield_seek|etch(_(object|field(s|_direct)?|a(ssoc|ll|rray)|row))?|ree_result)|autocommit|r(ollback|pl_(p(arse_enabled|robe)|query_type)|e(port|fresh|lease_savepoint|a(p_async_query|l_(connect|escape_string|query))))|get_(c(harset|onnection_stats|lient_(stats|info|version)|ache_stats)|warnings|links_stats|metadata)|m(ore_results|ulti_query|aster_query)|b(ind_(param|result)|egin_transaction))\\b", - "name": "support.function.mysqli.php" - }, - { - "match": "(?i)\\bmysqlnd_memcache_(set|get_config)\\b", - "name": "support.function.mysqlnd-memcache.php" - }, - { - "match": "(?i)\\bmysqlnd_ms_(set_(user_pick_server|qos)|dump_servers|query_is_select|fabric_select_(shard|global)|get_(stats|last_(used_connection|gtid))|xa_(commit|rollback|gc|begin)|match_wild)\\b", - "name": "support.function.mysqlnd-ms.php" - }, - { - "match": "(?i)\\bmysqlnd_qc_(set_(storage_handler|cache_condition|is_select|user_handlers)|clear_cache|get_(normalized_query_trace_log|c(ore_stats|ache_info)|query_trace_log|available_handlers))\\b", - "name": "support.function.mysqlnd-qc.php" - }, - { - "match": "(?i)\\bmysqlnd_uh_(set_(statement_proxy|connection_proxy)|convert_to_mysqlnd)\\b", - "name": "support.function.mysqlnd-uh.php" - }, - { - "match": "(?i)\\b(s(yslog|ocket_(set_(timeout|blocking)|get_status)|et(cookie|rawcookie))|h(ttp_response_code|eader(s_(sent|list)|_re(gister_callback|move))?)|c(heckdnsrr|loselog)|i(net_(ntop|pton)|p2long)|openlog|d(ns_(check_record|get_(record|mx))|efine_syslog_variables)|pfsockopen|fsockopen|long2ip|get(servby(name|port)|host(name|by(name(l)?|addr))|protobyn(umber|ame)|mxrr))\\b", - "name": "support.function.network.php" - }, - { - "match": "(?i)\\bnsapi_(virtual|re(sponse_headers|quest_headers))\\b", - "name": "support.function.nsapi.php" - }, - { - "match": "(?i)\\boci(s(tatementtype|e(tprefetch|rverversion)|avelob(file)?)|n(umcols|ew(c(ollection|ursor)|descriptor)|logon)|c(o(l(umn(s(cale|ize)|name|type(raw)?|isnull|precision)|l(size|trim|a(ssign(elem)?|ppend)|getelem|max))|mmit)|loselob|ancel)|internaldebug|definebyname|_(s(tatement_type|e(t_(client_i(nfo|dentifier)|prefetch|edition|action|module_name)|rver_version))|n(um_(fields|rows)|ew_(c(o(nnect|llection)|ursor)|descriptor))|c(o(nnect|mmit)|l(ient_version|ose)|ancel)|internal_debug|define_by_name|p(connect|a(ssword_change|rse))|e(rror|xecute)|f(ield_(s(cale|ize)|name|type(_raw)?|is_null|precision)|etch(_(object|a(ssoc|ll|rray)|row))?|ree_(statement|descriptor))|lob_(copy|is_equal)|r(ollback|esult)|get_implicit_resultset|bind_(array_by_name|by_name))|p(logon|arse)|e(rror|xecute)|f(etch(statement|into)?|ree(statement|c(ollection|ursor)|desc))|write(temporarylob|lobtofile)|lo(adlob|go(n|ff))|r(o(wcount|llback)|esult)|bindbyname)\\b", - "name": "support.function.oci8.php" - }, - { - "match": "(?i)\\bopcache_(compile_file|invalidate|reset|get_(status|configuration))\\b", - "name": "support.function.opcache.php" - }, - { - "match": "(?i)\\bopenssl_(s(ign|pki_(new|export(_challenge)?|verify)|eal)|c(sr_(sign|new|export(_to_file)?|get_(subject|public_key))|ipher_iv_length)|open|d(h_compute_key|igest|ecrypt)|p(ublic_(decrypt|encrypt)|k(cs(12_(export(_to_file)?|read)|7_(sign|decrypt|encrypt|verify))|ey_(new|export(_to_file)?|free|get_(details|p(ublic|rivate))))|rivate_(decrypt|encrypt)|bkdf2)|e(ncrypt|rror_string)|verify|free_key|random_pseudo_bytes|get_(c(ipher_methods|ert_locations)|p(ublickey|rivatekey)|md_methods)|x509_(check(_private_key|purpose)|parse|export(_to_file)?|f(ingerprint|ree)|read))\\b", - "name": "support.function.openssl.php" - }, - { - "match": "(?i)\\b(o(utput_(add_rewrite_var|reset_rewrite_vars)|b_(start|clean|implicit_flush|end_(clean|flush)|flush|list_handlers|g(zhandler|et_(status|c(ontents|lean)|flush|le(ngth|vel)))))|flush)\\b", - "name": "support.function.output.php" - }, - { - "match": "(?i)\\bpassword_(hash|needs_rehash|verify|get_info)\\b", - "name": "support.function.password.php" - }, - { - "match": "(?i)\\bpcntl_(s(trerror|ig(nal(_dispatch)?|timedwait|procmask|waitinfo)|etpriority)|e(rrno|xec)|fork|w(stopsig|termsig|if(s(topped|ignaled)|exited)|exitstatus|ait(pid)?)|alarm|get(_last_error|priority))\\b", - "name": "support.function.pcntl.php" - }, - { - "match": "(?i)\\bpg_(s(ocket|e(nd_(prepare|execute|query(_params)?)|t_(client_encoding|error_verbosity)|lect))|host|num_(fields|rows)|c(o(n(sume_input|nect(ion_(status|reset|busy)|_poll)?|vert)|py_(to|from))|l(ient_encoding|ose)|ancel_query)|t(ty|ra(nsaction_status|ce))|insert|options|d(elete|bname)|u(n(trace|escape_bytea)|pdate)|p(connect|ing|ort|ut_line|arameter_status|repare)|e(scape_(string|identifier|literal|bytea)|nd_copy|xecute)|version|query(_params)?|f(ield_(size|n(um|ame)|t(ype(_oid)?|able)|is_null|prtlen)|etch_(object|a(ssoc|ll(_columns)?|rray)|r(ow|esult))|lush|ree_result)|l(o_(seek|c(lose|reate)|t(ell|runcate)|import|open|unlink|export|write|read(_all)?)|ast_(notice|oid|error))|affected_rows|result_(s(tatus|eek)|error(_field)?)|get_(notify|pid|result)|meta_data)\\b", - "name": "support.function.pgsql.php" - }, - { - "match": "(?i)\\b(virtual|apache_(setenv|note|child_terminate|lookup_uri|re(s(ponse_headers|et_timeout)|quest_headers)|get(_(version|modules)|env))|getallheaders)\\b", - "name": "support.function.php_apache.php" - }, - { - "match": "(?i)\\bdom_import_simplexml\\b", - "name": "support.function.php_dom.php" - }, - { - "match": "(?i)\\bftp_(s(sl_connect|ystype|i(te|ze)|et_option)|n(list|b_(continue|put|f(put|get)|get))|c(h(dir|mod)|onnect|dup|lose)|delete|p(ut|wd|asv)|exec|quit|f(put|get)|login|alloc|r(ename|aw(list)?|mdir)|get(_option)?|m(dtm|kdir))\\b", - "name": "support.function.php_ftp.php" - }, - { - "match": "(?i)\\bimap_(s(can(mailbox)?|tatus|ort|ubscribe|e(t(_quota|flag_full|acl)|arch)|avebody)|header(s|info)?|num_(recent|msg)|c(heck|l(ose|earflag_full)|reate(mailbox)?)|t(hread|imeout)|open|delete(mailbox)?|8bit|u(n(subscribe|delete)|tf(7_(decode|encode)|8)|id)|ping|e(rrors|xpunge)|qprint|fetch(structure|header|text|_overview|mime|body)|l(sub|ist(s(can|ubscribed)|mailbox)?|ast_error)|a(ppend|lerts)|r(e(name(mailbox)?|open)|fc822_(parse_(headers|adrlist)|write_address))|g(c|et(subscribed|_quota(root)?|acl|mailboxes))|m(sgno|ime_header_decode|ail(_(co(py|mpose)|move)|boxmsginfo)?)|b(inary|ody(struct)?|ase64))\\b", - "name": "support.function.php_imap.php" - }, - { - "match": "(?i)\\bmssql_(select_db|n(um_(fields|rows)|ext_result)|c(onnect|lose)|init|data_seek|pconnect|execute|query|f(ield_(seek|name|type|length)|etch_(object|field|a(ssoc|rray)|row|batch)|ree_(statement|result))|r(ows_affected|esult)|g(uid_string|et_last_message)|min_(error_severity|message_severity)|bind)\\b", - "name": "support.function.php_mssql.php" - }, - { - "match": "(?i)\\bodbc_(s(tatistics|pecialcolumns|etoption)|n(um_(fields|rows)|ext_result)|c(o(nnect|lumn(s|privileges)|mmit)|ursor|lose(_all)?)|table(s|privileges)|d(o|ata_source)|p(connect|r(imarykeys|ocedure(s|columns)|epare))|e(rror(msg)?|xec(ute)?)|f(ield_(scale|n(um|ame)|type|precision|len)|oreignkeys|etch_(into|object|array|row)|ree_result)|longreadlen|autocommit|r(ollback|esult(_all)?)|gettypeinfo|binmode)\\b", - "name": "support.function.php_odbc.php" - }, - { - "match": "(?i)\\bpreg_(split|quote|filter|last_error|replace(_callback)?|grep|match(_all)?)\\b", - "name": "support.function.php_pcre.php" - }, - { - "match": "(?i)\\b(spl_(classes|object_hash|autoload(_(call|unregister|extensions|functions|register))?)|class_(implements|uses|parents)|iterator_(count|to_array|apply))\\b", - "name": "support.function.php_spl.php" - }, - { - "match": "(?i)\\bzip_(close|open|entry_(name|c(ompress(ionmethod|edsize)|lose)|open|filesize|read)|read)\\b", - "name": "support.function.php_zip.php" - }, - { - "match": "(?i)\\bposix_(s(trerror|et(sid|uid|pgid|e(uid|gid)|gid))|ctermid|t(tyname|imes)|i(satty|nitgroups)|uname|errno|kill|access|get(sid|cwd|uid|_last_error|p(id|pid|w(nam|uid)|g(id|rp))|e(uid|gid)|login|rlimit|g(id|r(nam|oups|gid)))|mk(nod|fifo))\\b", - "name": "support.function.posix.php" - }, - { - "match": "(?i)\\bset(threadtitle|proctitle)\\b", - "name": "support.function.proctitle.php" - }, - { - "match": "(?i)\\bpspell_(s(tore_replacement|uggest|ave_wordlist)|new(_(config|personal))?|c(heck|onfig_(save_repl|create|ignore|d(ict_dir|ata_dir)|personal|r(untogether|epl)|mode)|lear_session)|add_to_(session|personal))\\b", - "name": "support.function.pspell.php" - }, - { - "match": "(?i)\\breadline(_(c(ompletion_function|lear_history|allback_(handler_(install|remove)|read_char))|info|on_new_line|write_history|list_history|add_history|re(display|ad_history)))?\\b", - "name": "support.function.readline.php" - }, - { - "match": "(?i)\\brecode(_(string|file))?\\b", - "name": "support.function.recode.php" - }, - { - "match": "(?i)\\brrd(c_disconnect|_(create|tune|info|update|error|version|f(irst|etch)|last(update)?|restore|graph|xport))\\b", - "name": "support.function.rrd.php" - }, - { - "match": "(?i)\\b(s(hm_(has_var|detach|put_var|attach|remove(_var)?|get_var)|em_(acquire|re(lease|move)|get))|ftok|msg_(s(tat_queue|e(nd|t_queue))|queue_exists|re(ceive|move_queue)|get_queue))\\b", - "name": "support.function.sem.php" - }, - { - "match": "(?i)\\bsession_(s(ta(tus|rt)|et_(save_handler|cookie_params)|ave_path)|name|c(ommit|ache_(expire|limiter))|i(s_registered|d)|de(stroy|code)|un(set|register)|encode|write_close|abort|re(set|g(ister(_shutdown)?|enerate_id))|get_cookie_params|module_name)\\b", - "name": "support.function.session.php" - }, - { - "match": "(?i)\\bshmop_(size|close|open|delete|write|read)\\b", - "name": "support.function.shmop.php" - }, - { - "match": "(?i)\\bsimplexml_(import_dom|load_(string|file))\\b", - "name": "support.function.simplexml.php" - }, - { - "match": "(?i)\\bsnmp(set|2_(set|walk|real_walk|get(next)?)|_(set_(oid_(numeric_print|output_format)|enum_print|valueretrieval|quick_print)|read_mib|get_(valueretrieval|quick_print))|3_(set|walk|real_walk|get(next)?)|walk(oid)?|realwalk|get(next)?)\\b", - "name": "support.function.snmp.php" - }, - { - "match": "(?i)\\b(is_soap_fault|use_soap_error_handler)\\b", - "name": "support.function.soap.php" - }, - { - "match": "(?i)\\bsocket_(s(hutdown|trerror|e(nd(to|msg)?|t_(nonblock|option|block)|lect))|c(onnect|l(ose|ear_error)|reate(_(pair|listen))?|msg_space)|import_stream|write|l(isten|ast_error)|accept|re(cv(from|msg)?|ad)|get(sockname|_option|peername)|bind)\\b", - "name": "support.function.sockets.php" - }, - { - "match": "(?i)\\bsqlite_(s(ingle_query|eek)|has_(prev|more)|n(um_(fields|rows)|ext)|c(hanges|olumn|urrent|lose|reate_(function|aggregate))|open|u(nbuffered_query|df_(decode_binary|encode_binary))|p(open|rev)|e(scape_string|rror_string|xec)|valid|key|query|f(ield_name|etch_(s(tring|ingle)|column_types|object|a(ll|rray))|actory)|l(ib(encoding|version)|ast_(insert_rowid|error))|array_query|rewind|busy_timeout)\\b", - "name": "support.function.sqlite.php" - }, - { - "match": "(?i)\\bsqlsrv_(se(nd_stream_data|rver_info)|has_rows|n(um_(fields|rows)|ext_result)|c(o(n(nect|figure)|mmit)|l(ient_info|ose)|ancel)|prepare|e(rrors|xecute)|query|f(ield_metadata|etch(_(object|array))?|ree_stmt)|ro(ws_affected|llback)|get_(config|field)|begin_transaction)\\b", - "name": "support.function.sqlsrv.php" - }, - { - "match": "(?i)\\bstats_(s(ta(ndard_deviation|t_(noncentral_t|correlation|in(nerproduct|dependent_t)|p(owersum|ercentile|aired_t)|gennch|binomial_coef))|kew)|harmonic_mean|c(ovariance|df_(n(oncentral_(chisquare|f)|egative_binomial)|c(hisquare|auchy)|t|uniform|poisson|exponential|f|weibull|l(ogistic|aplace)|gamma|b(inomial|eta)))|den(s_(n(ormal|egative_binomial)|c(hisquare|auchy)|t|pmf_(hypergeometric|poisson|binomial)|exponential|f|weibull|l(ogistic|aplace)|gamma|beta)|_uniform)|variance|kurtosis|absolute_deviation|rand_(setall|phrase_to_seeds|ranf|ge(n_(no(ncen(tral_(t|f)|ral_chisquare)|rmal)|chisquare|t|i(nt|uniform|poisson|binomial(_negative)?)|exponential|f(uniform)?|gamma|beta)|t_seeds)))\\b", - "name": "support.function.stats.php" - }, - { - "match": "(?i)\\bs(tream_(s(ocket_(s(hutdown|e(ndto|rver))|client|pair|enable_crypto|accept|recvfrom|get_name)|upports_lock|e(t_(chunk_size|timeout|write_buffer|read_buffer|blocking)|lect))|notification_callback|co(ntext_(set_(option|default|params)|create|get_(options|default|params))|py_to_stream)|is_local|encoding|filter_(prepend|append|re(gister|move))|wrapper_(unregister|re(store|gister))|re(solve_include_path|gister_wrapper)|get_(contents|transports|filters|wrappers|line|meta_data)|bucket_(new|prepend|append|make_writeable))|et_socket_blocking)\\b", - "name": "support.function.streamsfuncs.php" - }, - { - "match": "(?i)\\b(s(scanf|ha1(_file)?|tr(s(tr|pn)|n(c(asecmp|mp)|atc(asecmp|mp))|c(spn|hr|oll|asecmp|mp)|t(o(upper|k|lower)|r)|i(str|p(slashes|cslashes|os|_tags))|_(s(huffle|plit)|ireplace|pad|word_count|r(ot13|ep(eat|lace))|getcsv)|p(os|brk)|len|r(chr|ipos|pos|ev))|imilar_text|oundex|ubstr(_(co(unt|mpare)|replace))?|printf|etlocale)|h(tml(specialchars(_decode)?|_entity_decode|entities)|e(x2bin|brev(c)?))|n(umber_format|l(2br|_langinfo))|c(h(op|unk_split|r)|o(nvert_(cyr_string|uu(decode|encode))|unt_chars)|r(ypt|c32))|trim|implode|ord|uc(first|words)|join|p(arse_str|rint(f)?)|e(cho|xplode)|v(sprintf|printf|fprintf)|quote(d_printable_(decode|encode)|meta)|fprintf|wordwrap|l(cfirst|trim|ocaleconv|evenshtein)|add(slashes|cslashes)|rtrim|get_html_translation_table|m(oney_format|d5(_file)?|etaphone)|bin2hex)\\b", - "name": "support.function.string.php" - }, - { - "match": "(?i)\\bsybase_(se(t_message_handler|lect_db)|num_(fields|rows)|c(onnect|lose)|d(eadlock_retry_count|ata_seek)|unbuffered_query|pconnect|query|f(ield_seek|etch_(object|field|a(ssoc|rray)|row)|ree_result)|affected_rows|result|get_last_message|min_(server_severity|client_severity|error_severity|message_severity))\\b", - "name": "support.function.sybase.php" - }, - { - "match": "(?i)\\b(taint|is_tainted|untaint)\\b", - "name": "support.function.taint.php" - }, - { - "match": "(?i)\\b(tidy_(s(et(opt|_encoding)|ave_config)|c(onfig_count|lean_repair)|is_x(html|ml)|diagnose|parse_(string|file)|error_count|warning_count|load_config|access_count|re(set_config|pair_(string|file))|get(opt|_(status|h(tml(_ver)?|ead)|config|o(utput|pt_doc)|r(oot|elease)|body)))|ob_tidyhandler)\\b", - "name": "support.function.tidy.php" - }, - { - "match": "(?i)\\btoken_(name|get_all)\\b", - "name": "support.function.tokenizer.php" - }, - { - "match": "(?i)\\btrader_(s(t(och(f|rsi)?|ddev)|in(h)?|u(m|b)|et_(compat|unstable_period)|qrt|ar(ext)?|ma)|ht_(sine|trend(line|mode)|dcp(hase|eriod)|phasor)|natr|c(ci|o(s(h)?|rrel)|dl(s(ho(otingstar|rtline)|t(icksandwich|alledpattern)|pinningtop|eparatinglines)|h(i(kkake(mod)?|ghwave)|omingpigeon|a(ngingman|rami(cross)?|mmer))|c(o(ncealbabyswall|unterattack)|losingmarubozu)|t(hrusting|a(sukigap|kuri)|ristar)|i(n(neck|vertedhammer)|dentical3crows)|2crows|onneck|d(oji(star)?|arkcloudcover|ragonflydoji)|u(nique3river|psidegap2crows)|3(starsinsouth|inside|outside|whitesoldiers|linestrike|blackcrows)|piercing|e(ngulfing|vening(star|dojistar))|kicking(bylength)?|l(ongl(ine|eggeddoji)|adderbottom)|a(dvanceblock|bandonedbaby)|ri(sefall3methods|ckshawman)|g(apsidesidewhite|ravestonedoji)|xsidegap3methods|m(orning(star|dojistar)|a(t(hold|chinglow)|rubozu))|b(elthold|reakaway))|eil|mo)|t(sf|ypprice|3|ema|an(h)?|r(i(x|ma)|ange))|obv|d(iv|ema|x)|ultosc|p(po|lus_d(i|m))|e(rrno|xp|ma)|var|kama|floor|w(clprice|illr|ma)|l(n|inearreg(_(slope|intercept|angle))?|og10)|a(sin|cos|t(an|r)|d(osc|d|x(r)?)?|po|vgprice|roon(osc)?)|r(si|oc(p|r(100)?)?)|get_(compat|unstable_period)|m(i(n(index|us_d(i|m)|max(index)?)?|dp(oint|rice))|om|ult|edprice|fi|a(cd(ext|fix)?|vp|x(index)?|ma)?)|b(op|eta|bands))\\b", - "name": "support.function.trader.php" - }, - { - "match": "(?i)\\buopz_(co(py|mpose)|implement|overload|delete|undefine|extend|f(unction|lags)|re(store|name|define)|backup)\\b", - "name": "support.function.uopz.php" - }, - { - "match": "(?i)\\b(http_build_query|url(decode|encode)|parse_url|rawurl(decode|encode)|get_(headers|meta_tags)|base64_(decode|encode))\\b", - "name": "support.function.url.php" - }, - { - "match": "(?i)\\b(s(trval|e(ttype|rialize))|i(s(set|_(s(calar|tring)|nu(ll|meric)|callable|int(eger)?|object|double|float|long|array|re(source|al)|bool))|ntval|mport_request_variables)|d(oubleval|ebug_zval_dump)|unse(t|rialize)|print_r|empty|var_(dump|export)|floatval|get(type|_(defined_vars|resource_type))|boolval)\\b", - "name": "support.function.var.php" - }, - { - "match": "(?i)\\bwddx_(serialize_va(lue|rs)|deserialize|packet_(start|end)|add_vars)\\b", - "name": "support.function.wddx.php" - }, - { - "match": "(?i)\\bxhprof_(sample_(disable|enable)|disable|enable)\\b", - "name": "support.function.xhprof.php" - }, - { - "match": "(?i)\\b(utf8_(decode|encode)|xml_(set_(start_namespace_decl_handler|notation_decl_handler|character_data_handler|object|default_handler|unparsed_entity_decl_handler|processing_instruction_handler|e(nd_namespace_decl_handler|lement_handler|xternal_entity_ref_handler))|parse(_into_struct|r_(set_option|create(_ns)?|free|get_option))?|error_string|get_(current_(column_number|line_number|byte_index)|error_code)))\\b", - "name": "support.function.xml.php" - }, - { - "match": "(?i)\\bxmlrpc_(se(t_type|rver_(c(all_method|reate)|destroy|add_introspection_data|register_(introspection_callback|method)))|is_fault|decode(_request)?|parse_method_descriptions|encode(_request)?|get_type)\\b", - "name": "support.function.xmlrpc.php" - }, - { - "match": "(?i)\\bxmlwriter_(s(tart_(c(omment|data)|d(td(_(e(ntity|lement)|attlist))?|ocument)|pi|element(_ns)?|attribute(_ns)?)|et_indent(_string)?)|text|o(utput_memory|pen_(uri|memory))|end_(c(omment|data)|d(td(_(e(ntity|lement)|attlist))?|ocument)|pi|element|attribute)|f(ull_end_element|lush)|write_(c(omment|data)|dtd(_(e(ntity|lement)|attlist))?|pi|element(_ns)?|attribute(_ns)?|raw))\\b", - "name": "support.function.xmlwriter.php" - }, - { - "match": "(?i)\\b(zlib_(decode|encode|get_coding_type)|readgzfile|gz(seek|c(ompress|lose)|tell|inflate|open|de(code|flate)|uncompress|p(uts|assthru)|e(ncode|of)|file|write|re(wind|ad)|get(s(s)?|c)))\\b", - "name": "support.function.zlib.php" - }, - { - "match": "(?i)\\bis_int(eger)?\\b", - "name": "support.function.alias.php" - } - ] - }, - "user-function-call": { - "begin": "(?i)(?=[a-z_0-9\\\\]*[a-z_][a-z0-9_]*\\s*\\()", - "end": "(?i)[a-z_][a-z_0-9]*(?=\\s*\\()", - "name": "meta.function-call.php", - "patterns": [ - { - "include": "#namespace" - } - ] - }, - "var_basic": { - "patterns": [ - { - "captures": { - "1": { - "name": "punctuation.definition.variable.php" - } - }, - "match": "(?x)\n \t\t\t (\\$+)[a-zA-Z_\\x{7f}-\\x{ff}]\n \t\t\t [a-zA-Z0-9_\\x{7f}-\\x{ff}]*?\\b", - "name": "variable.other.php" - } - ] - }, - "var_global": { - "captures": { - "1": { - "name": "punctuation.definition.variable.php" - } - }, - "match": "(\\$)((_(COOKIE|FILES|GET|POST|REQUEST))|arg(v|c))\\b", - "name": "variable.other.global.php" - }, - "var_global_safer": { - "captures": { - "1": { - "name": "punctuation.definition.variable.php" - } - }, - "match": "(\\$)((GLOBALS|_(ENV|SERVER|SESSION)))", - "name": "variable.other.global.safer.php" - }, - "variable-name": { - "patterns": [ - { - "include": "#var_global" - }, - { - "include": "#var_global_safer" - }, - { - "captures": { - "1": { - "name": "variable.other.php" - }, - "2": { - "name": "punctuation.definition.variable.php" - }, - "4": { - "name": "keyword.operator.class.php" - }, - "5": { - "name": "variable.other.property.php" - }, - "6": { - "name": "punctuation.section.array.begin.php" - }, - "7": { - "name": "constant.numeric.index.php" - }, - "8": { - "name": "variable.other.index.php" - }, - "9": { - "name": "punctuation.definition.variable.php" - }, - "10": { - "name": "string.unquoted.index.php" - }, - "11": { - "name": "punctuation.section.array.end.php" - } - }, - "comment": "Simple syntax: $foo, $foo[0], $foo[$bar], $foo->bar", - "match": "(?x)\n\t\t\t\t\t\t((\\$)(?[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*))\n\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t(->)(\\g)\n\t\t\t\t\t\t\t|\n\t\t\t\t\t\t\t(\\[)\n\t\t\t\t\t\t\t\t(?:(\\d+)|((\\$)\\g)|(\\w+))\n\t\t\t\t\t\t\t(\\])\n\t\t\t\t\t\t)?\n\t\t\t\t\t\t" - }, - { - "captures": { - "1": { - "name": "variable.other.php" - }, - "2": { - "name": "punctuation.definition.variable.php" - }, - "4": { - "name": "punctuation.definition.variable.php" - } - }, - "comment": "Simple syntax with braces: \"foo${bar}baz\"", - "match": "(?x)\n\t\t\t\t\t\t((\\$\\{)(?[a-zA-Z_\\x{7f}-\\x{ff}][a-zA-Z0-9_\\x{7f}-\\x{ff}]*)(\\}))\n\t\t\t\t\t\t" - } - ] - }, - "variables": { - "patterns": [ - { - "include": "#var_global" - }, - { - "include": "#var_global_safer" - }, - { - "include": "#var_basic" - }, - { - "begin": "(\\$\\{)(?=.*?\\})", - "beginCaptures": { - "1": { - "name": "punctuation.definition.variable.php" - } - }, - "end": "(\\})", - "endCaptures": { - "1": { - "name": "punctuation.definition.variable.php" - } - }, - "patterns": [ - { - "include": "#language" - } - ] - } - ] - } - } -} \ No newline at end of file diff --git a/lib/shiki-languages/data/grammars/properties.plist b/lib/shiki-languages/data/grammars/properties.plist deleted file mode 100644 index 11436566..00000000 --- a/lib/shiki-languages/data/grammars/properties.plist +++ /dev/null @@ -1,181 +0,0 @@ - - - - - fileTypes - - ini - conf - - keyEquivalent - ^~I - name - Ini - patterns - - - begin - (^[ \t]+)?(?=#) - beginCaptures - - 1 - - name - punctuation.whitespace.comment.leading.ini - - - end - (?!\G) - patterns - - - begin - # - beginCaptures - - 0 - - name - punctuation.definition.comment.ini - - - end - \n - name - comment.line.number-sign.ini - - - - - begin - (^[ \t]+)?(?=;) - beginCaptures - - 1 - - name - punctuation.whitespace.comment.leading.ini - - - end - (?!\G) - patterns - - - begin - ; - beginCaptures - - 0 - - name - punctuation.definition.comment.ini - - - end - \n - name - comment.line.semicolon.ini - - - - - captures - - 1 - - name - keyword.other.definition.ini - - 2 - - name - punctuation.separator.key-value.ini - - - match - \b([a-zA-Z0-9_.-]+)\b\s*(=) - - - captures - - 1 - - name - punctuation.definition.entity.ini - - 3 - - name - punctuation.definition.entity.ini - - - match - ^(\[)(.*?)(\]) - name - entity.name.section.group-title.ini - - - begin - ' - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ini - - - end - ' - endCaptures - - 0 - - name - punctuation.definition.string.end.ini - - - name - string.quoted.single.ini - patterns - - - match - \\. - name - constant.character.escape.ini - - - - - begin - " - beginCaptures - - 0 - - name - punctuation.definition.string.begin.ini - - - end - " - endCaptures - - 0 - - name - punctuation.definition.string.end.ini - - - name - string.quoted.double.ini - - - scopeName - source.properties - uuid - 77DC23B6-8A90-11D9-BAA4-000A9584EC8C - - \ No newline at end of file diff --git a/lib/shiki-languages/data/grammars/rust.json b/lib/shiki-languages/data/grammars/rust.json deleted file mode 100644 index 7d1b5b1e..00000000 --- a/lib/shiki-languages/data/grammars/rust.json +++ /dev/null @@ -1,595 +0,0 @@ -{ - "name": "Rust", - "scopeName": "source.rust", - "fileTypes": [ - "rs" - ], - "repository": { - "block_doc_comment": { - "comment": "Block documentation comment", - "name": "comment.block.documentation.rust", - "begin": "/\\*[\\*!](?![\\*/])", - "end": "\\*/", - "patterns": [ - { - "include": "#block_doc_comment" - }, - { - "include": "#block_comment" - } - ] - }, - "block_comment": { - "comment": "Block comment", - "name": "comment.block.rust", - "begin": "/\\*", - "end": "\\*/", - "patterns": [ - { - "include": "#block_doc_comment" - }, - { - "include": "#block_comment" - } - ] - }, - "line_doc_comment": { - "comment": "Single-line documentation comment", - "name": "comment.line.documentation.rust", - "begin": "//[!/](?=[^/])", - "end": "$" - }, - "line_comment": { - "comment": "Single-line comment", - "name": "comment.line.double-slash.rust", - "begin": "//", - "end": "$" - }, - "escaped_character": { - "name": "constant.character.escape.rust", - "match": "\\\\(x\\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)" - }, - "string_literal": { - "comment": "Double-quote string literal", - "name": "string.quoted.double.rust", - "begin": "b?\"", - "end": "\"", - "patterns": [ - { - "include": "#escaped_character" - } - ] - }, - "raw_string_literal": { - "comment": "Raw double-quote string literal", - "name": "string.quoted.double.raw.rust", - "begin": "b?r(#*)\"", - "end": "\"\\1" - }, - "sigils": { - "comment": "Sigil", - "name": "keyword.operator.sigil.rust", - "match": "[&*](?=[a-zA-Z0-9_\\(\\[\\|\\\"]+)" - }, - "self": { - "comment": "Self variable", - "name": "variable.language.rust", - "match": "\\bself\\b" - }, - "mut": { - "comment": "Mutable storage modifier", - "name": "storage.modifier.mut.rust", - "match": "\\bmut\\b" - }, - "box": { - "comment": "Box storage modifier", - "name": "storage.modifier.box.rust", - "match": "\\bbox\\b" - }, - "const": { - "comment": "Const storage modifier", - "name": "storage.modifier.const.rust", - "match": "\\bconst\\b" - }, - "pub": { - "comment": "Visibility modifier", - "name": "storage.modifier.visibility.rust", - "match": "\\bpub\\b" - }, - "lifetime": { - "comment": "Named lifetime", - "name": "storage.modifier.lifetime.rust", - "match": "'([a-zA-Z_][a-zA-Z0-9_]*)\\b", - "captures": { - "1": { - "name": "entity.name.lifetime.rust" - } - } - }, - "ref_lifetime": { - "comment": "Reference with named lifetime", - "match": "&('([a-zA-Z_][a-zA-Z0-9_]*))\\b", - "captures": { - "1": { - "name": "storage.modifier.lifetime.rust" - }, - "2": { - "name": "entity.name.lifetime.rust" - } - } - }, - "core_types": { - "comment": "Built-in/core type", - "name": "storage.type.core.rust", - "match": "\\b(bool|char|usize|isize|u8|u16|u32|u64|i8|i16|i32|i64|f32|f64|str|Self|Option|Result)\\b" - }, - "core_vars": { - "comment": "Core type variant", - "name": "support.constant.core.rust", - "match": "\\b(Some|None|Ok|Err)\\b" - }, - "core_marker": { - "comment": "Core trait (marker)", - "name": "support.type.marker.rust", - "match": "\\b(Copy|Send|Sized|Sync)\\b" - }, - "core_traits": { - "comment": "Core trait", - "name": "support.type.core.rust", - "match": "\\b(Drop|Fn|FnMut|FnOnce|Clone|PartialEq|PartialOrd|Eq|Ord|AsRef|AsMut|Into|From|Default|Iterator|Extend|IntoIterator|DoubleEndedIterator|ExactSizeIterator)\\b" - }, - "where": { - "comment": "Where clause", - "name": "keyword.other.rust", - "match": "\\bwhere\\b" - }, - "std_types": { - "comment": "Standard library type", - "name": "storage.class.std.rust", - "match": "\\b(Box|String|Vec|Path|PathBuf)\\b" - }, - "std_traits": { - "comment": "Standard library trait", - "name": "support.type.std.rust", - "match": "\\b(ToOwned|ToString)\\b" - }, - "type_params": { - "comment": "Type parameters", - "name": "meta.type_params.rust", - "begin": "<(?![=<])", - "end": ">", - "patterns": [ - { - "include": "#block_comment" - }, - { - "include": "#line_comment" - }, - { - "include": "#sigils" - }, - { - "include": "#mut" - }, - { - "include": "#lifetime" - }, - { - "include": "#core_types" - }, - { - "include": "#core_marker" - }, - { - "include": "#core_traits" - }, - { - "include": "#std_types" - }, - { - "include": "#std_traits" - }, - { - "include": "#type_params" - } - ] - } - }, - "patterns": [ - { - "include": "#block_doc_comment" - }, - { - "include": "#block_comment" - }, - { - "include": "#line_doc_comment" - }, - { - "include": "#line_comment" - }, - { - "comment": "Attribute", - "name": "meta.attribute.rust", - "begin": "#\\!?\\[", - "end": "\\]", - "patterns": [ - { - "include": "#string_literal" - } - ] - }, - { - "comment": "Single-quote string literal (character)", - "name": "string.quoted.single.rust", - "match": "b?'([^'\\\\]|\\\\(x\\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.))'" - }, - { - "include": "#string_literal" - }, - { - "include": "#raw_string_literal" - }, - { - "comment": "Floating point literal (fraction)", - "name": "constant.numeric.float.rust", - "match": "\\b[0-9][0-9_]*\\.[0-9][0-9_]*([eE][+-]?[0-9_]+)?(f32|f64)?\\b" - }, - { - "comment": "Floating point literal (exponent)", - "name": "constant.numeric.float.rust", - "match": "\\b[0-9][0-9_]*(\\.[0-9][0-9_]*)?[eE][+-]?[0-9_]+(f32|f64)?\\b" - }, - { - "comment": "Floating point literal (typed)", - "name": "constant.numeric.float.rust", - "match": "\\b[0-9][0-9_]*(\\.[0-9][0-9_]*)?([eE][+-]?[0-9_]+)?(f32|f64)\\b" - }, - { - "comment": "Integer literal (decimal)", - "name": "constant.numeric.integer.decimal.rust", - "match": "\\b[0-9][0-9_]*([ui](8|16|32|64|s|size))?\\b" - }, - { - "comment": "Integer literal (hexadecimal)", - "name": "constant.numeric.integer.hexadecimal.rust", - "match": "\\b0x[a-fA-F0-9_]+([ui](8|16|32|64|s|size))?\\b" - }, - { - "comment": "Integer literal (octal)", - "name": "constant.numeric.integer.octal.rust", - "match": "\\b0o[0-7_]+([ui](8|16|32|64|s|size))?\\b" - }, - { - "comment": "Integer literal (binary)", - "name": "constant.numeric.integer.binary.rust", - "match": "\\b0b[01_]+([ui](8|16|32|64|s|size))?\\b" - }, - { - "comment": "Static storage modifier", - "name": "storage.modifier.static.rust", - "match": "\\bstatic\\b" - }, - { - "comment": "Boolean constant", - "name": "constant.language.boolean.rust", - "match": "\\b(true|false)\\b" - }, - { - "comment": "Control keyword", - "name": "keyword.control.rust", - "match": "\\b(break|continue|else|if|in|for|loop|match|return|while)\\b" - }, - { - "comment": "Keyword", - "name": "keyword.other.rust", - "match": "\\b(crate|extern|mod|let|proc|ref|use|super|as|where|move)\\b" - }, - { - "comment": "Unsafe code keyword", - "name": "keyword.other.unsafe.rust", - "match": "\\bunsafe\\b" - }, - { - "include": "#sigils" - }, - { - "include": "#self" - }, - { - "include": "#mut" - }, - { - "include": "#box" - }, - { - "include": "#lifetime" - }, - { - "include": "#ref_lifetime" - }, - { - "include": "#const" - }, - { - "include": "#pub" - }, - { - "comment": "Miscellaneous operator", - "name": "keyword.operator.misc.rust", - "match": "(=>|::|\\bas\\b)" - }, - { - "comment": "Comparison operator", - "name": "keyword.operator.comparison.rust", - "match": "(&&|\\|\\||==|!=)" - }, - { - "comment": "Assignment operator", - "name": "keyword.operator.assignment.rust", - "match": "(\\+=|-=|/=|\\*=|%=|\\^=|&=|\\|=|<<=|>>=|=)" - }, - { - "comment": "Arithmetic operator", - "name": "keyword.operator.arithmetic.rust", - "match": "(!|\\+|-|/|\\*|%|\\^|&|\\||<<|>>)" - }, - { - "comment": "Comparison operator (second group because of regex precedence)", - "name": "keyword.operator.comparison.rust", - "match": "(<=|>=|<|>)" - }, - { - "include": "#core_types" - }, - { - "include": "#core_vars" - }, - { - "include": "#core_marker" - }, - { - "include": "#core_traits" - }, - { - "include": "#std_types" - }, - { - "include": "#std_traits" - }, - { - "comment": "Built-in macro", - "name": "support.function.builtin.rust", - "match": "\\b(macro_rules|format_args|env|option_env|concat_idents|concat|log_syntax|line|column|file|stringify|include|include_str|include_bytes|module_path|asm|cfg|trace_macros)!" - }, - { - "comment": "Core macro", - "name": "support.function.core.rust", - "match": "\\b(panic|assert|assert_eq|debug_assert|debug_assert_eq|try|write|writeln|unreachable|unimplemented)!" - }, - { - "comment": "Standard library macro", - "name": "support.function.std.rust", - "match": "\\b(format|print|println|select|vec)!" - }, - { - "comment": "Logging macro", - "name": "support.function.log.rust", - "match": "\\b(log|error|warn|info|debug|trace|log_enabled)!" - }, - { - "comment": "Invokation of a macro", - "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*\\!)\\s*[({\\[]", - "captures": { - "1": { - "name": "entity.name.function.macro.rust" - } - } - }, - { - "comment": "Function call", - "match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)\\s*\\(", - "captures": { - "1": { - "name": "entity.name.function.rust" - } - } - }, - { - "comment": "Function definition", - "begin": "\\b(fn)\\s+([a-zA-Z_][a-zA-Z0-9_]*)", - "end": "[\\{;]", - "beginCaptures": { - "1": { - "name": "keyword.other.fn.rust" - }, - "2": { - "name": "entity.name.function.rust" - } - }, - "patterns": [ - { - "include": "#block_comment" - }, - { - "include": "#line_comment" - }, - { - "include": "#sigils" - }, - { - "include": "#self" - }, - { - "include": "#mut" - }, - { - "include": "#ref_lifetime" - }, - { - "include": "#core_types" - }, - { - "include": "#core_marker" - }, - { - "include": "#core_traits" - }, - { - "include": "#std_types" - }, - { - "include": "#std_traits" - }, - { - "include": "#type_params" - }, - { - "include": "#const" - }, - { - "include": "#where" - } - ] - }, - { - "comment": "Type declaration", - "begin": "\\b(enum|struct|trait)\\s+([a-zA-Z_][a-zA-Z0-9_]*)", - "end": "[\\{\\(;]", - "beginCaptures": { - "1": { - "name": "storage.type.rust" - }, - "2": { - "name": "entity.name.type.rust" - } - }, - "patterns": [ - { - "include": "#block_comment" - }, - { - "include": "#line_comment" - }, - { - "include": "#core_traits" - }, - { - "include": "#std_traits" - }, - { - "include": "#type_params" - }, - { - "include": "#core_types" - }, - { - "include": "#pub" - }, - { - "include": "#where" - } - ] - }, - { - "comment": "Type alias", - "begin": "\\b(type)\\s+([a-zA-Z_][a-zA-Z0-9_]*)", - "end": ";", - "beginCaptures": { - "1": { - "name": "storage.type.rust" - }, - "2": { - "name": "entity.name.type.rust" - } - }, - "patterns": [ - { - "include": "#block_comment" - }, - { - "include": "#line_comment" - }, - { - "include": "#sigils" - }, - { - "include": "#mut" - }, - { - "include": "#ref_lifetime" - }, - { - "include": "#core_types" - }, - { - "include": "#core_marker" - }, - { - "include": "#core_traits" - }, - { - "include": "#std_types" - }, - { - "include": "#std_traits" - }, - { - "include": "#type_params" - } - ] - }, - { - "comment": "Implementation", - "begin": "\\b(impl)\\b", - "end": "\\{", - "beginCaptures": { - "1": { - "name": "storage.type.rust" - } - }, - "patterns": [ - { - "include": "#block_comment" - }, - { - "include": "#line_comment" - }, - { - "include": "#sigils" - }, - { - "include": "#mut" - }, - { - "include": "#ref_lifetime" - }, - { - "include": "#core_types" - }, - { - "include": "#core_marker" - }, - { - "include": "#core_traits" - }, - { - "include": "#std_types" - }, - { - "include": "#std_traits" - }, - { - "include": "#type_params" - }, - { - "name": "storage.type.rust", - "match": "\\bfor\\b" - }, - { - "include": "#where" - } - ] - } - ] -} \ No newline at end of file diff --git a/lib/shiki-languages/data/grammars/scss.json b/lib/shiki-languages/data/grammars/scss.json deleted file mode 100644 index 6821cee6..00000000 --- a/lib/shiki-languages/data/grammars/scss.json +++ /dev/null @@ -1,1672 +0,0 @@ -{ - "scopeName": "source.css.scss", - "name": "SCSS", - "fileTypes": [ - "scss", - "css.scss", - "css.scss.erb", - "scss.erb" - ], - "patterns": [ - { - "include": "#variable_setting" - }, - { - "include": "#at_rule_include" - }, - { - "include": "#at_rule_import" - }, - { - "include": "#general" - }, - { - "include": "#flow_control" - }, - { - "include": "#rules" - }, - { - "include": "#property_list" - }, - { - "include": "#at_rule_mixin" - }, - { - "include": "#at_rule_media" - }, - { - "include": "#at_rule_function" - }, - { - "include": "#at_rule_charset" - }, - { - "include": "#at_rule_option" - }, - { - "include": "#at_rule_namespace" - }, - { - "include": "#at_rule_fontface" - }, - { - "include": "#at_rule_page" - }, - { - "include": "#at_rule_keyframes" - }, - { - "include": "#at_rule_at_root" - }, - { - "include": "#at_rule_supports" - } - ], - "repository": { - "at_rule__": { - "comment": "Note how all @rules are prefixed." - }, - "at_rule_charset": { - "begin": "\\s*((@)charset\\b)\\s*", - "captures": { - "1": { - "name": "keyword.control.at-rule.charset.scss" - }, - "2": { - "name": "punctuation.definition.keyword.scss" - } - }, - "comment": "Charset", - "end": "\\s*((?=;|$))", - "name": "meta.at-rule.charset.scss", - "patterns": [ - { - "include": "#variable" - }, - { - "include": "#string_single" - }, - { - "include": "#string_double" - } - ] - }, - "at_rule_content": { - "begin": "\\s*((@)content\\b)\\s*", - "captures": { - "1": { - "name": "keyword.control.content.scss" - } - }, - "end": "\\s*((?=;))", - "name": "meta.content.scss", - "patterns": [ - { - "include": "#variable" - }, - { - "include": "#selectors" - }, - { - "include": "#property_values" - } - ] - }, - "at_rule_each": { - "begin": "\\s*((@)each\\b)\\s*", - "captures": { - "1": { - "name": "keyword.control.each.scss" - }, - "2": { - "name": "punctuation.definition.keyword.scss" - } - }, - "end": "\\s*((?=}))", - "name": "meta.at-rule.each.scss", - "patterns": [ - { - "match": "\\b(in|,)\\b", - "name": "keyword.control.operator" - }, - { - "include": "#variable" - }, - { - "include": "#property_values" - }, - { - "include": "$self" - } - ] - }, - "at_rule_else": { - "begin": "\\s*((@)else(\\s*(if)?))\\s*", - "captures": { - "1": { - "name": "keyword.control.else.scss" - }, - "2": { - "name": "punctuation.definition.keyword.scss" - } - }, - "end": "\\s*(?={)", - "name": "meta.at-rule.else.scss", - "patterns": [ - { - "include": "#conditional_operators" - }, - { - "include": "#variable" - }, - { - "include": "#property_values" - } - ] - }, - "at_rule_extend": { - "begin": "\\s*((@)extend\\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": "#selectors" - }, - { - "include": "#property_values" - } - ] - }, - "at_rule_fontface": { - "patterns": [ - { - "begin": "^\\s*((@)font-face\\b)", - "beginCaptures": { - "1": { - "name": "keyword.control.at-rule.fontface.scss" - }, - "2": { - "name": "punctuation.definition.keyword.scss" - } - }, - "end": "\\s*(?={)", - "name": "meta.at-rule.fontface.scss", - "patterns": [ - { - "include": "#function_attributes" - } - ] - } - ] - }, - "at_rule_for": { - "begin": "\\s*((@)for\\b)\\s*", - "captures": { - "1": { - "name": "keyword.control.for.scss" - }, - "2": { - "name": "punctuation.definition.keyword.scss" - } - }, - "end": "\\s*(?={)", - "name": "meta.at-rule.for.scss", - "patterns": [ - { - "match": "(==|!=|<=|>=|<|>|from|to|through)", - "name": "keyword.control.operator" - }, - { - "include": "#variable" - }, - { - "include": "#property_values" - }, - { - "include": "$self" - } - ] - }, - "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" - } - }, - "comment": "Function with Attributes", - "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" - } - }, - "comment": "Simple Function", - "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*(\\()", - "beginCaptures": { - "1": { - "name": "entity.name.function.scss" - }, - "2": { - "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-]+)", - "captures": { - "0": { - "name": "meta.at-rule.include.scss" - }, - "1": { - "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)\\s*", - "end": "\\s*(?={)", - "captures": { - "1": { - "name": "keyword.control.at-rule.media.scss" - }, - "2": { - "name": "punctuation.definition.keyword.scss" - } - }, - "name": "meta.at-rule.media.scss", - "patterns": [ - { - "match": "\\b(only)\\b", - "name": "keyword.control.operator" - }, - { - "include": "#media_features" - }, - { - "include": "#property_values" - }, - { - "include": "#variable" - }, - { - "include": "#conditional_operators" - }, - { - "include": "#media_types" - }, - { - "include": "#property_names" - } - ] - } - ] - }, - "at_rule_mixin": { - "patterns": [ - { - "begin": "(?<=@mixin)\\s+([\\w-]+)\\s*(\\()", - "beginCaptures": { - "1": { - "name": "entity.name.function.scss" - }, - "2": { - "name": "punctuation.definition.parameters.begin.bracket.round.scss" - } - }, - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.definition.parameters.end.bracket.round.scss" - } - }, - "name": "meta.at-rule.mixin.scss", - "patterns": [ - { - "include": "#function_attributes" - } - ] - }, - { - "match": "(?<=@mixin)\\s+([\\w-]+)", - "captures": { - "1": { - "name": "entity.name.function.scss" - } - }, - "name": "meta.at-rule.mixin.scss" - }, - { - "match": "((@)mixin)\\b", - "captures": { - "1": { - "name": "keyword.control.at-rule.mixin.scss" - }, - "2": { - "name": "punctuation.definition.keyword.scss" - } - }, - "name": "meta.at-rule.mixin.scss" - } - ] - }, - "at_rule_namespace": { - "patterns": [ - { - "begin": "(?<=@namespace)\\s+(?=url)", - "end": "(?=;|$)", - "name": "meta.at-rule.namespace.scss", - "patterns": [ - { - "include": "#property_values" - }, - { - "include": "#string_single" - }, - { - "include": "#string_double" - } - ] - }, - { - "begin": "(?<=@namespace)\\s+([\\w-]*)", - "captures": { - "1": { - "name": "entity.name.namespace-prefix.scss" - } - }, - "end": "(?=;|$)", - "name": "meta.at-rule.namespace.scss", - "patterns": [ - { - "include": "#variables" - }, - { - "include": "#property_values" - }, - { - "include": "#string_single" - }, - { - "include": "#string_double" - } - ] - }, - { - "match": "((@)namespace)\\b", - "captures": { - "1": { - "name": "keyword.control.at-rule.namespace.scss" - }, - "2": { - "name": "punctuation.definition.keyword.scss" - } - }, - "name": "meta.at-rule.namespace.scss" - } - ] - }, - "at_rule_option": { - "captures": { - "1": { - "name": "keyword.control.at-rule.charset.scss" - }, - "2": { - "name": "punctuation.definition.keyword.scss" - } - }, - "comment": "Option", - "match": "^\\s*((@)option\\b)\\s*", - "name": "meta.at-rule.option.scss" - }, - "at_rule_page": { - "patterns": [ - { - "begin": "^\\s*((@)page)(?=:|\\s)\\s*([-:\\w]*)", - "captures": { - "1": { - "name": "keyword.control.at-rule.page.scss" - }, - "2": { - "name": "punctuation.definition.keyword.scss" - }, - "3": { - "name": "entity.name.function.scss" - } - }, - "comment": "Page with Attributes", - "end": "\\s*(?={)", - "name": "meta.at-rule.page.scss" - } - ] - }, - "at_rule_return": { - "begin": "\\s*((@)(return)\\b)", - "captures": { - "1": { - "name": "keyword.control.return.scss" - }, - "2": { - "name": "punctuation.definition.keyword.scss" - } - }, - "end": "\\s*((?=;))", - "name": "meta.at-rule.return.scss", - "patterns": [ - { - "include": "#variable" - }, - { - "include": "#property_values" - } - ] - }, - "at_rule_at_root": { - "begin": "\\s*((@)(at-root))(\\s+|$)", - "end": "\\s*(?={)", - "beginCaptures": { - "1": { - "name": "keyword.control.at-rule.at-root.scss" - }, - "2": { - "name": "punctuation.definition.keyword.scss" - } - }, - "name": "meta.at-rule.at-root.scss", - "patterns": [ - { - "include": "#function_attributes" - }, - { - "include": "#functions" - }, - { - "include": "#selectors" - } - ] - }, - "at_rule_supports": { - "begin": "(?<=^|\\s)(@)supports\\b", - "captures": { - "0": { - "name": "keyword.control.at-rule.supports.scss" - }, - "1": { - "name": "punctuation.definition.keyword.scss" - } - }, - "end": "(?={)|$", - "name": "meta.at-rule.supports.scss", - "patterns": [ - { - "include": "#logical_operators" - }, - { - "include": "#properties" - }, - { - "match": "\\(", - "name": "punctuation.definition.condition.begin.bracket.round.scss" - }, - { - "match": "\\)", - "name": "punctuation.definition.condition.end.bracket.round.scss" - } - ] - }, - "at_rule_warn": { - "begin": "\\s*((@)(warn|debug|error)\\b)\\s*", - "captures": { - "1": { - "name": "keyword.control.warn.scss" - }, - "2": { - "name": "punctuation.definition.keyword.scss" - } - }, - "end": "\\s*(?=;)", - "name": "meta.at-rule.warn.scss", - "patterns": [ - { - "include": "#variable" - }, - { - "include": "#string_double" - }, - { - "include": "#string_single" - } - ] - }, - "at_rule_while": { - "begin": "\\s*((@)while\\b)\\s*", - "captures": { - "1": { - "name": "keyword.control.while.scss" - }, - "2": { - "name": "punctuation.definition.keyword.scss" - } - }, - "end": "\\s*(?=})", - "name": "meta.at-rule.while.scss", - "patterns": [ - { - "include": "#conditional_operators" - }, - { - "include": "#variable" - }, - { - "include": "#property_values" - }, - { - "include": "$self" - } - ] - }, - "comment_block": { - "begin": "/\\*", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.scss" - } - }, - "end": "\\*/", - "endCaptures": { - "0": { - "name": "punctuation.definition.comment.scss" - } - }, - "name": "comment.block.scss" - }, - "comment_line": { - "begin": "//", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.scss" - } - }, - "end": "\\n", - "name": "comment.line.scss" - }, - "constant_color": { - "comment": "http://www.w3.org/TR/css3-color/#svg-color", - "match": "\\b(aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen)\\b", - "name": "support.constant.color.w3c-standard-color-name.scss" - }, - "constant_default": { - "match": "!default", - "name": "keyword.other.default.scss" - }, - "constant_deprecated_color": { - "comment": "These colours are deprecated from CSS color module level 3 http://www.w3.org/TR/css3-color/#css2-system", - "match": "\\b(ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonFace|ButtonHighlight|ButtonShadow|ButtonText|CaptionText|GrayText|Highlight|HighlightText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText)\\b", - "name": "invalid.deprecated.color.system.css.scss" - }, - "constant_font": { - "match": "(\\b(?i:arial|century|comic|courier|garamond|georgia|helvetica|impact|lucida|symbol|system|tahoma|times|trebuchet|utopia|verdana|webdings|sans-serif|serif|monospace)\\b)", - "name": "support.constant.font-name.scss" - }, - "constant_functions": { - "begin": "([\\w-]+)(\\()", - "beginCaptures": { - "1": { - "name": "support.function.misc.scss" - }, - "2": { - "name": "punctuation.section.function.scss" - } - }, - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.section.function.scss" - } - }, - "patterns": [ - { - "include": "#parameters" - } - ] - }, - "constant_hex": { - "captures": { - "1": { - "name": "punctuation.definition.constant.scss" - } - }, - "match": "(#)([0-9a-fA-F]{3}|[0-9a-fA-F]{6})\\b", - "name": "constant.numeric.color.hex-value.scss" - }, - "constant_important": { - "match": "!important", - "name": "keyword.other.important.scss" - }, - "constant_mathematical_symbols": { - "match": "\\b(\\+|-|\\*|/)\\b", - "name": "support.constant.mathematical-symbols.scss" - }, - "constant_number": { - "match": "(\\b([0-9]+(\\.[0-9]+)?)|\\B\\.[0-9]+)(?=\\s*(ch|cm|deg|dpi|dpcm|dppx|em|ex|grad|in|mm|mozmm|ms|pc|pt|px|rad|rem|turn|s|vh|vmin|vmax|vw|\\b))", - "name": "constant.numeric.scss" - }, - "constant_optional": { - "match": "!optional", - "name": "keyword.other.optional.scss" - }, - "constant_property_value": { - "match": "\\b(absolute|all-scroll|always|armenian|auto|baseline|below|bidi-override|block|bold|bolder|both|bottom|border-box|break-all|break-word|butt|capitalize|center|char|circle|cjk-ideographic|col-resize|collapse|column-reverse|column|contain|content-box|cover|crosshair|currentColor|dashed|decimal-leading-zero|decimal|default|disabled|disc|distribute-all-lines|distribute-letter|distribute-space|distribute|dotted|double|e-resize|ease-in-out|ease-in|ease-out|ease|ellipsis|fill|fixed|flex-end|flex-start|flex|georgian|grid|groove|hand|hebrew|help|hidden|hiragana-iroha|hiragana|horizontal|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space|inactive|inherit|inline-block|inline-flex|inline-grid|inline-table|inline|inset|inside|inter-ideograph|inter-word|italic|justify|katakana-iroha|katakana|keep-all|landscape|left|lighter|line-edge|line-through|line|linear|list-item|loose|lower-alpha|lower-greek|lower-latin|lower-roman|lowercase|lr-tb|ltr|manipulation|medium|middle|move|n-resize|ne-resize|newspaper|no-drop|no-repeat|nw-resize|none|normal|not-allowed|nowrap|null|oblique|outset|outside|overline|pan-(x|y|left|right|up|down)|pointer|portrait|preserve-3d|progress|relative|repeat-x|repeat-y|repeat|right|ridge|round|row-resize|row-reverse|row|rtl|ruby-base-container|ruby-base|ruby-text-container|ruby-text|ruby|s-resize|scale-down|scroll|se-resize|separate|small-caps|solid|space-around|space-between|square|static|step-end|step-start|stretch|strict|super|sw-resize|table-caption|table-cell|table-column-group|table-column|table-footer-group|table-header-group|table-row-group|table-row|table|tb-rl|text-bottom|text-top|text|thick|thin|top|transparent|underline|upper-alpha|upper-latin|upper-roman|uppercase|vertical-ideographic|vertical-text|visible|w-resize|wait|whitespace|wrap|wrap-reverse|zero|true|false|vertical|horizontal)\\b", - "name": "support.constant.property-value.scss" - }, - "constant_rgb": { - "match": "(?x)\n(?=|<|>", - "name": "keyword.operator.comparison.scss" - }, - "logical_operators": { - "match": "\\b(not\\b|or\\b|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.set.variable.map.scss", - "patterns": [ - { - "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": "#property_values" - }, - { - "include": "#variable" - }, - { - "include": "#map" - } - ] - }, - "media_attributes": { - "patterns": [ - { - "match": ":", - "name": "punctuation.separator.key-value.scss" - }, - { - "include": "#general" - }, - { - "include": "#property_name" - }, - { - "include": "#property_values" - }, - { - "comment": "We even have error highlighting <3", - "match": "[={}\\?@]", - "name": "invalid.illegal.scss" - } - ] - }, - "media_features": { - "patterns": [ - { - "match": "\\b(min-device-aspect-ratio|max-device-aspect-ratio|device-aspect-ratio|min-aspect-ratio|max-aspect-ratio|aspect-ratio|min-device-height|max-device-height|device-height|min-device-width|max-device-width|device-width|min-monochrome|max-monochrome|monochrome|min-color-index|max-color-index|color-index|min-color|max-color|color|orientation|scan|min-resolution|max-resolution|resolution|grid|min-width|max-width|width)\\b", - "name": "support.type.property-name.media.css" - } - ] - }, - "media_types": { - "patterns": [ - { - "match": "\\b(all|aural|braille|embossed|handheld|print|projection|screen|tty|tv)\\b", - "name": "support.constant.media.css" - } - ] - }, - "operators": { - "match": "[-+*/](?!\\s*[-+*/])", - "name": "keyword.operator.css" - }, - "parameters": { - "patterns": [ - { - "include": "#variable" - }, - { - "include": "#property_values" - }, - { - "include": "#comment_block" - }, - { - "begin": "\\(", - "beginCaptures": { - "0": { - "name": "punctuation.definition.begin.bracket.round.scss" - } - }, - "end": "\\)", - "endCaptures": { - "0": { - "name": "punctuation.definition.end.bracket.round.scss" - } - }, - "patterns": [ - { - "include": "#function_attributes" - } - ] - }, - { - "match": "[^'\",) \\t]+", - "name": "variable.parameter.url.scss" - }, - { - "match": ",", - "name": "punctuation.separator.delimiter.scss" - } - ] - }, - "properties": { - "patterns": [ - { - "begin": "(?(['\"])(?:[^\\\\]|\\\\.)*?(\\6)))))?\\s*(])", - "name": "meta.attribute-selector.scss" - }, - "selector_class": { - "begin": "(\\.)(?=[\\w-]|#{)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.entity.css" - } - }, - "end": "(?![\\w-]|(#{))", - "name": "entity.other.attribute-name.class.css", - "patterns": [ - { - "include": "#interpolation" - } - ] - }, - "selector_entities": { - "match": "\\b(a|abbr|acronym|address|area|article|aside|audio|b|base|bdi|bdo|big|blockquote|body|br|button|canvas|caption|circle|cite|code|col|colgroup|data|datalist|dd|del|details|dfn|dialog|div|dl|dt|ellipse|em|embed|eventsource|fieldset|figure|figcaption|footer|form|frame|frameset|g|(h[1-6])|head|header|hgroup|hr|html|i|iframe|img|image|input|ins|kbd|keygen|label|legend|li|line(?!-)|link|main|map|mark|menu|menuitem|meta|meter|nav|noframes|noscript|object(?!-)|ol|optgroup|option|output|p|param|path|picture|polygon|polyline|pre|progress|q|rb|rect|rp|rt|rtc|ruby|s|samp|script|section|select|small|source|span|strike|strong|style|sub|summary|sup|svg|table(?!-)|tbody|td|template|text(?!-)|textarea|textpath|tfoot|th|thead|time|title|tr|track|tspan|tt|u|ul|var|video|wbr)\\b", - "name": "entity.name.tag.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": { - "captures": { - "1": { - "name": "punctuation.definition.entity.css" - } - }, - "match": "(#)[a-zA-Z][a-zA-Z0-9_-]*", - "name": "entity.other.attribute-name.id.css" - }, - "selector_placeholder": { - "captures": { - "1": { - "name": "punctuation.definition.entity.scss" - } - }, - "match": "(%)[a-zA-Z0-9_-]+", - "name": "entity.other.attribute-name.placeholder.scss" - }, - "parent_selector_suffix": { - "match": "(?<=&)[a-zA-Z0-9_-]+", - "name": "entity.other.attribute-name.parent-selector-suffix.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": [ - { - "match": "\\d+", - "name": "constant.numeric.scss" - }, - { - "match": "(?<=\\d)n\\b|\\b(n|even|odd)\\b", - "name": "constant.other.scss" - }, - { - "match": "\\w+", - "name": "invalid.illegal.scss" - } - ] - }, - { - "match": "(?x)\n(:)\\b\n(link|visited|hover|active|focus|target|lang|disabled|enabled|checked|\nindeterminate|root|first-child|last-child|first-of-type|last-of-type|\nonly-child|only-of-type|empty|not|valid|invalid)\\b", - "captures": { - "0": { - "name": "entity.other.attribute-name.pseudo-class.css" - }, - "1": { - "name": "punctuation.definition.entity.css" - } - } - } - ] - }, - "selector_pseudo_element": { - "captures": { - "1": { - "name": "punctuation.definition.entity.css" - } - }, - "match": "(:+)((-(moz|webkit|ms)-)?(after|before|first-letter|first-line|selection))\\b", - "name": "entity.other.attribute-name.pseudo-element.css" - }, - "selectors": { - "comment": "Stuff for Selectors.", - "patterns": [ - { - "include": "#selector_entities" - }, - { - "include": "#selector_custom" - }, - { - "include": "#selector_class" - }, - { - "include": "#selector_id" - }, - { - "include": "#selector_pseudo_class" - }, - { - "include": "#tag_wildcard" - }, - { - "include": "#tag_parent_reference" - }, - { - "include": "#selector_pseudo_element" - }, - { - "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": "\\s*(\\$[A-Za-z0-9_-]+\\b)\\s*(:)\\s*", - "captures": { - "1": { - "name": "variable.scss" - }, - "2": { - "name": "punctuation.separator.key-value.scss" - } - }, - "end": "\\s*(?=;)", - "name": "meta.set.variable.scss", - "patterns": [ - { - "include": "#comment_block" - }, - { - "include": "#comment_line" - }, - { - "include": "#map" - }, - { - "include": "#property_values" - }, - { - "include": "#variable" - } - ] - }, - "variables": { - "match": "\\$[A-Za-z0-9_-]+\\b", - "name": "variable.scss" - } - }, - "version": "https://github.com/atom/language-sass/commit/b0417d1412a9169562f637133099fe2bb841a735" -} \ No newline at end of file diff --git a/lib/shiki-languages/data/grammars/shaderlab.json b/lib/shiki-languages/data/grammars/shaderlab.json deleted file mode 100644 index c86f7c50..00000000 --- a/lib/shiki-languages/data/grammars/shaderlab.json +++ /dev/null @@ -1,133 +0,0 @@ -{ - "scopeName": "source.shaderlab", - "name": "ShaderLab", - "fileTypes": [ - "shader" - ], - "patterns": [ - { - "match": "\\b([0-9]+\\.?[0-9]*)\\b", - "name": "constant.numeric.shaderlab" - }, - { - "match": "\\b(Shader|Properties|Category|SubShader|Tags|Pass)\\b", - "name": "support.class.shaderlab" - }, - { - "match": "\\b(CGPROGRAM|ENDCG)\\b", - "name": "support.class.shaderlab" - }, - { - "match": "\\b(Dependency|Fallback)\\b", - "name": "support.variable.shaderlab" - }, - { - "match": "^\\s*\\[(HideInInspector)\\]", - "name": "keyword.shaderlab" - }, - { - "match": "\\b(_\\w+)\\b", - "name": "support.variable.input.shaderlab" - }, - { - "match": "\\b(uv(2)*_\\w+|viewDir|COLOR|screenPos|worldPos|worldRefl|worldNormal|worldRefl|worldNormal)\\b", - "name": "support.variable.input.shaderlab" - }, - { - "match": "\\b(Albedo|Normal|Emission|Specular|Gloss|Alpha)\\b", - "name": "support.variable.output.shaderlab" - }, - { - "match": "\\b(appdata_(base|tan|full|img)|SurfaceOutput)\\b", - "name": "support.variable.structure.shaderlab" - }, - { - "match": "\\b(UNITY_MATRIX_(MVP|MV|V|P|VP|T_MV|IT_MV|TEXTURE0|TEXTURE1|TEXTURE2|TEXTURE3)|_Object2World|_World2Object|_WorldSpaceCameraPos|unity_Scale)\\b", - "name": "support.variable.transformation.shaderlab" - }, - { - "match": "\\b(_ModelLightColor[0-9]|_SpecularLightColor[0-9]|_ObjectSpaceLightPos|_Light2World|_World2Light|_Object2Light)\\b", - "name": "support.variable.lighting.shaderlab" - }, - { - "match": "\\b(_Time|_SinTime|_CosTime|unity_DeltaTime|_ProjectionParams|_ScreenParams)\\b", - "name": "support.variable.other.shaderlab" - }, - { - "include": "#comments" - }, - { - "include": "#strings" - }, - { - "include": "#functions" - }, - { - "include": "#cg" - } - ], - "repository": { - "comments": { - "patterns": [ - { - "begin": "//", - "end": "$", - "name": "comment.line.double-slash.shaderlab" - }, - { - "begin": "/\\*", - "end": "\\*/", - "name": "comment.line.block.shaderlab" - } - ] - }, - "strings": { - "patterns": [ - { - "begin": "\"", - "end": "\"", - "name": "string.quoted.double.shaderlab" - } - ] - }, - "functions": { - "patterns": [ - { - "match": "(?x) (?: (?= \\s ) (?:(?<=else|new|return) | (?\\\\\\s*\\n)" - } - ] - } - ] - } - ] - }, - "escaped-char": { - "patterns": [ - { - "name": "constant.character.escape.swift", - "match": "\\\\[0\\\\tnr\"']" - }, - { - "name": "constant.character.escape.swift", - "match": "\\\\(x\\h{2}|u\\h{4}|U\\h{8})" - }, - { - "name": "invalid.illegal.constant.character.escape.swift", - "match": "\\\\[^uxU]" - } - ] - }, - "identifier": { - "match": "(?x) (? \\g \\g? | ` \\g \\g? ` ){0} (? [ a-z A-Z ] | [ \\u00A8 \\u00AA \\u00AD \\u00AF \\u00B2-\\u00B5 \\u00B7-\\u00BA ] | [ \\u00BC-\\u00BE \\u00C0-\\u00D6 \\u00D8-\\u00F6 \\u00F8-\\u00FF ] | [ \\u0100-\\u02FF \\u0370-\\u167F \\u1681-\\u180D \\u180F-\\u1DBF ] | [ \\u1E00-\\u1FFF ] | [ \\u200B-\\u200D \\u202A-\\u202E \\u203F-\\u2040 \\u2054 \\u2060-\\u206F ] | [ \\u2070-\\u20CF \\u2100-\\u218F \\u2460-\\u24FF \\u2776-\\u2793 ] | [ \\u2C00-\\u2DFF \\u2E80-\\u2FFF ] | [ \\u3004-\\u3007 \\u3021-\\u302F \\u3031-\\u303F \\u3040-\\uD7FF ] | [ \\uF900-\\uFD3D \\uFD40-\\uFDCF \\uFDF0-\\uFE1F \\uFE30-\\uFE44 ] | [ \\uFE47-\\uFFFD ] | [ \\u10000-\\u1FFFD \\u20000-\\u2FFFD \\u30000-\\u3FFFD \\u40000-\\u4FFFD ] | [ \\u50000-\\u5FFFD \\u60000-\\u6FFFD \\u70000-\\u7FFFD \\u80000-\\u8FFFD ] | [ \\u90000-\\u9FFFD \\uA0000-\\uAFFFD \\uB0000-\\uBFFFD \\uC0000-\\uCFFFD ] | [ \\uD0000-\\uDFFFD \\uE0000-\\uEFFFD ] ){0} (? \\d | [ \\u0300-\\u036F \\u1DC0-\\u1DFF \\u20D0-\\u20FF \\uFE20-\\uFE2F ] | \\g ){0} (? \\g \\g? ){0} (? (?) \\$ \\d+ (?!\\g) (?# FIXME) ){0} \\g | \\g", - "captures": { - "5": { - "name": "variable.other.positional.swift" - } - } - }, - "literal": { - "patterns": [ - { - "include": "#literal-number" - }, - { - "include": "#literal-string" - }, - { - "include": "#literal-boolean" - } - ] - }, - "literal-number": { - "name": "constant.numeric.swift", - "match": "(?x) (?### INTEGER ###) (? \\g | \\g | \\g | \\g ){0} (?### BINARY ###) (? 0b \\g \\g? ){0} (? [0-1] ){0} (? \\g | _ ){0} (? \\g \\g? ){0} (?### OCTAL ###) (? 0o \\g \\g? ){0} (? [0-7] ){0} (? \\g | _ ){0} (? \\g \\g? ){0} (?### DECIMAL ###) (? \\g \\g? ){0} (? \\d ){0} (? \\g | _ ){0} (? \\g \\g? ){0} (?### HEXADECIMAL ###) (? 0x \\g \\g? ){0} (? \\h ){0} (? \\g | _ ){0} (? \\g \\g? ){0} (?### FLOATING POINT ###) (? \\g \\g? \\g? | \\g \\g? \\g ){0} (? \\. \\g ){0} (? \\g \\g? \\g ){0} (? \\. \\g? ){0} (? \\g \\g? \\g ){0} (? [eE] ){0} (? [pP] ){0} (? [+-] ){0} (?!0[box]) \\g | \\g" - }, - "literal-string": { - "name": "string.quoted.double.swift", - "begin": "\"", - "end": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.swift" - } - }, - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.swift" - } - }, - "patterns": [ - { - "include": "#quoted-text" - } - ] - }, - "literal-boolean": { - "match": "\\b(true|false)\\b(?![?!])", - "name": "constant.language.boolean.swift" - }, - "operator": { - "patterns": [ - { - "include": "#operator-character" - } - ] - }, - "operator-character": { - "name": "keyword.operator.swift", - "match": "[\\/=\\-+!*%<>&|^~.]" - }, - "quoted-text": { - "patterns": [ - { - "name": "meta.embedded.line.swift", - "contentName": "source.swift", - "begin": "\\\\\\(", - "end": "\\)", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.swift" - } - }, - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.swift" - } - }, - "patterns": [ - { - "include": "$self" - } - ] - }, - { - "include": "#escaped-char" - } - ] - }, - "function": { - "name": "meta.function.swift", - "begin": "(func) \\s*", - "end": "(?=\\{|#)|;|$", - "beginCaptures": { - "1": { - "name": "storage.type.function.swift" - } - }, - "comment": "match regular function like: func myFunc(...)", - "patterns": [ - { - "begin": "([a-zA-Z_0-9]+)\\s*(\\()", - "beginCaptures": { - "1": { - "name": "entity.name.function.swift" - }, - "2": { - "name": "punctuation.definition.parameters.begin.swift" - } - }, - "comment": "match regular function like: func myFunc(...)", - "end": "(\\))", - "endCaptures": { - "1": { - "name": "punctuation.definition.parameters.end.swift" - } - } - }, - { - "name": "meta.return-type.swift", - "match": "((->)\\s*([^\\{]+))", - "captures": { - "2": { - "name": "punctuation.function.swift" - }, - "3": { - "name": "entity.name.type.class.swift" - } - } - } - ] - }, - "whitespace": { - "match": "(?x) [ \\u0020 (?# space) \\u000A (?# line-feed) \\u000D (?# carriage-return) \\u0009 (?# horizontal-tab) \\u000B (?# vertical-tab) \\u000C (?# form-feed) \\u0000 (?# null) ]" - }, - "attribute": { - "name": "storage.type.attribute.swift", - "begin": "@", - "end": " " - } - } -} \ No newline at end of file diff --git a/lib/shiki-languages/data/grammars/xml.json b/lib/shiki-languages/data/grammars/xml.json deleted file mode 100644 index 8237ae9f..00000000 --- a/lib/shiki-languages/data/grammars/xml.json +++ /dev/null @@ -1,426 +0,0 @@ -{ - "scopeName": "text.xml", - "name": "XML", - "fileTypes": [ - "atom", - "axml", - "bpmn", - "config", - "cpt", - "csl", - "csproj", - "csproj.user", - "dae", - "dia", - "dita", - "ditamap", - "dtml", - "fodg", - "fodp", - "fods", - "fodt", - "fsproj", - "fxml", - "glade", - "gpx", - "graphml", - "icls", - "iml", - "isml", - "jmx", - "jsp", - "launch", - "menu", - "mxml", - "nuspec", - "opml", - "owl", - "pom", - "ppj", - "proj", - "pt", - "pubxml", - "pubxml.user", - "rdf", - "rng", - "rss", - "shproj", - "storyboard", - "svg", - "targets", - "tld", - "vbox", - "vbox-prev", - "vbproj", - "vbproj.user", - "vcproj", - "vcproj.filters", - "vcxproj", - "vcxproj.filters", - "wsdl", - "xaml", - "xbl", - "xib", - "xlf", - "xliff", - "xml", - "xpdl", - "xsd", - "xul", - "ui" - ], - "patterns": [ - { - "begin": "(<\\?)\\s*([-_a-zA-Z0-9]+)", - "captures": { - "1": { - "name": "punctuation.definition.tag.xml" - }, - "2": { - "name": "entity.name.tag.xml" - } - }, - "end": "(\\?>)", - "name": "meta.tag.preprocessor.xml", - "patterns": [ - { - "match": " ([a-zA-Z-]+)", - "name": "entity.other.attribute-name.xml" - }, - { - "include": "#doublequotedString" - }, - { - "include": "#singlequotedString" - } - ] - }, - { - "begin": "()", - "name": "meta.tag.sgml.doctype.xml", - "patterns": [ - { - "include": "#internalSubset" - } - ] - }, - { - "include": "#comments" - }, - { - "begin": "(<)((?:([-_a-zA-Z0-9]+)(:))?([-_a-zA-Z0-9:]+))(?=(\\s[^>]*)?>)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.tag.xml" - }, - "2": { - "name": "entity.name.tag.xml" - }, - "3": { - "name": "entity.name.tag.namespace.xml" - }, - "4": { - "name": "punctuation.separator.namespace.xml" - }, - "5": { - "name": "entity.name.tag.localname.xml" - } - }, - "end": "(>)()", - "endCaptures": { - "1": { - "name": "punctuation.definition.tag.xml" - }, - "2": { - "name": "punctuation.definition.tag.xml" - }, - "3": { - "name": "entity.name.tag.xml" - }, - "4": { - "name": "entity.name.tag.namespace.xml" - }, - "5": { - "name": "punctuation.separator.namespace.xml" - }, - "6": { - "name": "entity.name.tag.localname.xml" - }, - "7": { - "name": "punctuation.definition.tag.xml" - } - }, - "name": "meta.tag.no-content.xml", - "patterns": [ - { - "include": "#tagStuff" - } - ] - }, - { - "begin": "()", - "name": "meta.tag.xml", - "patterns": [ - { - "include": "#tagStuff" - } - ] - }, - { - "include": "#entity" - }, - { - "include": "#bare-ampersand" - }, - { - "begin": "<%@", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.xml" - } - }, - "end": "%>", - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.xml" - } - }, - "name": "source.java-props.embedded.xml", - "patterns": [ - { - "match": "page|include|taglib", - "name": "keyword.other.page-props.xml" - } - ] - }, - { - "begin": "<%[!=]?(?!--)", - "beginCaptures": { - "0": { - "name": "punctuation.section.embedded.begin.xml" - } - }, - "end": "(?!--)%>", - "endCaptures": { - "0": { - "name": "punctuation.section.embedded.end.xml" - } - }, - "name": "source.java.embedded.xml", - "patterns": [ - { - "include": "source.java" - } - ] - }, - { - "begin": "", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.xml" - } - }, - "name": "string.unquoted.cdata.xml" - } - ], - "repository": { - "EntityDecl": { - "begin": "()", - "patterns": [ - { - "include": "#doublequotedString" - }, - { - "include": "#singlequotedString" - } - ] - }, - "bare-ampersand": { - "match": "&", - "name": "invalid.illegal.bad-ampersand.xml" - }, - "doublequotedString": { - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.xml" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.xml" - } - }, - "name": "string.quoted.double.xml", - "patterns": [ - { - "include": "#entity" - }, - { - "include": "#bare-ampersand" - } - ] - }, - "entity": { - "captures": { - "1": { - "name": "punctuation.definition.constant.xml" - }, - "3": { - "name": "punctuation.definition.constant.xml" - } - }, - "match": "(&)([:a-zA-Z_][:a-zA-Z0-9_.-]*|#[0-9]+|#x[0-9a-fA-F]+)(;)", - "name": "constant.character.entity.xml" - }, - "internalSubset": { - "begin": "(\\[)", - "captures": { - "1": { - "name": "punctuation.definition.constant.xml" - } - }, - "end": "(\\])", - "name": "meta.internalsubset.xml", - "patterns": [ - { - "include": "#EntityDecl" - }, - { - "include": "#parameterEntity" - }, - { - "include": "#comments" - } - ] - }, - "parameterEntity": { - "captures": { - "1": { - "name": "punctuation.definition.constant.xml" - }, - "3": { - "name": "punctuation.definition.constant.xml" - } - }, - "match": "(%)([:a-zA-Z_][:a-zA-Z0-9_.-]*)(;)", - "name": "constant.character.parameter-entity.xml" - }, - "singlequotedString": { - "begin": "'", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.xml" - } - }, - "end": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.xml" - } - }, - "name": "string.quoted.single.xml", - "patterns": [ - { - "include": "#entity" - }, - { - "include": "#bare-ampersand" - } - ] - }, - "tagStuff": { - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.namespace.xml" - }, - "2": { - "name": "entity.other.attribute-name.xml" - }, - "3": { - "name": "punctuation.separator.namespace.xml" - }, - "4": { - "name": "entity.other.attribute-name.localname.xml" - } - }, - "match": "(?:^|\\s+)(?:([-\\w.]+)((:)))?([-\\w.:]+)=" - }, - { - "include": "#doublequotedString" - }, - { - "include": "#singlequotedString" - } - ] - }, - "comments": { - "begin": "<[!%]--", - "captures": { - "0": { - "name": "punctuation.definition.comment.xml" - } - }, - "end": "--%?>", - "name": "comment.block.xml" - } - }, - "version": "https://github.com/atom/language-xml/commit/f461d428fb87040cb8a52d87d0b95151b9d3c0cc" -} \ No newline at end of file diff --git a/lib/shiki-languages/data/grammars/xsl.json b/lib/shiki-languages/data/grammars/xsl.json deleted file mode 100644 index 8b715b59..00000000 --- a/lib/shiki-languages/data/grammars/xsl.json +++ /dev/null @@ -1,93 +0,0 @@ -{ - "scopeName": "text.xml.xsl", - "name": "XSL", - "fileTypes": [ - "xsl", - "xslt" - ], - "patterns": [ - { - "begin": "(<)(xsl)((:))(template)", - "captures": { - "1": { - "name": "punctuation.definition.tag.xml" - }, - "2": { - "name": "entity.name.tag.namespace.xml" - }, - "3": { - "name": "entity.name.tag.xml" - }, - "4": { - "name": "punctuation.separator.namespace.xml" - }, - "5": { - "name": "entity.name.tag.localname.xml" - } - }, - "end": "(>)", - "name": "meta.tag.xml.template", - "patterns": [ - { - "captures": { - "1": { - "name": "entity.other.attribute-name.namespace.xml" - }, - "2": { - "name": "entity.other.attribute-name.xml" - }, - "3": { - "name": "punctuation.separator.namespace.xml" - }, - "4": { - "name": "entity.other.attribute-name.localname.xml" - } - }, - "match": " (?:([-_a-zA-Z0-9]+)((:)))?([a-zA-Z-]+)" - }, - { - "include": "#doublequotedString" - }, - { - "include": "#singlequotedString" - } - ] - }, - { - "include": "text.xml" - } - ], - "repository": { - "doublequotedString": { - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.xml" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.xml" - } - }, - "name": "string.quoted.double.xml" - }, - "singlequotedString": { - "begin": "'", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.xml" - } - }, - "end": "'", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.xml" - } - }, - "name": "string.quoted.single.xml" - } - }, - "version": "https://github.com/atom/language-xml/commit/507de2ee7daca60cf02e9e21fbeb92bbae73e280" -} \ No newline at end of file diff --git a/lib/shiki-languages/data/grammars/yaml.json b/lib/shiki-languages/data/grammars/yaml.json deleted file mode 100644 index a657a5d4..00000000 --- a/lib/shiki-languages/data/grammars/yaml.json +++ /dev/null @@ -1,629 +0,0 @@ -{ - "fileTypes": [ - "yaml", - "yml", - "rviz", - "reek", - "clang-format", - "yaml-tmlanguage", - "syntax", - "sublime-syntax" - ], - "firstLineMatch": "^%YAML( ?1.\\d+)?", - "keyEquivalent": "^~Y", - "name": "YAML", - "patterns": [ - { - "include": "#comment" - }, - { - "include": "#property" - }, - { - "include": "#directive" - }, - { - "match": "^---", - "name": "entity.other.document.begin.yaml" - }, - { - "match": "^\\.{3}", - "name": "entity.other.document.end.yaml" - }, - { - "include": "#node" - } - ], - "repository": { - "block-collection": { - "patterns": [ - { - "include": "#block-sequence" - }, - { - "include": "#block-mapping" - } - ] - }, - "block-mapping": { - "patterns": [ - { - "include": "#block-pair" - } - ] - }, - "block-node": { - "patterns": [ - { - "include": "#prototype" - }, - { - "include": "#block-scalar" - }, - { - "include": "#block-collection" - }, - { - "include": "#flow-scalar-plain-out" - }, - { - "include": "#flow-node" - } - ] - }, - "block-pair": { - "patterns": [ - { - "begin": "\\?", - "beginCaptures": { - "1": { - "name": "punctuation.definition.key-value.begin.yaml" - } - }, - "end": "(?=\\?)|^ *(:)|(:)", - "endCaptures": { - "1": { - "name": "punctuation.separator.key-value.mapping.yaml" - }, - "2": { - "name": "invalid.illegal.expected-newline.yaml" - } - }, - "name": "meta.block-mapping.yaml", - "patterns": [ - { - "include": "#block-node" - } - ] - }, - { - "begin": "(?x)\n (?=\n (?x:\n [^\\s[-?:,\\[\\]{}#&*!|>'\"%@`]]\n | [?:-] \\S\n )\n (\n [^\\s:]\n | : \\S\n | \\s+ (?![#\\s])\n )*\n \\s*\n :\\s\n )\n ", - "end": "(?x)\n (?=\n \\s* $\n | \\s+ \\#\n | \\s* : \\s\n )\n ", - "patterns": [ - { - "include": "#flow-scalar-plain-out-implicit-type" - }, - { - "begin": "(?x)\n [^\\s[-?:,\\[\\]{}#&*!|>'\"%@`]]\n | [?:-] \\S\n ", - "beginCaptures": { - "0": { - "name": "entity.name.tag.yaml" - } - }, - "contentName": "entity.name.tag.yaml", - "end": "(?x)\n (?=\n \\s* $\n | \\s+ \\#\n | \\s* : \\s\n )\n ", - "name": "string.unquoted.plain.out.yaml" - } - ] - }, - { - "match": ":(?=\\s|$)", - "name": "punctuation.separator.key-value.mapping.yaml" - } - ] - }, - "block-scalar": { - "begin": "(?:(\\|)|(>))([1-9])?([-+])?(.*\\n?)", - "beginCaptures": { - "1": { - "name": "punctuation.definition.block.scalar.literal.yaml" - }, - "2": { - "name": "punctuation.definition.block.scalar.folded.yaml" - }, - "3": { - "name": "constant.numeric.indentation-indicator.yaml" - }, - "4": { - "name": "support.other.chomping-indicator.yaml" - }, - "5": { - "patterns": [ - { - "include": "#comment" - }, - { - "match": ".+", - "name": "invalid.illegal.expected-comment-or-newline.yaml" - } - ] - } - }, - "end": "^(?=\\S)|(?!\\G)", - "patterns": [ - { - "begin": "^([ ]+)(?! )", - "end": "^(?!\\1|\\s*$)", - "name": "string.unquoted.block.yaml" - } - ] - }, - "block-sequence": { - "match": "(-)( |\\t|$)", - "name": "punctuation.definition.block.sequence.item.yaml" - }, - "comment": { - "begin": "(?:(^[ \\t]*)|[ \\t]+)(?=#\\p{Print}*$)", - "beginCaptures": { - "1": { - "name": "punctuation.whitespace.comment.leading.yaml" - } - }, - "end": "(?!\\G)", - "patterns": [ - { - "begin": "#", - "beginCaptures": { - "0": { - "name": "punctuation.definition.comment.yaml" - } - }, - "end": "\\n", - "name": "comment.line.number-sign.yaml" - } - ] - }, - "directive": { - "begin": "^%", - "beginCaptures": { - "0": { - "name": "punctuation.definition.directive.begin.yaml" - } - }, - "end": "(?=$|[ \\t]+($|#))", - "name": "meta.directive.yaml", - "patterns": [ - { - "captures": { - "1": { - "name": "keyword.other.directive.yaml.yaml" - }, - "2": { - "name": "constant.numeric.yaml-version.yaml" - } - }, - "match": "\\G(YAML)[ \\t]+(\\d+\\.\\d+)" - }, - { - "captures": { - "1": { - "name": "keyword.other.directive.tag.yaml" - }, - "2": { - "name": "storage.type.tag-handle.yaml" - }, - "3": { - "name": "support.type.tag-prefix.yaml" - } - }, - "match": "(?x)\n \\G\n (TAG)\n (?:[ \\t]+\n ((?:!(?:[0-9A-Za-z\\-]*!)?))\n (?:[ \\t]+ (\n ! (?x: %\\p{XDigit}{2} | [0-9A-Za-z\\-#;/?:@&=+$,_.!~*'()\\[\\]] )*\n | (?![,!\\[\\]{}]) (?x: %\\p{XDigit}{2} | [0-9A-Za-z\\-#;/?:@&=+$,_.!~*'()\\[\\]] )+\n )\n )?\n )?\n " - }, - { - "captures": { - "1": { - "name": "support.other.directive.reserved.yaml" - }, - "2": { - "name": "string.unquoted.directive-name.yaml" - }, - "3": { - "name": "string.unquoted.directive-parameter.yaml" - } - }, - "match": "(?x) \\G (\\w+) (?:[ \\t]+ (\\w+) (?:[ \\t]+ (\\w+))? )?" - }, - { - "match": "\\S+", - "name": "invalid.illegal.unrecognized.yaml" - } - ] - }, - "flow-alias": { - "captures": { - "1": { - "name": "keyword.control.flow.alias.yaml" - }, - "2": { - "name": "punctuation.definition.alias.yaml" - }, - "3": { - "name": "variable.other.alias.yaml" - }, - "4": { - "name": "invalid.illegal.character.anchor.yaml" - } - }, - "match": "((\\*))([^\\s\\[\\]/{/},]+)([^\\s\\]},]\\S*)?" - }, - "flow-collection": { - "patterns": [ - { - "include": "#flow-sequence" - }, - { - "include": "#flow-mapping" - } - ] - }, - "flow-mapping": { - "begin": "\\{", - "beginCaptures": { - "0": { - "name": "punctuation.definition.mapping.begin.yaml" - } - }, - "end": "\\}", - "endCaptures": { - "0": { - "name": "punctuation.definition.mapping.end.yaml" - } - }, - "name": "meta.flow-mapping.yaml", - "patterns": [ - { - "include": "#prototype" - }, - { - "match": ",", - "name": "punctuation.separator.mapping.yaml" - }, - { - "include": "#flow-pair" - } - ] - }, - "flow-node": { - "patterns": [ - { - "include": "#prototype" - }, - { - "include": "#flow-alias" - }, - { - "include": "#flow-collection" - }, - { - "include": "#flow-scalar" - } - ] - }, - "flow-pair": { - "patterns": [ - { - "begin": "\\?", - "beginCaptures": { - "0": { - "name": "punctuation.definition.key-value.begin.yaml" - } - }, - "end": "(?=[},\\]])", - "name": "meta.flow-pair.explicit.yaml", - "patterns": [ - { - "include": "#prototype" - }, - { - "include": "#flow-pair" - }, - { - "include": "#flow-node" - }, - { - "begin": ":(?=\\s|$|[\\[\\]{},])", - "beginCaptures": { - "0": { - "name": "punctuation.separator.key-value.mapping.yaml" - } - }, - "end": "(?=[},\\]])", - "patterns": [ - { - "include": "#flow-value" - } - ] - } - ] - }, - { - "begin": "(?x)\n (?=\n (?:\n [^\\s[-?:,\\[\\]{}#&*!|>'\"%@`]]\n | [?:-] [^\\s[\\[\\]{},]]\n )\n (\n [^\\s:[\\[\\]{},]]\n | : [^\\s[\\[\\]{},]]\n | \\s+ (?![#\\s])\n )*\n \\s*\n :\\s\n )\n ", - "end": "(?x)\n (?=\n \\s* $\n | \\s+ \\#\n | \\s* : \\s\n | \\s* : [\\[\\]{},]\n | [\\[\\]{},]\n )\n ", - "name": "meta.flow-pair.key.yaml", - "patterns": [ - { - "include": "#flow-scalar-plain-in-implicit-type" - }, - { - "begin": "(?x)\n [^\\s[-?:,\\[\\]{}#&*!|>'\"%@`]]\n | [?:-] [^\\s[\\[\\]{},]]\n ", - "beginCaptures": { - "0": { - "name": "entity.name.tag.yaml" - } - }, - "contentName": "entity.name.tag.yaml", - "end": "(?x)\n (?=\n \\s* $\n | \\s+ \\#\n | \\s* : \\s\n | \\s* : [\\[\\]{},]\n | [\\[\\]{},]\n )\n ", - "name": "string.unquoted.plain.in.yaml" - } - ] - }, - { - "include": "#flow-node" - }, - { - "begin": ":(?=\\s|$|[\\[\\]{},])", - "captures": { - "0": { - "name": "punctuation.separator.key-value.mapping.yaml" - } - }, - "end": "(?=[},\\]])", - "name": "meta.flow-pair.yaml", - "patterns": [ - { - "include": "#flow-value" - } - ] - } - ] - }, - "flow-scalar": { - "patterns": [ - { - "include": "#flow-scalar-double-quoted" - }, - { - "include": "#flow-scalar-single-quoted" - }, - { - "include": "#flow-scalar-plain-in" - } - ] - }, - "flow-scalar-double-quoted": { - "begin": "\"", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.yaml" - } - }, - "end": "\"", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.yaml" - } - }, - "name": "string.quoted.double.yaml", - "patterns": [ - { - "match": "\\\\([0abtnvfre \"/\\\\N_Lp]|x\\d\\d|u\\d{4}|U\\d{8})", - "name": "constant.character.escape.yaml" - }, - { - "match": "\\\\\\n", - "name": "constant.character.escape.double-quoted.newline.yaml" - } - ] - }, - "flow-scalar-plain-in": { - "patterns": [ - { - "include": "#flow-scalar-plain-in-implicit-type" - }, - { - "begin": "(?x)\n [^\\s[-?:,\\[\\]{}#&*!|>'\"%@`]]\n | [?:-] [^\\s[\\[\\]{},]]\n ", - "end": "(?x)\n (?=\n \\s* $\n | \\s+ \\#\n | \\s* : \\s\n | \\s* : [\\[\\]{},]\n | [\\[\\]{},]\n )\n ", - "name": "string.unquoted.plain.in.yaml" - } - ] - }, - "flow-scalar-plain-in-implicit-type": { - "patterns": [ - { - "captures": { - "1": { - "name": "constant.language.null.yaml" - }, - "2": { - "name": "constant.language.boolean.yaml" - }, - "3": { - "name": "constant.numeric.integer.yaml" - }, - "4": { - "name": "constant.numeric.float.yaml" - }, - "5": { - "name": "constant.other.timestamp.yaml" - }, - "6": { - "name": "constant.language.value.yaml" - }, - "7": { - "name": "constant.language.merge.yaml" - } - }, - "match": "(?x)\n (?x:\n (null|Null|NULL|~)\n | (y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)\n | (\n (?:\n [-+]? 0b [0-1_]+ # (base 2)\n | [-+]? 0 [0-7_]+ # (base 8)\n | [-+]? (?: 0|[1-9][0-9_]*) # (base 10)\n | [-+]? 0x [0-9a-fA-F_]+ # (base 16)\n | [-+]? [1-9] [0-9_]* (?: :[0-5]?[0-9])+ # (base 60)\n )\n )\n | (\n (?x:\n [-+]? (?: [0-9] [0-9_]*)? \\. [0-9.]* (?: [eE] [-+] [0-9]+)? # (base 10)\n | [-+]? [0-9] [0-9_]* (?: :[0-5]?[0-9])+ \\. [0-9_]* # (base 60)\n | [-+]? \\. (?: inf|Inf|INF) # (infinity)\n | \\. (?: nan|NaN|NAN) # (not a number)\n )\n )\n | (\n (?x:\n \\d{4} - \\d{2} - \\d{2} # (y-m-d)\n | \\d{4} # (year)\n - \\d{1,2} # (month)\n - \\d{1,2} # (day)\n (?: [Tt] | [ \\t]+) \\d{1,2} # (hour)\n : \\d{2} # (minute)\n : \\d{2} # (second)\n (?: \\.\\d*)? # (fraction)\n (?:\n (?:[ \\t]*) Z\n | [-+] \\d{1,2} (?: :\\d{1,2})?\n )? # (time zone)\n )\n )\n | (=)\n | (<<)\n )\n (?:\n (?=\n \\s* $\n | \\s+ \\#\n | \\s* : \\s\n | \\s* : [\\[\\]{},]\n | [\\[\\]{},]\n )\n )\n " - } - ] - }, - "flow-scalar-plain-out": { - "patterns": [ - { - "include": "#flow-scalar-plain-out-implicit-type" - }, - { - "begin": "(?x)\n [^\\s[-?:,\\[\\]{}#&*!|>'\"%@`]]\n | [?:-] \\S\n ", - "end": "(?x)\n (?=\n \\s* $\n | \\s+ \\#\n | \\s* : \\s\n )\n ", - "name": "string.unquoted.plain.out.yaml" - } - ] - }, - "flow-scalar-plain-out-implicit-type": { - "patterns": [ - { - "captures": { - "1": { - "name": "constant.language.null.yaml" - }, - "2": { - "name": "constant.language.boolean.yaml" - }, - "3": { - "name": "constant.numeric.integer.yaml" - }, - "4": { - "name": "constant.numeric.float.yaml" - }, - "5": { - "name": "constant.other.timestamp.yaml" - }, - "6": { - "name": "constant.language.value.yaml" - }, - "7": { - "name": "constant.language.merge.yaml" - } - }, - "match": "(?x)\n (?x:\n (null|Null|NULL|~)\n | (y|Y|yes|Yes|YES|n|N|no|No|NO|true|True|TRUE|false|False|FALSE|on|On|ON|off|Off|OFF)\n | (\n (?:\n [-+]? 0b [0-1_]+ # (base 2)\n | [-+]? 0 [0-7_]+ # (base 8)\n | [-+]? (?: 0|[1-9][0-9_]*) # (base 10)\n | [-+]? 0x [0-9a-fA-F_]+ # (base 16)\n | [-+]? [1-9] [0-9_]* (?: :[0-5]?[0-9])+ # (base 60)\n )\n )\n | (\n (?x:\n [-+]? (?: [0-9] [0-9_]*)? \\. [0-9.]* (?: [eE] [-+] [0-9]+)? # (base 10)\n | [-+]? [0-9] [0-9_]* (?: :[0-5]?[0-9])+ \\. [0-9_]* # (base 60)\n | [-+]? \\. (?: inf|Inf|INF) # (infinity)\n | \\. (?: nan|NaN|NAN) # (not a number)\n )\n )\n | (\n (?x:\n \\d{4} - \\d{2} - \\d{2} # (y-m-d)\n | \\d{4} # (year)\n - \\d{1,2} # (month)\n - \\d{1,2} # (day)\n (?: [Tt] | [ \\t]+) \\d{1,2} # (hour)\n : \\d{2} # (minute)\n : \\d{2} # (second)\n (?: \\.\\d*)? # (fraction)\n (?:\n (?:[ \\t]*) Z\n | [-+] \\d{1,2} (?: :\\d{1,2})?\n )? # (time zone)\n )\n )\n | (=)\n | (<<)\n )\n (?x:\n (?=\n \\s* $\n | \\s+ \\#\n | \\s* : \\s\n )\n )\n " - } - ] - }, - "flow-scalar-single-quoted": { - "begin": "'", - "beginCaptures": { - "0": { - "name": "punctuation.definition.string.begin.yaml" - } - }, - "end": "'(?!')", - "endCaptures": { - "0": { - "name": "punctuation.definition.string.end.yaml" - } - }, - "name": "string.quoted.single.yaml", - "patterns": [ - { - "match": "''", - "name": "constant.character.escape.single-quoted.yaml" - } - ] - }, - "flow-sequence": { - "begin": "\\[", - "beginCaptures": { - "0": { - "name": "punctuation.definition.sequence.begin.yaml" - } - }, - "end": "\\]", - "endCaptures": { - "0": { - "name": "punctuation.definition.sequence.end.yaml" - } - }, - "name": "meta.flow-sequence.yaml", - "patterns": [ - { - "include": "#prototype" - }, - { - "match": ",", - "name": "punctuation.separator.sequence.yaml" - }, - { - "include": "#flow-pair" - }, - { - "include": "#flow-node" - } - ] - }, - "flow-value": { - "patterns": [ - { - "begin": "\\G(?![},\\]])", - "end": "(?=[},\\]])", - "name": "meta.flow-pair.value.yaml", - "patterns": [ - { - "include": "#flow-node" - } - ] - } - ] - }, - "node": { - "patterns": [ - { - "include": "#block-node" - } - ] - }, - "property": { - "begin": "(?=!|&)", - "end": "(?!\\G)", - "name": "meta.property.yaml", - "patterns": [ - { - "captures": { - "1": { - "name": "keyword.control.property.anchor.yaml" - }, - "2": { - "name": "punctuation.definition.anchor.yaml" - }, - "3": { - "name": "entity.name.type.anchor.yaml" - }, - "4": { - "name": "invalid.illegal.character.anchor.yaml" - } - }, - "match": "\\G((&))([^\\s\\[\\]/{/},]+)(\\S+)?" - }, - { - "match": "(?x)\n \\G\n (?:\n ! < (?: %\\p{XDigit}{2} | [0-9A-Za-z\\-#;/?:@&=+$,_.!~*'()\\[\\]] )+ >\n | (?:!(?:[0-9A-Za-z\\-]*!)?) (?: %\\p{XDigit}{2} | [0-9A-Za-z\\-#;/?:@&=+$_.~*'()] )+\n | !\n )\n (?=\\ |\\t|$)\n ", - "name": "storage.type.tag-handle.yaml" - }, - { - "match": "\\S+", - "name": "invalid.illegal.tag-handle.yaml" - } - ] - }, - "prototype": { - "patterns": [ - { - "include": "#comment" - }, - { - "include": "#property" - } - ] - } - }, - "scopeName": "source.yaml", - "uuid": "686AD6AE-33F3-4493-9512-9E9FC1D5417F", - "version": "https://github.com/textmate/yaml.tmbundle/commit/9a4135db812815467828e467e1a57189e1ccdac9" -} \ No newline at end of file diff --git a/lib/shiki-languages/dist/index.d.ts b/lib/shiki-languages/dist/index.d.ts deleted file mode 100644 index bc07189b..00000000 --- a/lib/shiki-languages/dist/index.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export * from './lang'; -export * from './types'; diff --git a/lib/shiki-languages/dist/index.js b/lib/shiki-languages/dist/index.js deleted file mode 100644 index 85eb3a02..00000000 --- a/lib/shiki-languages/dist/index.js +++ /dev/null @@ -1,6 +0,0 @@ -"use strict"; -function __export(m) { - for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; -} -Object.defineProperty(exports, "__esModule", { value: true }); -__export(require("./lang")); diff --git a/lib/shiki-languages/dist/lang.d.ts b/lib/shiki-languages/dist/lang.d.ts deleted file mode 100644 index 9da79cd3..00000000 --- a/lib/shiki-languages/dist/lang.d.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { TCommonLang, TCommonLangAlias, TOtherLang, TLang } from './types'; -import { IRawGrammar } from 'vscode-textmate'; -export declare const commonLangIds: TCommonLang[]; -export declare const commonLangAliases: TCommonLangAlias[]; -export declare const otherLangIds: TOtherLang[]; -export interface ILanguageRegistration { - id: string; - scopeName: string; - path: string; - aliases: string[]; - grammar?: IRawGrammar; -} -export declare function getLangRegistrations(langs: TLang[]): ILanguageRegistration[]; -export declare const languages: ILanguageRegistration[]; diff --git a/lib/shiki-languages/dist/lang.js b/lib/shiki-languages/dist/lang.js deleted file mode 100644 index 39765f0e..00000000 --- a/lib/shiki-languages/dist/lang.js +++ /dev/null @@ -1,480 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -var path = require("path"); -exports.commonLangIds = [ - 'clojure', - 'c', - 'cpp', - 'csharp', - 'css', - 'go', - 'html', - 'jade', - 'java', - 'jsx', - 'javascript', - 'json', - 'jsonc', - 'less', - 'lua', - 'makefile', - 'markdown', - 'objective-c', - 'perl6', - 'php', - 'python', - 'r', - 'ruby', - 'rust', - 'scss', - 'shellscript', - 'sql', - 'swift', - 'typescript', - 'tsx', - 'xml', - 'yaml', - /** - * Extra grammars - */ - 'haml', - 'graphql', - 'sass', - 'stylus', - 'postcss', - 'vue', - 'vue-html', - 'latex', - 'toml', - 'clarity', - 'kotlin', - 'nginx' -]; -exports.commonLangAliases = [ - 'clj', - 'c++', - 'htm', - 'xhtml', - 'js', - 'objc', - 'py', - 'rb', - 'shell', - 'bash', - 'sh', - 'zsh', - 'ts', - 'yml', - 'md', - /** - * Extra grammars - */ - 'styl', - 'tex', - 'clar' -]; -exports.otherLangIds = [ - 'bat', - 'coffeescript', - 'diff', - 'dockerfile', - 'fsharp', - 'git-commit', - 'git-rebase', - 'groovy', - 'handlebars', - 'ini', - 'properties', - 'perl', - 'powershell', - 'razor', - 'shaderlab', - 'vb', - 'cmd', - 'xsl' -]; -function getLangRegistrations(langs) { - var langRegistrationMap = {}; - exports.languages.forEach(function (l) { - langRegistrationMap[l.id] = l; - l.aliases.forEach(function (a) { - langRegistrationMap[a] = l; - }); - }); - return langs.map(function (l) { return langRegistrationMap[l]; }); -} -exports.getLangRegistrations = getLangRegistrations; -exports.languages = [ - { - id: 'bat', - scopeName: 'source.dosbatch', - path: '../data/grammars/Batch File.tmLanguage', - aliases: ['batch'] - }, - { - id: 'clojure', - scopeName: 'source.clojure', - path: '../data/grammars/Clojure.tmLanguage', - aliases: ['clj'] - }, - { - id: 'coffeescript', - scopeName: 'source.coffee', - path: '../data/grammars/coffeescript.json', - aliases: ['coffee'] - }, - { - id: 'c', - scopeName: 'source.c', - path: '../data/grammars/c.json', - aliases: [] - }, - { - id: 'cpp', - scopeName: 'source.cpp', - path: '../data/grammars/c++.json', - aliases: ['c++'] - }, - { - id: 'csharp', - scopeName: 'source.cs', - path: '../data/grammars/csharp.tmLanguage.json', - aliases: [] - }, - { - id: 'css', - scopeName: 'source.css', - path: '../data/grammars/css.plist', - aliases: [] - }, - { - id: 'diff', - scopeName: 'source.diff', - path: '../data/grammars/diff.tmLanguage', - aliases: [] - }, - { - id: 'dockerfile', - scopeName: 'source.dockerfile', - path: '../data/grammars/Dockerfile.tmLanguage', - aliases: ['docker'] - }, - { - id: 'fsharp', - scopeName: 'source.fsharp', - path: '../data/grammars/fsharp.json', - aliases: ['f#'] - }, - { - id: 'git-commit', - scopeName: 'text.git-commit', - path: '../data/grammars/git-commit.tmLanguage', - aliases: [] - }, - { - id: 'git-rebase', - scopeName: 'text.git-rebase', - path: '../data/grammars/git-rebase.tmLanguage', - aliases: [] - }, - { - id: 'go', - scopeName: 'source.go', - path: '../data/grammars/go.json', - aliases: [] - }, - { - id: 'groovy', - scopeName: 'source.groovy', - path: '../data/grammars/Groovy.tmLanguage', - aliases: [] - }, - { - id: 'handlebars', - scopeName: 'text.html.handlebars', - path: '../data/grammars/Handlebars.json', - aliases: ['hbs'] - }, - { - id: 'html', - scopeName: 'text.html.basic', - path: '../data/grammars/html.json', - aliases: ['htm', 'xhtml'] - }, - { - id: 'ini', - scopeName: 'source.properties', - path: '../data/grammars/properties.plist', - aliases: [] - }, - { - id: 'properties', - scopeName: 'source.properties', - path: '../data/grammars/properties.plist', - aliases: [] - }, - { - id: 'jade', - scopeName: 'text.jade', - path: '../data/grammars/Jade.json', - aliases: [] - }, - { - id: 'java', - scopeName: 'source.java', - path: '../data/grammars/java.json', - aliases: [] - }, - { - id: 'jsx', - scopeName: 'source.js', - path: '../data/grammars/JavaScript.tmLanguage.json', - aliases: [] - }, - { - id: 'javascript', - scopeName: 'source.js', - path: '../data/grammars/JavaScript.tmLanguage.json', - aliases: ['js'] - }, - { - id: 'json', - scopeName: 'source.json', - path: '../data/grammars/JSON.tmLanguage', - aliases: [] - }, - { - id: 'jsonc', - scopeName: 'source.json.comments', - path: '../data/grammars/JSONC.tmLanguage.json', - aliases: [] - }, - { - id: 'less', - scopeName: 'source.css.less', - path: '../data/grammars/less.tmLanguage.json', - aliases: [] - }, - { - id: 'lua', - scopeName: 'source.lua', - path: '../data/grammars/lua.json', - aliases: [] - }, - { - id: 'makefile', - scopeName: 'source.makefile', - path: '../data/grammars/Makefile.json', - aliases: [] - }, - { - id: 'markdown', - scopeName: 'text.html.markdown', - path: '../data/grammars/markdown.tmLanguage', - aliases: ['md'] - }, - { - id: 'objective-c', - scopeName: 'source.objc', - path: '../data/grammars/Objective-C.tmLanguage', - aliases: ['objc'] - }, - { - id: 'perl', - scopeName: 'source.perl', - path: '../data/grammars/Perl.plist', - aliases: [] - }, - { - id: 'perl6', - scopeName: 'source.perl.6', - path: '../data/grammars/Perl 6.tmLanguage', - aliases: [] - }, - { - id: 'php', - scopeName: 'text.html.php', - path: '../data/grammars/php.json', - aliases: [] - }, - { - id: 'powershell', - scopeName: 'source.powershell', - path: '../data/grammars/PowershellSyntax.tmLanguage', - aliases: ['ps', 'ps1'] - }, - { - id: 'python', - scopeName: 'source.python', - path: '../data/grammars/MagicPython.tmLanguage.json', - aliases: ['py'] - }, - { - id: 'r', - scopeName: 'source.r', - path: '../data/grammars/R.plist', - aliases: [] - }, - { - id: 'razor', - scopeName: 'text.html.cshtml', - path: '../data/grammars/cshtml.json', - aliases: [] - }, - { - id: 'ruby', - scopeName: 'source.ruby', - path: '../data/grammars/Ruby.plist', - aliases: ['rb'] - }, - { - id: 'rust', - scopeName: 'source.rust', - path: '../data/grammars/rust.json', - aliases: [] - }, - { - id: 'scss', - scopeName: 'source.css.scss', - path: '../data/grammars/scss.json', - aliases: [] - }, - { - id: 'shaderlab', - scopeName: 'source.shaderlab', - path: '../data/grammars/shaderlab.json', - aliases: ['shader'] - }, - { - id: 'shellscript', - scopeName: 'source.shell', - path: '../data/grammars/Shell-Unix-Bash.tmLanguage.json', - aliases: ['shell', 'bash', 'sh', 'zsh'] - }, - { - id: 'sql', - scopeName: 'source.sql', - path: '../data/grammars/SQL.plist', - aliases: [] - }, - { - id: 'swift', - scopeName: 'source.swift', - path: '../data/grammars/swift.json', - aliases: [] - }, - { - id: 'typescript', - scopeName: 'source.ts', - path: '../data/grammars/TypeScript.tmLanguage.json', - aliases: ['ts'] - }, - { - id: 'tsx', - scopeName: 'source.tsx', - path: '../data/grammars/TypeScriptReact.tmLanguage.json', - aliases: [] - }, - { - id: 'vb', - scopeName: 'source.asp.vb.net', - path: '../data/grammars/ASPVBnet.plist', - aliases: ['cmd'] - }, - { - id: 'xml', - scopeName: 'text.xml', - path: '../data/grammars/xml.json', - aliases: [] - }, - { - id: 'xsl', - scopeName: 'text.xml.xsl', - path: '../data/grammars/xsl.json', - aliases: [] - }, - { - id: 'yaml', - scopeName: 'source.yaml', - path: '../data/grammars/yaml.json', - aliases: ['yml'] - }, - /** - * Extra grammars - */ - { - id: 'haml', - scopeName: 'text.haml', - path: '../data/extraGrammars/haml.json', - aliases: [] - }, - { - id: 'graphql', - scopeName: 'source.graphql', - path: '../data/extraGrammars/graphql.json', - aliases: [] - }, - { - id: 'sass', - scopeName: 'source.sass', - path: '../data/extraGrammars/sass.tmLanguage', - aliases: [] - }, - { - id: 'stylus', - scopeName: 'source.stylus', - path: '../data/extraGrammars/stylus.json', - aliases: ['styl'] - }, - { - id: 'postcss', - scopeName: 'source.css.postcss', - path: '../data/extraGrammars/postcss.json', - aliases: [] - }, - { - id: 'vue', - scopeName: 'source.vue', - path: '../data/extraGrammars/vue.json', - aliases: [] - }, - { - id: 'vue-html', - scopeName: 'text.html.vue-html', - path: '../data/extraGrammars/vue-html.json', - aliases: [] - }, - { - id: 'latex', - scopeName: 'text.tex.latex', - path: '../data/extraGrammars/latex.plist', - aliases: ['tex'] - }, - { - id: 'toml', - scopeName: 'source.toml', - path: '../data/extraGrammars/TOML.tmLanguage', - aliases: [] - }, - { - id: 'clarity', - scopeName: 'source.clarity', - path: '../data/extraGrammars/clarity.tmLanguage.json', - aliases: ['clar'] - }, - { - id: 'kotlin', - scopeName: 'source.kotlin', - path: '../data/extraGrammars/kotlin.tmLanguage', - aliases: [] - }, - { - id: 'nginx', - scopeName: 'source.nginx', - path: '../data/extraGrammars/nginx.tmLanguage', - aliases: ['conf'] - } -]; -exports.languages.forEach(function (l) { - l.path = path.resolve(__dirname, l.path); -}); diff --git a/lib/shiki-languages/dist/types.d.ts b/lib/shiki-languages/dist/types.d.ts deleted file mode 100644 index 17789bfc..00000000 --- a/lib/shiki-languages/dist/types.d.ts +++ /dev/null @@ -1,12 +0,0 @@ -export declare type TCommonLang = 'clojure' | 'c' | 'cpp' | 'csharp' | 'css' | 'go' | 'html' | 'jade' | 'java' | 'jsx' | 'javascript' | 'json' | 'jsonc' | 'less' | 'lua' | 'makefile' | 'markdown' | 'objective-c' | 'perl6' | 'php' | 'python' | 'r' | 'ruby' | 'rust' | 'scss' | 'shellscript' | 'sql' | 'swift' | 'typescript' | 'tsx' | 'xml' | 'yaml' -/** - * Extra grammars - */ - | 'haml' | 'graphql' | 'postcss' | 'sass' | 'stylus' | 'vue' | 'vue-html' | 'latex' | 'toml' | 'clarity' | 'kotlin' | 'nginx'; -export declare type TCommonLangAlias = 'clj' | 'c++' | 'htm' | 'xhtml' | 'js' | 'objc' | 'py' | 'rb' | 'shell' | 'bash' | 'sh' | 'zsh' | 'ts' | 'yml' | 'md' -/** - * Extra grammars - */ - | 'styl' | 'tex' | 'clar' | 'conf'; -export declare type TOtherLang = 'bat' | 'coffeescript' | 'diff' | 'dockerfile' | 'fsharp' | 'git-commit' | 'git-rebase' | 'groovy' | 'handlebars' | 'ini' | 'properties' | 'perl' | 'powershell' | 'razor' | 'shaderlab' | 'vb' | 'cmd' | 'xsl'; -export declare type TLang = TCommonLang | TCommonLangAlias | TOtherLang; diff --git a/lib/shiki-languages/dist/types.js b/lib/shiki-languages/dist/types.js deleted file mode 100644 index c8ad2e54..00000000 --- a/lib/shiki-languages/dist/types.js +++ /dev/null @@ -1,2 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); diff --git a/lib/shiki-languages/package.json b/lib/shiki-languages/package.json deleted file mode 100644 index 86b22c02..00000000 --- a/lib/shiki-languages/package.json +++ /dev/null @@ -1,22 +0,0 @@ -{ - "name": "shiki-languages-clarity", - "version": "0.1.7", - "description": "Languages for shiki", - "keywords": [ - "shiki", - "languages", - "grammar", - "TextMate" - ], - "author": "Pine Wu ", - "homepage": "https://github.com/octref/shiki/tree/master/packages/grammars", - "license": "MIT", - "main": "dist/index.js", - "repository": { - "type": "git", - "url": "git+https://github.com/octref/shiki.git" - }, - "dependencies": { - "vscode-textmate": "https://github.com/octref/vscode-textmate" - } -} diff --git a/next.config.js b/next.config.js index 728194e5..47d7e27f 100755 --- a/next.config.js +++ b/next.config.js @@ -1,14 +1,12 @@ -const withMdxEnhanced = require('next-mdx-enhanced'); const withBundleAnalyzer = require('@next/bundle-analyzer')({ enabled: process.env.ANALYZE === 'true', }); -const remark = require('remark'); -const strip = require('strip-markdown'); + const path = require('path'); const remarkPlugins = [ [ - require('@hashicorp/remark-plugins'), + require('@hashicorp/remark-plugins').includeMarkdown, { resolveFrom: path.join(__dirname, 'src/common/_includes') }, ], require('remark-squeeze-paragraphs'), @@ -21,37 +19,13 @@ const remarkPlugins = [ require('remark-slug'), ]; -const getHeadings = mdxContent => { - const regex = /\n(#+)(.*)/gm; - const found = mdxContent.match(regex); - const getLevel = string => string.split('#'); - const headings = - found && found.length - ? found.map(f => { - const md = f.split('# ')[1]; - let content = md; - remark() - .use(strip) - .process(md, (err, file) => { - if (err) throw err; - content = file.contents.toString().trim(); - }); - const level = getLevel(f).length; - return { content, level }; - }) - : []; - return { - headings, - }; -}; - module.exports = withBundleAnalyzer({ experimental: { modern: true, polyfillsOptimization: true, jsconfigPaths: true, }, - pageExtensions: ['ts', 'tsx', 'md', 'mdx'], + pageExtensions: ['js', 'ts', 'tsx', 'md', 'mdx'], webpack: (config, options) => { config.module.rules.push({ test: /.mdx?$/, // load both .md and .mdx files diff --git a/package.json b/package.json index e6eadd62..8d9d89ce 100755 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "@types/reach__tooltip": "^0.2.0", "algoliasearch": "^4.3.0", "babel-plugin-macros": "^2.8.0", + "babel-plugin-prismjs": "^2.0.1", "docsearch.js": "^2.6.3", "eslint": "^7.4.0", "fathom-client": "^3.0.0", @@ -63,7 +64,6 @@ "remark-slug": "6.0.0", "remark-squeeze-paragraphs": "^4.0.0", "remark-unwrap-images": "2.0.0", - "shiki": "^0.1.7", "store": "^2.0.12", "strip-markdown": "^3.1.2", "swr": "^0.2.3", @@ -87,8 +87,8 @@ }, "private": true, "scripts": { - "build": "yarn clean:build-files && next telemetry disable && next build && next export -o build", - "build:analyze": "yarn clean:build-files && next telemetry disable && ANALYZE=true next build", + "build": "yarn clean:build-files && next telemetry disable && NODE_ENV=production next build && next export -o build", + "build:analyze": "yarn clean:build-files && next telemetry disable && NODE_ENV=production ANALYZE=true next build", "start": "next telemetry disable && NODE_ENV=production next start", "clean:build-files": "rimraf .next", "dev": "yarn clean:build-files && next dev", @@ -102,8 +102,7 @@ "typecheck:watch": "npm run typecheck -- --watch" }, "resolutions": { - "preact": "^10.4.4", - "shiki-languages": "file:./lib/shiki-languages" + "preact": "^10.4.4" }, "prettier": "@blockstack/prettier-config" } diff --git a/src/common/_data/clarityRef.json b/src/common/_data/clarityRef.json index 3e416edb..9db40c4e 100644 --- a/src/common/_data/clarityRef.json +++ b/src/common/_data/clarityRef.json @@ -1 +1,698 @@ -{"functions":[{"name":"+ (add)","input_type":"int, ... | uint, ...","output_type":"int | uint","signature":"(+ i1 i2...)","description":"Adds a variable number of integer inputs and returns the result. In the event of an _overflow_, throws a runtime error.","example":"(+ 1 2 3) ;; Returns 6"},{"name":"- (subtract)","input_type":"int, ... | uint, ...","output_type":"int | uint","signature":"(- i1 i2...)","description":"Subtracts a variable number of integer inputs and returns the result. In the event of an _underflow_, throws a runtime error.","example":"(- 2 1 1) ;; Returns 0\n(- 0 3) ;; Returns -3\n"},{"name":"* (multiply)","input_type":"int, ... | uint, ...","output_type":"int | uint","signature":"(* i1 i2...)","description":"Multiplies a variable number of integer inputs and returns the result. In the event of an _overflow_, throws a runtime error.","example":"(* 2 3) ;; Returns 6\n(* 5 2) ;; Returns 10\n(* 2 2 2) ;; Returns 8\n"},{"name":"/ (divide)","input_type":"int, ... | uint, ...","output_type":"int | uint","signature":"(/ i1 i2...)","description":"Integer divides a variable number of integer inputs and returns the result. In the event of division by zero, throws a runtime error.","example":"(/ 2 3) ;; Returns 0\n(/ 5 2) ;; Returns 2\n(/ 4 2 2) ;; Returns 1\n"},{"name":">= (greater than or equal)","input_type":"int, int | uint, uint","output_type":"bool","signature":"(>= i1 i2)","description":"Compares two integers, returning `true` if `i1` is greater than or equal to `i2` and `false` otherwise.","example":"(>= 1 1) ;; Returns true\n(>= 5 2) ;; Returns true\n"},{"name":"<= (less than or equal)","input_type":"int, int | uint, uint","output_type":"bool","signature":"(<= i1 i2)","description":"Compares two integers, returning true if `i1` is less than or equal to `i2` and `false` otherwise.","example":"(<= 1 1) ;; Returns true\n(<= 5 2) ;; Returns false\n"},{"name":"< (less than)","input_type":"int, int | uint, uint","output_type":"bool","signature":"(< i1 i2)","description":"Compares two integers, returning `true` if `i1` is less than `i2` and `false` otherwise.","example":"(< 1 2) ;; Returns true\n(< 5 2) ;; Returns false\n"},{"name":"> (greater than)","input_type":"int, int | uint, uint","output_type":"bool","signature":"(> i1 i2)","description":"Compares two integers, returning `true` if `i1` is greater than `i2` and false otherwise.","example":"(> 1 2) ;; Returns false\n(> 5 2) ;; Returns true\n"},{"name":"to-int","input_type":"uint","output_type":"int","signature":"(to-int u)","description":"Tries to convert the `uint` argument to an `int`. Will cause a runtime error and abort if the supplied argument is >= `pow(2, 127)`","example":"(to-int u238) ;; Returns 238"},{"name":"to-uint","input_type":"int","output_type":"uint","signature":"(to-uint i)","description":"Tries to convert the `int` argument to a `uint`. Will cause a runtime error and abort if the supplied argument is negative.","example":"(to-uint 238) ;; Returns u238"},{"name":"mod","input_type":"int, int | uint, uint","output_type":"int | uint","signature":"(mod i1 i2)","description":"Returns the integer remainder from integer dividing `i1` by `i2`. In the event of a division by zero, throws a runtime error.","example":"(mod 2 3) ;; Returns 2\n(mod 5 2) ;; Returns 1\n(mod 7 1) ;; Returns 0\n"},{"name":"pow","input_type":"int, int | uint, uint","output_type":"int | uint","signature":"(pow i1 i2)","description":"Returns the result of raising `i1` to the power of `i2`. In the event of an _overflow_, throws a runtime error.","example":"(pow 2 3) ;; Returns 8\n(pow 2 2) ;; Returns 4\n(pow 7 1) ;; Returns 7\n"},{"name":"xor","input_type":"int, int | uint, uint","output_type":"int | uint","signature":"(xor i1 i2)","description":"Returns the result of bitwise exclusive or'ing `i1` with `i2`.","example":"(xor 1 2) ;; Returns 3\n(xor 120 280) ;; Returns 352\n"},{"name":"and","input_type":"bool, ...","output_type":"bool","signature":"(and b1 b2 ...)","description":"Returns `true` if all boolean inputs are `true`. Importantly, the supplied arguments are evaluated in-order and lazily. Lazy evaluation means that if one of the arguments returns `false`, the function short-circuits, and no subsequent arguments are evaluated.","example":"(and true false) ;; Returns false\n(and (is-eq (+ 1 2) 1) (is-eq 4 4)) ;; Returns false\n(and (is-eq (+ 1 2) 3) (is-eq 4 4)) ;; Returns true\n"},{"name":"or","input_type":"bool, ...","output_type":"bool","signature":"(or b1 b2 ...)","description":"Returns `true` if any boolean inputs are `true`. Importantly, the supplied arguments are evaluated in-order and lazily. Lazy evaluation means that if one of the arguments returns `false`, the function short-circuits, and no subsequent arguments are evaluated.","example":"(or true false) ;; Returns true\n(or (is-eq (+ 1 2) 1) (is-eq 4 4)) ;; Returns true\n(or (is-eq (+ 1 2) 1) (is-eq 3 4)) ;; Returns false\n(or (is-eq (+ 1 2) 3) (is-eq 4 4)) ;; Returns true\n"},{"name":"not","input_type":"bool","output_type":"bool","signature":"(not b1)","description":"Returns the inverse of the boolean input.","example":"(not true) ;; Returns false\n(not (is-eq 1 2)) ;; Returns true\n"},{"name":"is-eq","input_type":"A, A, ...","output_type":"bool","signature":"(is-eq v1 v2...)","description":"Compares the inputted values, returning `true` if they are all equal. Note that \n_unlike_ the `(and ...)` function, `(is-eq ...)` will _not_ short-circuit. All values supplied to\nis-eq _must_ be the same type.","example":"(is-eq 1 1) ;; Returns true\n(is-eq true false) ;; Returns false\n(is-eq \"abc\" 234 234) ;; Throws type error\n"},{"name":"if","input_type":"bool, A, A","output_type":"A","signature":"(if bool1 expr1 expr2)","description":"The `if` function admits a boolean argument and two expressions\nwhich must return the same type. In the case that the boolean input is `true`, the\n`if` function evaluates and returns `expr1`. If the boolean input is `false`, the\n`if` function evaluates and returns `expr2`.","example":"(if true 1 2) ;; Returns 1\n(if (> 1 2) 1 2) ;; Returns 2"},{"name":"let","input_type":"((name2 AnyType) (name2 AnyType) ...), AnyType, ... A","output_type":"A","signature":"(let ((name1 expr1) (name2 expr2) ...) expr-body1 expr-body2 ... expr-body-last)","description":"The `let` function accepts a list of `variable name` and `expression` pairs,\nevaluating each expression and _binding_ it to the corresponding variable name. The _context_\ncreated by this set of bindings is used for evaluating its body expressions. The let expression returns the value of the last such body expression.","example":"(let ((a 2) (b (+ 5 6 7))) (print a) (print b) (+ a b)) ;; Returns 20"},{"name":"map","input_type":"Function(A) -> B, (list A)","output_type":"(list B)","signature":"(map func list)","description":"The `map` function applies the input function `func` to each element of the\ninput list, and outputs a list containing the _outputs_ from those function applications.","example":"(map not (list true false true false)) ;; Returns (false true false true)"},{"name":"fold","input_type":"Function(A, B) -> B, (list A), B","output_type":"B","signature":"(fold func list initial-value)","description":"The `fold` special form applies the input function `func` to each element of the\ninput list _and_ the output of the previous application of the `fold` function. When invoked on\nthe first list element, it uses the `initial-value` as the second input. `fold` returns the last\nvalue returned by the successive applications. Note that the first argument is not evaluated thus\nhas to be a literal function name.","example":"(fold * (list 2 2 2) 1) ;; Returns 8\n(fold * (list 2 2 2) 0) ;; Returns 0\n;; calculates (- 11 (- 7 (- 3 2)))\n(fold - (list 3 7 11) 2) ;; Returns 5 \n(fold concat \"cdef\" \"ab\") ;; Returns 0x666564636162\n ;; hex form of \"fedcab\" \n(fold concat (list \"cd\" \"ef\") \"ab\") ;; Returns 0x656663646162\n ;; hex form of \"efcdab\""},{"name":"append","input_type":"list A, A","output_type":"list","signature":"(append (list 1 2 3 4) 5)","description":"The `append` function takes a list and another value with the same entry type,\nor a buffer and another buffer of length 1 and outputs a buffer or a list of the same type with max_len += 1.","example":"(append (list 1 2 3 4) 5) ;; Returns (1 2 3 4 5)"},{"name":"concat","input_type":"(buff, buff)|(list, list)","output_type":"buff|list","signature":"(concat buff-a buff-b)","description":"The `concat` function takes two buffers or two lists with the same entry type,\nand returns a concatenated buffer or list of the same entry type, with max_len = max_len_a + max_len_b.","example":"(concat \"hello \" \"world\") ;; Returns 0x68656c6c6f20776f726c64\n ;; hex form of \"hello world\""},{"name":"as-max-len?","input_type":"buff|list, uint","output_type":"(optional buff|list)","signature":"(as-max-len? buffer u10)","description":"The `as-max-len?` function takes a length N (must be a literal) and a buffer or list argument, which must be typed as a list\nor buffer of length M and outputs that same list or buffer, but typed with max length N.\n\nThis function returns an optional type with the resulting iterable. If the input iterable is less than\nor equal to the supplied max-len, it returns `(some )`, otherwise it returns `none`.","example":"(as-max-len? (list 2 2 2) u3) ;; Returns (some (2 2 2))\n(as-max-len? (list 1 2 3) u2) ;; Returns none"},{"name":"len","input_type":"buff|list","output_type":"uint","signature":"(len buffer)","description":"The `len` function returns the length of a given buffer or list.","example":"(len \"blockstack\") ;; Returns u10\n(len (list 1 2 3 4 5)) ;; Returns u5\n"},{"name":"list","input_type":"A, ...","output_type":"(list A)","signature":"(list expr1 expr2 expr3 ...)","description":"The `list` function constructs a list composed of the inputted values. Each\nsupplied value must be of the same type.","example":"(list (+ 1 2) 4 5) ;; Returns (3 4 5)"},{"name":"var-get","input_type":"VarName","output_type":"A","signature":"(var-get var-name)","description":"The `var-get` function looks up and returns an entry from a contract's data map.\nThe value is looked up using `var-name`.","example":"(define-data-var cursor int 6)\n(var-get cursor) ;; Returns 6"},{"name":"var-set","input_type":"VarName, AnyType","output_type":"bool","signature":"(var-set var-name expr1)","description":"The `var-set` function sets the value associated with the input variable to the\ninputted value.","example":"\n(define-data-var cursor int 6)\n(var-get cursor) ;; Returns 6\n(var-set cursor (+ (var-get cursor) 1)) ;; Returns true\n(var-get cursor) ;; Returns 7"},{"name":"map-get?","input_type":"MapName, tuple","output_type":"(optional (tuple))","signature":"(map-get? map-name key-tuple)","description":"The `map-get?` function looks up and returns an entry from a contract's data map.\nThe value is looked up using `key-tuple`.\nIf there is no value associated with that key in the data map, the function returns a `none` option. Otherwise,\nit returns `(some value)`.","example":"(define-map names-map ((name (buff 10))) ((id int)))\n(map-set names-map { name: \"blockstack\" } { id: 1337 })\n(map-get? names-map (tuple (name \"blockstack\"))) ;; Returns (some (tuple (id 1337)))\n(map-get? names-map ((name \"blockstack\"))) ;; Same command, using a shorthand for constructing the tuple\n"},{"name":"map-set","input_type":"MapName, tuple_A, tuple_B","output_type":"bool","signature":"(map-set map-name key-tuple value-tuple)","description":"The `map-set` function sets the value associated with the input key to the\ninputted value. This function performs a _blind_ update; whether or not a value is already associated\nwith the key, the function overwrites that existing association.\n\nNote: the `value-tuple` requires 1 additional byte for storage in the materialized blockchain state,\nand therefore the maximum size of a value that may be inserted into a map is MAX_CLARITY_VALUE - 1.","example":"(define-map names-map ((name (buff 10))) ((id int)))\n(map-set names-map { name: \"blockstack\" } { id: 1337 }) ;; Returns true\n(map-set names-map ((name \"blockstack\")) ((id 1337))) ;; Same command, using a shorthand for constructing the tuple\n"},{"name":"map-insert","input_type":"MapName, tuple_A, tuple_B","output_type":"bool","signature":"(map-insert map-name key-tuple value-tuple)","description":"The `map-insert` function sets the value associated with the input key to the\ninputted value if and only if there is not already a value associated with the key in the map.\nIf an insert occurs, the function returns `true`. If a value already existed for\nthis key in the data map, the function returns `false`.\n\nNote: the `value-tuple` requires 1 additional byte for storage in the materialized blockchain state,\nand therefore the maximum size of a value that may be inserted into a map is MAX_CLARITY_VALUE - 1.","example":"(define-map names-map ((name (buff 10))) ((id int)))\n(map-insert names-map { name: \"blockstack\" } { id: 1337 }) ;; Returns true\n(map-insert names-map { name: \"blockstack\" } { id: 1337 }) ;; Returns false\n(map-insert names-map ((name \"blockstack\")) ((id 1337))) ;; Same command, using a shorthand for constructing the tuple\n"},{"name":"map-delete","input_type":"MapName, tuple","output_type":"bool","signature":"(map-delete map-name key-tuple)","description":"The `map-delete` function removes the value associated with the input key for\nthe given map. If an item exists and is removed, the function returns `true`.\nIf a value did not exist for this key in the data map, the function returns `false`.","example":"(define-map names-map ((name (buff 10))) ((id int)))\n(map-insert names-map { name: \"blockstack\" } { id: 1337 }) ;; Returns true\n(map-delete names-map { name: \"blockstack\" }) ;; Returns true\n(map-delete names-map { name: \"blockstack\" }) ;; Returns false\n(map-delete names-map ((name \"blockstack\"))) ;; Same command, using a shorthand for constructing the tuple\n"},{"name":"tuple","input_type":"(key-name A), (key-name-2 B), ...","output_type":"(tuple (key-name A) (key-name-2 B) ...)","signature":"(tuple ((key0 expr0) (key1 expr1) ...))","description":"The `tuple` function constructs a typed tuple from the supplied key and expression pairs.\nA `get` function can use typed tuples as input to select specific values from a given tuple.\nKey names may not appear multiple times in the same tuple definition. Supplied expressions are evaluated and\nassociated with the expressions' paired key name.","example":"(tuple (name \"blockstack\") (id 1337))"},{"name":"get","input_type":"KeyName, (tuple) | (optional (tuple))","output_type":"A","signature":"(get key-name tuple)","description":"The `get` function fetches the value associated with a given key from the supplied typed tuple.\nIf an `Optional` value is supplied as the inputted tuple, `get` returns an `Optional` type of the specified key in\nthe tuple. If the supplied option is a `(none)` option, get returns `(none)`.","example":"(define-map names-map ((name (buff 12))) ((id int)))\n(map-insert names-map { name: \"blockstack\" } { id: 1337 }) ;; Returns true\n(get id (tuple (name \"blockstack\") (id 1337))) ;; Returns 1337\n(get id (map-get? names-map (tuple (name \"blockstack\")))) ;; Returns (some 1337)\n(get id (map-get? names-map (tuple (name \"non-existent\")))) ;; Returns none\n"},{"name":"begin","input_type":"AnyType, ... A","output_type":"A","signature":"(begin expr1 expr2 expr3 ... expr-last)","description":"The `begin` function evaluates each of its input expressions, returning the\nreturn value of the last such expression.","example":"(begin (+ 1 2) 4 5) ;; Returns 5"},{"name":"hash160","input_type":"buff|uint|int","output_type":"(buff 20)","signature":"(hash160 value)","description":"The `hash160` function computes `RIPEMD160(SHA256(x))` of the inputted value.\nIf an integer (128 bit) is supplied the hash is computed over the little-endian representation of the\ninteger.","example":"(hash160 0) ;; Returns 0xe4352f72356db555721651aa612e00379167b30f"},{"name":"sha256","input_type":"buff|uint|int","output_type":"(buff 32)","signature":"(sha256 value)","description":"The `sha256` function computes `SHA256(x)` of the inputted value.\nIf an integer (128 bit) is supplied the hash is computed over the little-endian representation of the\ninteger.","example":"(sha256 0) ;; Returns 0x374708fff7719dd5979ec875d56cd2286f6d3cf7ec317a3b25632aab28ec37bb"},{"name":"sha512","input_type":"buff|uint|int","output_type":"(buff 64)","signature":"(sha512 value)","description":"The `sha512` function computes `SHA512(x)` of the inputted value.\nIf an integer (128 bit) is supplied the hash is computed over the little-endian representation of the\ninteger.","example":"(sha512 1) ;; Returns 0x6fcee9a7b7a7b821d241c03c82377928bc6882e7a08c78a4221199bfa220cdc55212273018ee613317c8293bb8d1ce08d1e017508e94e06ab85a734c99c7cc34"},{"name":"sha512/256","input_type":"buff|uint|int","output_type":"(buff 32)","signature":"(sha512/256 value)","description":"The `sha512/256` function computes `SHA512/256(x)` (the SHA512 algorithm with the 512/256 initialization vector, truncated\nto 256 bits) of the inputted value.\nIf an integer (128 bit) is supplied the hash is computed over the little-endian representation of the\ninteger.","example":"(sha512/256 1) ;; Returns 0x515a7e92e7c60522db968d81ff70b80818fc17aeabbec36baf0dda2812e94a86"},{"name":"keccak256","input_type":"buff|uint|int","output_type":"(buff 32)","signature":"(keccak256 value)","description":"The `keccak256` function computes `KECCAK256(value)` of the inputted value.\nNote that this differs from the `NIST SHA-3` (that is, FIPS 202) standard. If an integer (128 bit)\nis supplied the hash is computed over the little-endian representation of the integer.","example":"(keccak256 0) ;; Returns 0xf490de2920c8a35fabeb13208852aa28c76f9be9b03a4dd2b3c075f7a26923b4"},{"name":"print","input_type":"A","output_type":"A","signature":"(print expr)","description":"The `print` function evaluates and returns its input expression. On Blockstack Core\nnodes configured for development (as opposed to production mining nodes), this function prints the resulting value to `STDOUT` (standard output).","example":"(print (+ 1 2 3)) ;; Returns 6"},{"name":"contract-call?","input_type":"ContractName, PublicFunctionName, Arg0, ...","output_type":"(response A B)","signature":"(contract-call? .contract-name function-name arg0 arg1 ...)","description":"The `contract-call?` function executes the given public function of the given contract.\nYou _may not_ use this function to call a public function defined in the current contract. If the public\nfunction returns _err_, any database changes resulting from calling `contract-call?` are aborted.\nIf the function returns _ok_, database changes occurred.","example":"\n;; instantiate the sample-contracts/tokens.clar contract first!\n(as-contract (contract-call? .tokens mint! u19)) ;; Returns (ok u19)"},{"name":"as-contract","input_type":"A","output_type":"A","signature":"(as-contract expr)","description":"The `as-contract` function switches the current context's `tx-sender` value to the _contract's_\nprincipal and executes `expr` with that context. It returns the resulting value of `expr`.","example":"(as-contract tx-sender) ;; Returns S1G2081040G2081040G2081040G208105NK8PE5.docs-test"},{"name":"contract-of","input_type":"Trait","output_type":"principal","signature":"(contract-of .contract-name)","description":"The `contract-of` function returns the principal of the contract implementing the trait.","example":"\n(use-trait token-a-trait 'SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF.token-a.token-trait)\n(define-public (forward-get-balance (user principal) (contract ))\n (begin\n (ok (contract-of contract)))) ;; returns the principal of the contract implementing ``\n"},{"name":"at-block","input_type":"(buff 32), A","output_type":"A","signature":"(at-block block-hash expr)","description":"The `at-block` function evaluates the expression `expr` _as if_ it were evaluated at the end of the\nblock indicated by the _block-hash_ argument. The `expr` closure must be read-only.\n\nNote: The block identifying hash must be a hash returned by the `id-header-hash` block information\nproperty. This hash uniquely identifies Stacks blocks and is unique across Stacks forks. While the hash returned by\n`header-hash` is unique within the context of a single fork, it is not unique across Stacks forks.\n\nThe function returns the result of evaluating `expr`.\n","example":"\n(define-data-var data int 1)\n(at-block 0x0000000000000000000000000000000000000000000000000000000000000000 block-height) ;; Returns u0\n(at-block (get-block-info? id-header-hash 0) (var-get data)) ;; Throws NoSuchDataVariable because `data` wasn't initialized at block height 0"},{"name":"get-block-info?","input_type":"BlockInfoPropertyName, BlockHeightInt","output_type":"(optional buff) | (optional uint)","signature":"(get-block-info? prop-name block-height-expr)","description":"The `get-block-info?` function fetches data for a block of the given block height. The\nvalue and type returned are determined by the specified `BlockInfoPropertyName`. If the provided `BlockHeightInt` does\nnot correspond to an existing block prior to the current block, the function returns `none`. The currently available property names\nare `time`, `header-hash`, `burnchain-header-hash`, `id-header-hash`, `miner-address`, and `vrf-seed`.\n\nThe `time` property returns an integer value of the block header time field. This is a Unix epoch timestamp in seconds\nwhich roughly corresponds to when the block was mined. **Warning**: this does not increase monotonically with each block\nand block times are accurate only to within two hours. See [BIP113](https://github.com/bitcoin/bips/blob/master/bip-0113.mediawiki) for more information.\n\nThe `header-hash`, `burnchain-header-hash`, `id-header-hash`, and `vrf-seed` properties return a 32-byte buffer.\n\nThe `miner-address` property returns a `principal` corresponding to the miner of the given block.\n\nThe `id-header-hash` is the block identifier value that must be used as input to the `at-block` function.\n","example":"(get-block-info? time u0) ;; Returns (some u1557860301)\n(get-block-info? header-hash u0) ;; Returns (some 0x374708fff7719dd5979ec875d56cd2286f6d3cf7ec317a3b25632aab28ec37bb)\n(get-block-info? vrf-seed u0) ;; Returns (some 0xf490de2920c8a35fabeb13208852aa28c76f9be9b03a4dd2b3c075f7a26923b4)\n"},{"name":"err","input_type":"A","output_type":"(response A B)","signature":"(err value)","description":"The `err` function constructs a response type from the input value. Use `err` for\ncreating return values in public functions. An _err_ value indicates that any database changes during\nthe processing of the function should be rolled back.","example":"(err true) ;; Returns (err true)"},{"name":"ok","input_type":"A","output_type":"(response A B)","signature":"(ok value)","description":"The `ok` function constructs a response type from the input value. Use `ok` for\ncreating return values in public functions. An _ok_ value indicates that any database changes during\nthe processing of the function should materialize.","example":"(ok 1) ;; Returns (ok 1)"},{"name":"some","input_type":"A","output_type":"(optional A)","signature":"(some value)","description":"The `some` function constructs a `optional` type from the input value.","example":"(some 1) ;; Returns (some 1)\n(is-none (some 2)) ;; Returns false"},{"name":"default-to","input_type":"A, (optional A)","output_type":"A","signature":"(default-to default-value option-value)","description":"The `default-to` function attempts to 'unpack' the second argument: if the argument is\na `(some ...)` option, it returns the inner value of the option. If the second argument is a `(none)` value,\n`default-to` it returns the value of `default-value`.","example":"\n(define-map names-map ((name (buff 12))) ((id int)))\n(map-set names-map { name: \"blockstack\" } { id: 1337 })\n(default-to 0 (get id (map-get? names-map (tuple (name \"blockstack\"))))) ;; Returns 1337\n(default-to 0 (get id (map-get? names-map (tuple (name \"non-existant\"))))) ;; Returns 0\n"},{"name":"asserts!","input_type":"bool, C","output_type":"bool","signature":"(asserts! bool-expr thrown-value)","description":"The `asserts!` function admits a boolean argument and asserts its evaluation:\nif bool-expr is `true`, `asserts!` returns `true` and proceeds in the program execution.\nIf the supplied argument is returning a false value, `asserts!` _returns_ `thrown-value` and exits the current\ncontrol-flow.","example":"(asserts! (is-eq 1 1) (err 1)) ;; Returns true"},{"name":"unwrap!","input_type":"(optional A) | (response A B), C","output_type":"A","signature":"(unwrap! option-input thrown-value)","description":"The `unwrap!` function attempts to 'unpack' the first argument: if the argument is\nan option type, and the argument is a `(some ...)` option, `unwrap!` returns the inner value of the\noption. If the argument is a response type, and the argument is an `(ok ...)` response, `unwrap!` returns\n the inner value of the `ok`. If the supplied argument is either an `(err ...)` or a `(none)` value,\n`unwrap!` _returns_ `thrown-value` from the current function and exits the current control-flow.","example":"\n(define-map names-map ((name (buff 12))) ((id int)))\n(map-set names-map { name: \"blockstack\" } { id: 1337 })\n(define-private (get-name-or-err (name (buff 12)))\n (let ((raw-name (unwrap! (map-get? names-map { name: name }) (err 1))))\n (ok raw-name)))\n\n(get-name-or-err \"blockstack\") ;; Returns (ok (tuple (id 1337)))\n(get-name-or-err \"non-existant\") ;; Returns (err 1)"},{"name":"unwrap-err!","input_type":"(response A B), C","output_type":"B","signature":"(unwrap-err! response-input thrown-value)","description":"The `unwrap-err!` function attempts to 'unpack' the first argument: if the argument\nis an `(err ...)` response, `unwrap-err!` returns the inner value of the `err`.\nIf the supplied argument is an `(ok ...)` value,\n`unwrap-err!` _returns_ `thrown-value` from the current function and exits the current control-flow.","example":"(unwrap-err! (err 1) false) ;; Returns 1"},{"name":"unwrap-panic","input_type":"(optional A) | (response A B)","output_type":"A","signature":"(unwrap-panic option-input)","description":"The `unwrap` function attempts to 'unpack' its argument: if the argument is\nan option type, and the argument is a `(some ...)` option, this function returns the inner value of the\noption. If the argument is a response type, and the argument is an `(ok ...)` response, it returns\n the inner value of the `ok`. If the supplied argument is either an `(err ...)` or a `(none)` value,\n`unwrap` throws a runtime error, aborting any further processing of the current transaction.","example":"\n(define-map names-map ((name (buff 12))) ((id int)))\n(map-set names-map { name: \"blockstack\" } { id: 1337 })\n(unwrap-panic (map-get? names-map { name: \"blockstack\" })) ;; Returns (tuple (id 1337))\n(unwrap-panic (map-get? names-map { name: \"non-existant\" })) ;; Throws a runtime exception\n"},{"name":"unwrap-err-panic","input_type":"(response A B)","output_type":"B","signature":"(unwrap-err-panic response-input)","description":"The `unwrap-err` function attempts to 'unpack' the first argument: if the argument\nis an `(err ...)` response, `unwrap` returns the inner value of the `err`.\nIf the supplied argument is an `(ok ...)` value,\n`unwrap-err` throws a runtime error, aborting any further processing of the current transaction.","example":"(unwrap-err-panic (err 1)) ;; Returns 1\n(unwrap-err-panic (ok 1)) ;; Throws a runtime exception"},{"name":"match","input_type":"(optional A) name expression expression | (response A B) name expression name expression","output_type":"C","signature":"(match opt-input some-binding-name some-branch none-branch) |\n(match-resp input ok-binding-name ok-branch err-binding-name err-branch)","description":"The `match` function is used to test and destructure optional and response types.\n\nIf the `input` is an optional, it tests whether the provided\n`input` is a `some` or `none` option, and evaluates `some-branch` or\n`none-branch` in each respective case.\n\nWithin the `some-branch`, the _contained value_ of the `input`\nargument is bound to the provided `some-binding-name` name.\n\nOnly _one_ of the branches will be evaluated (similar to `if` statements).\n\nIf the `input` is a response, it tests whether the provided `input` is\nan `ok` or `err` response type, and evaluates `ok-branch` or\n`err-branch` in each respective case.\n\nWithin the `ok-branch`, the _contained ok value_ of the `input`\nargument is bound to the provided `ok-binding-name` name.\n\nWithin the `err-branch`, the _contained err value_ of the `input`\nargument is bound to the provided `err-binding-name` name.\n\nOnly _one_ of the branches will be evaluated (similar to `if` statements).\n\nNote: Type checking requires that the type of both the ok and err parts of the\nresponse object be determinable. For situations in which one of the parts of a response\nis untyped, you should use `unwrap-panic` or `unwrap-err-panic` instead of `match`.","example":"\n(define-private (add-10 (x (optional int)))\n (match x\n value (+ 10 value)\n 10))\n(add-10 (some 5)) ;; returns 15\n(add-10 none) ;; returns 10\n\n(define-private (add-or-pass-err (x (response int (buff 10))) (to-add int))\n (match x\n value (+ to-add value)\n err-value (err err-value)))\n(add-or-pass-err (ok 5) 20) ;; returns 25\n(add-or-pass-err (err \"ERROR\") 20) ;; returns (err \"ERROR\")\n"},{"name":"try!","input_type":"(optional A) | (response A B)","output_type":"A","signature":"(try! option-input)","description":"The `try!` function attempts to 'unpack' the first argument: if the argument is\nan option type, and the argument is a `(some ...)` option, `try!` returns the inner value of the\noption. If the argument is a response type, and the argument is an `(ok ...)` response, `try!` returns\n the inner value of the `ok`. If the supplied argument is either an `(err ...)` or a `none` value,\n`try!` _returns_ either `none` or the `(err ...)` value from the current function and exits the current control-flow.","example":"\n(define-map names-map ((name (buff 12))) ((id int)))\n(map-set names-map { name: \"blockstack\" } { id: 1337 })\n(try! (map-get? names-map { name: \"blockstack\" })) ;; Returns (tuple (id 1337))\n(define-private (checked-even (x int))\n (if (is-eq (mod x 2) 0)\n (ok x)\n (err false)))\n(define-private (double-if-even (x int))\n (ok (* 2 (try! (checked-even x)))))\n(double-if-even 10) ;; Returns (ok 20)\n(double-if-even 3) ;; Returns (err false)\n"},{"name":"is-ok","input_type":"(response A B)","output_type":"bool","signature":"(is-ok value)","description":"`is-ok` tests a supplied response value, returning `true` if the response was `ok`,\nand `false` if it was an `err`.","example":"(is-ok (ok 1)) ;; Returns true\n(is-ok (err 1)) ;; Returns false"},{"name":"is-none","input_type":"(optional A)","output_type":"bool","signature":"(is-none value)","description":"`is-none` tests a supplied option value, returning `true` if the option value is `(none)`,\nand `false` if it is a `(some ...)`.","example":"\n(define-map names-map ((name (buff 12))) ((id int)))\n(map-set names-map { name: \"blockstack\" } { id: 1337 })\n(is-none (get id (map-get? names-map { name: \"blockstack\" }))) ;; Returns false\n(is-none (get id (map-get? names-map { name: \"non-existant\" }))) ;; Returns true"},{"name":"is-err","input_type":"(response A B)","output_type":"bool","signature":"(is-err value)","description":"`is-err` tests a supplied response value, returning `true` if the response was an `err`,\nand `false` if it was an `ok`.","example":"(is-err (ok 1)) ;; Returns false\n(is-err (err 1)) ;; Returns true"},{"name":"is-some","input_type":"(optional A)","output_type":"bool","signature":"(is-some value)","description":"`is-some` tests a supplied option value, returning `true` if the option value is `(some ...)`,\nand `false` if it is a `none`.","example":"\n(define-map names-map ((name (buff 12))) ((id int)))\n(map-set names-map { name: \"blockstack\" } { id: 1337 })\n(is-some (get id (map-get? names-map { name: \"blockstack\" }))) ;; Returns true\n(is-some (get id (map-get? names-map { name: \"non-existant\" }))) ;; Returns false"},{"name":"filter","input_type":"Function(A) -> bool, (list A)","output_type":"(list A)","signature":"(filter func list)","description":"The `filter` function applies the input function `func` to each element of the\ninput list, and returns the same list with any elements removed for which the `func` returned `false`.","example":"(filter not (list true false true false)) ;; Returns (false false)"},{"name":"ft-get-balance","input_type":"TokenName, principal","output_type":"uint","signature":"(ft-get-balance token-name principal)","description":"`ft-get-balance` returns `token-name` balance of the principal `principal`.\nThe token type must have been defined using `define-fungible-token`.","example":"\n(define-fungible-token stackaroo)\n(ft-mint? stackaroo u100 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR)\n(ft-get-balance stackaroo 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR) ;; returns u100\n"},{"name":"nft-get-owner?","input_type":"AssetName, A","output_type":"(optional principal)","signature":"(nft-get-owner? asset-class asset-identifier)","description":"`nft-get-owner?` returns the owner of an asset, identified by `asset-identifier`, or `none` if the asset does not exist.\nThe asset type must have been defined using `define-non-fungible-token`, and the supplied `asset-identifier` must be of the same type specified in\nthat definition.","example":"\n(define-non-fungible-token stackaroo (buff 40))\n(nft-mint? stackaroo \"Roo\" 'SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF)\n(nft-get-owner? stackaroo \"Roo\") ;; Returns (some SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF)\n(nft-get-owner? stackaroo \"Too\") ;; Returns none\n"},{"name":"ft-transfer?","input_type":"TokenName, uint, principal, principal","output_type":"(response bool uint)","signature":"(ft-transfer? token-name amount sender recipient)","description":"`ft-transfer?` is used to increase the token balance for the `recipient` principal for a token\ntype defined using `define-fungible-token` by debiting the `sender` principal.\n\nThis function returns (ok true) if the transfer is successful. In the event of an unsuccessful transfer it returns\none of the following error codes:\n\n`(err u1)` -- `sender` does not have enough balance to transfer\n`(err u2)` -- `sender` and `recipient` are the same principal\n`(err u3)` -- amount to send is non-positive\n","example":"\n(define-fungible-token stackaroo)\n(ft-mint? stackaroo u100 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR)\n(ft-transfer? stackaroo u50 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR 'SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF) ;; returns (ok true)\n(ft-transfer? stackaroo u60 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR 'SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF) ;; returns (err u1)\n"},{"name":"nft-transfer?","input_type":"AssetName, A, principal, principal","output_type":"(response bool uint)","signature":"(nft-transfer? asset-class asset-identifier sender recipient)","description":"`nft-transfer?` is used to change the owner of an asset identified by `asset-identifier`\nfrom `sender` to `recipient`. The `asset-class` must have been defined by `define-non-fungible-token` and `asset-identifier`\nmust be of the type specified in that definition.\n\nThis function returns (ok true) if the transfer is successful. In the event of an unsuccessful transfer it returns\none of the following error codes:\n\n`(err u1)` -- `sender` does not own the asset\n`(err u2)` -- `sender` and `recipient` are the same principal\n`(err u3)` -- asset identified by asset-identifier does not exist\n","example":"\n(define-non-fungible-token stackaroo (buff 40))\n(nft-mint? stackaroo \"Roo\" 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR)\n(nft-transfer? stackaroo \"Roo\" 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR 'SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF) ;; returns (ok true)\n(nft-transfer? stackaroo \"Roo\" 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR 'SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF) ;; returns (err u1)\n(nft-transfer? stackaroo \"Stacka\" 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR 'SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF) ;; returns (err u3)\n"},{"name":"nft-mint?","input_type":"AssetName, A, principal","output_type":"(response bool uint)","signature":"(nft-mint? asset-class asset-identifier recipient)","description":"`nft-mint?` is used to instantiate an asset and set that asset's owner to the `recipient` principal.\nThe asset must have been defined using `define-non-fungible-token`, and the supplied `asset-identifier` must be of the same type specified in\nthat definition.\n\nIf an asset identified by `asset-identifier` _already exists_, this function will return an error with the following error code:\n\n`(err u1)`\n\nOtherwise, on successfuly mint, it returns `(ok true)`.\n","example":"\n(define-non-fungible-token stackaroo (buff 40))\n(nft-mint? stackaroo \"Roo\" 'SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF) ;; returns (ok true)\n"},{"name":"ft-mint?","input_type":"TokenName, uint, principal","output_type":"(response bool uint)","signature":"(ft-mint? token-name amount recipient)","description":"`ft-mint?` is used to increase the token balance for the `recipient` principal for a token\ntype defined using `define-fungible-token`. The increased token balance is _not_ transfered from another principal, but\nrather minted.\n\nIf a non-positive amount is provided to mint, this function returns `(err 1)`. Otherwise, on successfuly mint, it\nreturns `(ok true)`.\n","example":"\n(define-fungible-token stackaroo)\n(ft-mint? stackaroo u100 'SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF) ;; returns (ok true)\n"},{"name":"stx-get-balance","input_type":"principal","output_type":"uint","signature":"(stx-get-balance owner)","description":"`stx-get-balance` is used to query the STX balance of the `owner` principal.\n\nThis function returns the STX balance of the `owner` principal. In the event that the `owner`\nprincipal isn't materialized, it returns 0.\n","example":"\n(stx-get-balance 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR) ;; returns u0\n(stx-get-balance (as-contract tx-sender)) ;; returns u10000\n"},{"name":"stx-transfer?","input_type":"uint, principal, principal","output_type":"(response bool uint)","signature":"(stx-transfer? amount sender recipient)","description":"`stx-transfer?` is used to increase the STX balance for the `recipient` principal\nby debiting the `sender` principal. The `sender` principal _must_ be equal to the current context's `tx-sender`.\n\nThis function returns (ok true) if the transfer is successful. In the event of an unsuccessful transfer it returns\none of the following error codes:\n\n`(err u1)` -- `sender` does not have enough balance to transfer\n`(err u2)` -- `sender` and `recipient` are the same principal\n`(err u3)` -- amount to send is non-positive\n`(err u4)` -- the `sender` principal is not the current `tx-sender`\n","example":"\n(as-contract\n (stx-transfer? u60 tx-sender 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR)) ;; returns (ok true)\n(as-contract\n (stx-transfer? u50 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR tx-sender)) ;; returns (err u4)\n"},{"name":"stx-burn?","input_type":"uint, principal","output_type":"(response bool uint)","signature":"(stx-burn? amount sender)","description":"`stx-burn?` debits the `sender` principal's STX holdings by `amount`, destroying\nthe STX. The `sender` principal _must_ be equal to the current context's `tx-sender`.\n\nThis function returns (ok true) if the transfer is successful. In the event of an unsuccessful transfer it returns\none of the following error codes:\n\n`(err u1)` -- `sender` does not have enough balance to transfer\n`(err u3)` -- amount to send is non-positive\n`(err u4)` -- the `sender` principal is not the current `tx-sender`\n","example":"\n(as-contract\n (stx-burn? u60 tx-sender)) ;; returns (ok true)\n(as-contract\n (stx-burn? u50 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR)) ;; returns (err u4)\n"},{"name":"define-constant","input_type":"MethodSignature, MethodBody","output_type":"Not Applicable","signature":"(define-constant name expression)","description":"`define-constant` is used to define a private constant value in a smart contract.\nThe expression passed into the definition is evaluated at contract launch, in the order that it is\nsupplied in the contract. This can lead to undefined function or undefined variable errors in the\nevent that a function or variable used in the expression has not been defined before the constant.\n\nLike other kinds of definition statements, `define-constant` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put a define statement in the middle of a function body).\n","example":"\n(define-constant four (+ 2 2))\n(+ 4 four) ;; returns 8\n"},{"name":"define-private","input_type":"MethodSignature, MethodBody","output_type":"Not Applicable","signature":"(define-private (function-name (arg-name-0 arg-type-0) (arg-name-1 arg-type-1) ...) function-body)","description":"`define-private` is used to define _private_ functions for a smart contract. Private\nfunctions may not be called from other smart contracts, nor may they be invoked directly by users.\nInstead, these functions may only be invoked by other functions defined in the same smart contract.\n\nLike other kinds of definition statements, `define-private` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put a define statement in the middle of a function body).\n\nPrivate functions may return any type.","example":"\n(define-private (max-of (i1 int) (i2 int))\n (if (> i1 i2)\n i1\n i2))\n(max-of 4 6) ;; returns 6\n"},{"name":"define-public","input_type":"MethodSignature, MethodBody","output_type":"Not Applicable","signature":"(define-public (function-name (arg-name-0 arg-type-0) (arg-name-1 arg-type-1) ...) function-body)","description":"`define-public` is used to define a _public_ function and transaction for a smart contract. Public\nfunctions are callable from other smart contracts and may be invoked directly by users by submitting a transaction\nto the Stacks blockchain.\n\nLike other kinds of definition statements, `define-public` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put a define statement in the middle of a function body).\n\nPublic functions _must_ return a ResponseType (using either `ok` or `err`). Any datamap modifications performed by\na public function is aborted if the function returns an `err` type. Public functions may be invoked by other\ncontracts via `contract-call?`.","example":"\n(define-public (hello-world (input int))\n (begin (print (+ 2 input))\n (ok input)))\n"},{"name":"define-read-only","input_type":"MethodSignature, MethodBody","output_type":"Not Applicable","signature":"(define-read-only (function-name (arg-name-0 arg-type-0) (arg-name-1 arg-type-1) ...) function-body)","description":"`define-read-only` is used to define a _public read-only_ function for a smart contract. Such\nfunctions are callable from other smart contracts.\n\nLike other kinds of definition statements, `define-read-only` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put a define statement in the middle of a function body).\n\nRead-only functions may return any type. However, read-only functions\nmay not perform any datamap modifications, or call any functions which\nperform such modifications. This is enforced both during type checks and during\nthe execution of the function. Public read-only functions may\nbe invoked by other contracts via `contract-call?`.","example":"\n(define-read-only (just-return-one-hundred)\n (* 10 10))"},{"name":"define-map","input_type":"MapName, KeyTupleDefinition, MapTupleDefinition","output_type":"Not Applicable","signature":"(define-map map-name ((key-name-0 key-type-0) ...) ((val-name-0 val-type-0) ...))","description":"`define-map` is used to define a new datamap for use in a smart contract. Such\nmaps are only modifiable by the current smart contract.\n\nMaps are defined with a key tuple type and value tuple type. These are defined using a list\nof name and type pairs, e.g., a key type might be `((id int))`, which is a tuple with a single \"id\"\nfield of type `int`.\n\nLike other kinds of definition statements, `define-map` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put a define statement in the middle of a function body).","example":"\n(define-map squares ((x int)) ((square int)))\n(define-private (add-entry (x int))\n (map-insert squares ((x 2)) ((square (* x x)))))\n(add-entry 1)\n(add-entry 2)\n(add-entry 3)\n(add-entry 4)\n(add-entry 5)\n"},{"name":"define-data-var","input_type":"VarName, TypeDefinition, Value","output_type":"Not Applicable","signature":"(define-data-var var-name type value)","description":"`define-data-var` is used to define a new persisted variable for use in a smart contract. Such\nvariable are only modifiable by the current smart contract.\n\nPersisted variable are defined with a type and a value.\n\nLike other kinds of definition statements, `define-data-var` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put a define statement in the middle of a function body).","example":"\n(define-data-var size int 0)\n(define-private (set-size (value int))\n (var-set size value))\n(set-size 1)\n(set-size 2)\n"},{"name":"define-fungible-token","input_type":"TokenName, ","output_type":"Not Applicable","signature":"(define-fungible-token token-name )","description":"`define-fungible-token` is used to define a new fungible token class for use in the current contract.\n\nThe second argument, if supplied, defines the total supply of the fungible token. This ensures that all calls to the `ft-mint?`\nfunction will never be able to create more than `total-supply` tokens. If any such call were to increase the total supply\nof tokens passed that amount, that invocation of `ft-mint?` will result in a runtime error and abort.\n\nLike other kinds of definition statements, `define-fungible-token` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put a define statement in the middle of a function body).\n\nTokens defined using `define-fungible-token` may be used in `ft-transfer?`, `ft-mint?`, and `ft-get-balance` functions","example":"\n(define-fungible-token stacks)\n(define-fungible-token limited-supply-stacks u100)\n"},{"name":"define-non-fungible-token","input_type":"AssetName, TypeSignature","output_type":"Not Applicable","signature":"(define-non-fungible-token asset-name asset-identifier-type)","description":"`define-non-fungible-token` is used to define a new non-fungible token class for use in the current contract.\nIndividual assets are identified by their asset identifier, which must be of the type `asset-identifier-type`. Asset\nidentifiers are _unique_ identifiers.\n\nLike other kinds of definition statements, `define-non-fungible-token` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put a define statement in the middle of a function body).\n\nAssets defined using `define-non-fungible-token` may be used in `nft-transfer?`, `nft-mint?`, and `nft-get-owner?` functions","example":"\n(define-non-fungible-token names (buff 50))\n"},{"name":"define-trait","input_type":"VarName, [MethodSignature]","output_type":"Not Applicable","signature":"(define-trait trait-name ((func1-name (arg1-type arg2-type ...) (return-type))))","description":"`define-trait` is used to define a new trait definition for use in a smart contract. Other contracts\ncan implement a given trait and then have their contract identifier being passed as function arguments in order to be called\ndynamically with `contract-call?`.\n\nTraits are defined with a name, and a list functions defined with a name, a list of argument types, and return type.\n\nLike other kinds of definition statements, `define-trait` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put a define statement in the middle of a function body).\n","example":"\n(define-trait token-trait\n ((transfer? (principal principal uint) (response uint uint))\n (get-balance (principal) (response uint uint))))\n"},{"name":"use-trait","input_type":"VarName, TraitIdentifier","output_type":"Not Applicable","signature":"(use-trait trait-alias trait-identifier)","description":"`use-trait` is used to bring a trait, defined in another contract, to the current contract. Subsequent\nreferences to an imported trait are signaled with the syntax ``.\n\nTraits import are defined with a name, used as an alias, and a trait identifier. Trait identifiers can either be\nusing the sugared syntax (.token-a.token-trait), or be fully qualified ('SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF.token-a.token-trait).\n\nLike other kinds of definition statements, `use-trait` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put such a statement in the middle of a function body).\n ","example":"\n(use-trait token-a-trait 'SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF.token-a.token-trait)\n(define-public (forward-get-balance (user principal) (contract ))\n (begin\n (ok 1)))\n"},{"name":"impl-trait","input_type":"TraitIdentifier","output_type":"Not Applicable","signature":"(impl-trait trait-identifier)","description":"`impl-trait` can be use for asserting that a contract is fully implementing a given trait.\nAdditional checks are being performed when the contract is being published, rejecting the deployment if the\ncontract is violating the trait specification.\n\nTrait identifiers can either be using the sugared syntax (.token-a.token-trait), or be fully qualified\n('SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF.token-a.token-trait).\n\nLike other kinds of definition statements, `impl-trait` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put such a statement in the middle of a function body).\n","example":"\n(impl-trait 'SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF.token-a.token-trait)\n"}],"keywords":[{"name":"contract-caller","output_type":"principal","description":"Returns the caller of the current contract context. If this contract is the first one called by a signed transaction,\nthe caller will be equal to the signing principal. If `contract-call?` was used to invoke a function from a new contract, `contract-caller`\nchanges to the _calling_ contract's principal. If `as-contract` is used to change the `tx-sender` context, `contract-caller` _also_ changes\nto the same contract principal.","example":"(print contract-caller) ;; Will print out a Stacks address of the transaction sender"},{"name":"tx-sender","output_type":"principal","description":"Returns the original sender of the current transaction, or if `as-contract` was called to modify the sending context, it returns that\ncontract principal.","example":"(print tx-sender) ;; Will print out a Stacks address of the transaction sender"},{"name":"block-height","output_type":"uint","description":"Returns the current block height of the Stacks blockchain as an int","example":"(> block-height 1000) ;; returns true if the current block-height has passed 1000 blocks."},{"name":"none","output_type":"(optional ?)","description":"Represents the _none_ option indicating no value for a given optional (analogous to a null value).","example":"\n(define-public (only-if-positive (a int))\n (if (> a 0)\n (some a)\n none))\n(only-if-positive 4) ;; Returns (some 4)\n(only-if-positive (- 3)) ;; Returns none\n"},{"name":"true","output_type":"bool","description":"Boolean true constant.","example":"\n(and true false) ;; Evaluates to false\n(or false true) ;; Evaluates to true\n"},{"name":"false","output_type":"bool","description":"Boolean false constant.","example":"\n(and true false) ;; Evaluates to false\n(or false true) ;; Evaluates to true\n"}]} +{ + "functions": [ + { + "name": "+ (add)", + "input_type": "int, ... | uint, ...", + "output_type": "int | uint", + "signature": "(+ i1 i2...)", + "description": "Adds a variable number of integer inputs and returns the result. In the event of an _overflow_, throws a runtime error.", + "example": "(+ 1 2 3) ;; Returns 6" + }, + { + "name": "- (subtract)", + "input_type": "int, ... | uint, ...", + "output_type": "int | uint", + "signature": "(- i1 i2...)", + "description": "Subtracts a variable number of integer inputs and returns the result. In the event of an _underflow_, throws a runtime error.", + "example": "(- 2 1 1) ;; Returns 0\n(- 0 3) ;; Returns -3\n" + }, + { + "name": "* (multiply)", + "input_type": "int, ... | uint, ...", + "output_type": "int | uint", + "signature": "(* i1 i2...)", + "description": "Multiplies a variable number of integer inputs and returns the result. In the event of an _overflow_, throws a runtime error.", + "example": "(* 2 3) ;; Returns 6\n(* 5 2) ;; Returns 10\n(* 2 2 2) ;; Returns 8\n" + }, + { + "name": "/ (divide)", + "input_type": "int, ... | uint, ...", + "output_type": "int | uint", + "signature": "(/ i1 i2...)", + "description": "Integer divides a variable number of integer inputs and returns the result. In the event of division by zero, throws a runtime error.", + "example": "(/ 2 3) ;; Returns 0\n(/ 5 2) ;; Returns 2\n(/ 4 2 2) ;; Returns 1\n" + }, + { + "name": ">= (greater than or equal)", + "input_type": "int, int | uint, uint", + "output_type": "bool", + "signature": "(>= i1 i2)", + "description": "Compares two integers, returning `true` if `i1` is greater than or equal to `i2` and `false` otherwise.", + "example": "(>= 1 1) ;; Returns true\n(>= 5 2) ;; Returns true\n" + }, + { + "name": "<= (less than or equal)", + "input_type": "int, int | uint, uint", + "output_type": "bool", + "signature": "(<= i1 i2)", + "description": "Compares two integers, returning true if `i1` is less than or equal to `i2` and `false` otherwise.", + "example": "(<= 1 1) ;; Returns true\n(<= 5 2) ;; Returns false\n" + }, + { + "name": "< (less than)", + "input_type": "int, int | uint, uint", + "output_type": "bool", + "signature": "(< i1 i2)", + "description": "Compares two integers, returning `true` if `i1` is less than `i2` and `false` otherwise.", + "example": "(< 1 2) ;; Returns true\n(< 5 2) ;; Returns false\n" + }, + { + "name": "> (greater than)", + "input_type": "int, int | uint, uint", + "output_type": "bool", + "signature": "(> i1 i2)", + "description": "Compares two integers, returning `true` if `i1` is greater than `i2` and false otherwise.", + "example": "(> 1 2) ;; Returns false\n(> 5 2) ;; Returns true\n" + }, + { + "name": "to-int", + "input_type": "uint", + "output_type": "int", + "signature": "(to-int u)", + "description": "Tries to convert the `uint` argument to an `int`. Will cause a runtime error and abort if the supplied argument is >= `pow(2, 127)`", + "example": "(to-int u238) ;; Returns 238" + }, + { + "name": "to-uint", + "input_type": "int", + "output_type": "uint", + "signature": "(to-uint i)", + "description": "Tries to convert the `int` argument to a `uint`. Will cause a runtime error and abort if the supplied argument is negative.", + "example": "(to-uint 238) ;; Returns u238" + }, + { + "name": "mod", + "input_type": "int, int | uint, uint", + "output_type": "int | uint", + "signature": "(mod i1 i2)", + "description": "Returns the integer remainder from integer dividing `i1` by `i2`. In the event of a division by zero, throws a runtime error.", + "example": "(mod 2 3) ;; Returns 2\n(mod 5 2) ;; Returns 1\n(mod 7 1) ;; Returns 0\n" + }, + { + "name": "pow", + "input_type": "int, int | uint, uint", + "output_type": "int | uint", + "signature": "(pow i1 i2)", + "description": "Returns the result of raising `i1` to the power of `i2`. In the event of an _overflow_, throws a runtime error.", + "example": "(pow 2 3) ;; Returns 8\n(pow 2 2) ;; Returns 4\n(pow 7 1) ;; Returns 7\n" + }, + { + "name": "xor", + "input_type": "int, int | uint, uint", + "output_type": "int | uint", + "signature": "(xor i1 i2)", + "description": "Returns the result of bitwise exclusive or'ing `i1` with `i2`.", + "example": "(xor 1 2) ;; Returns 3\n(xor 120 280) ;; Returns 352\n" + }, + { + "name": "and", + "input_type": "bool, ...", + "output_type": "bool", + "signature": "(and b1 b2 ...)", + "description": "Returns `true` if all boolean inputs are `true`. Importantly, the supplied arguments are evaluated in-order and lazily. Lazy evaluation means that if one of the arguments returns `false`, the function short-circuits, and no subsequent arguments are evaluated.", + "example": "(and true false) ;; Returns false\n(and (is-eq (+ 1 2) 1) (is-eq 4 4)) ;; Returns false\n(and (is-eq (+ 1 2) 3) (is-eq 4 4)) ;; Returns true\n" + }, + { + "name": "or", + "input_type": "bool, ...", + "output_type": "bool", + "signature": "(or b1 b2 ...)", + "description": "Returns `true` if any boolean inputs are `true`. Importantly, the supplied arguments are evaluated in-order and lazily. Lazy evaluation means that if one of the arguments returns `false`, the function short-circuits, and no subsequent arguments are evaluated.", + "example": "(or true false) ;; Returns true\n(or (is-eq (+ 1 2) 1) (is-eq 4 4)) ;; Returns true\n(or (is-eq (+ 1 2) 1) (is-eq 3 4)) ;; Returns false\n(or (is-eq (+ 1 2) 3) (is-eq 4 4)) ;; Returns true\n" + }, + { + "name": "not", + "input_type": "bool", + "output_type": "bool", + "signature": "(not b1)", + "description": "Returns the inverse of the boolean input.", + "example": "(not true) ;; Returns false\n(not (is-eq 1 2)) ;; Returns true\n" + }, + { + "name": "is-eq", + "input_type": "A, A, ...", + "output_type": "bool", + "signature": "(is-eq v1 v2...)", + "description": "Compares the inputted values, returning `true` if they are all equal. Note that \n_unlike_ the `(and ...)` function, `(is-eq ...)` will _not_ short-circuit. All values supplied to\nis-eq _must_ be the same type.", + "example": "(is-eq 1 1) ;; Returns true\n(is-eq true false) ;; Returns false\n(is-eq \"abc\" 234 234) ;; Throws type error\n" + }, + { + "name": "if", + "input_type": "bool, A, A", + "output_type": "A", + "signature": "(if bool1 expr1 expr2)", + "description": "The `if` function admits a boolean argument and two expressions\nwhich must return the same type. In the case that the boolean input is `true`, the\n`if` function evaluates and returns `expr1`. If the boolean input is `false`, the\n`if` function evaluates and returns `expr2`.", + "example": "(if true 1 2) ;; Returns 1\n(if (> 1 2) 1 2) ;; Returns 2" + }, + { + "name": "let", + "input_type": "((name2 AnyType) (name2 AnyType) ...), AnyType, ... A", + "output_type": "A", + "signature": "(let ((name1 expr1) (name2 expr2) ...) expr-body1 expr-body2 ... expr-body-last)", + "description": "The `let` function accepts a list of `variable name` and `expression` pairs,\nevaluating each expression and _binding_ it to the corresponding variable name. The _context_\ncreated by this set of bindings is used for evaluating its body expressions. The let expression returns the value of the last such body expression.", + "example": "(let ((a 2) (b (+ 5 6 7))) (print a) (print b) (+ a b)) ;; Returns 20" + }, + { + "name": "map", + "input_type": "Function(A) -> B, (list A)", + "output_type": "(list B)", + "signature": "(map func list)", + "description": "The `map` function applies the input function `func` to each element of the\ninput list, and outputs a list containing the _outputs_ from those function applications.", + "example": "(map not (list true false true false)) ;; Returns (false true false true)" + }, + { + "name": "fold", + "input_type": "Function(A, B) -> B, (list A), B", + "output_type": "B", + "signature": "(fold func list initial-value)", + "description": "The `fold` special form applies the input function `func` to each element of the\ninput list _and_ the output of the previous application of the `fold` function. When invoked on\nthe first list element, it uses the `initial-value` as the second input. `fold` returns the last\nvalue returned by the successive applications. Note that the first argument is not evaluated thus\nhas to be a literal function name.", + "example": "(fold * (list 2 2 2) 1) ;; Returns 8\n(fold * (list 2 2 2) 0) ;; Returns 0\n;; calculates (- 11 (- 7 (- 3 2)))\n(fold - (list 3 7 11) 2) ;; Returns 5 \n(fold concat \"cdef\" \"ab\") ;; Returns 0x666564636162\n ;; hex form of \"fedcab\" \n(fold concat (list \"cd\" \"ef\") \"ab\") ;; Returns 0x656663646162\n ;; hex form of \"efcdab\"" + }, + { + "name": "append", + "input_type": "list A, A", + "output_type": "list", + "signature": "(append (list 1 2 3 4) 5)", + "description": "The `append` function takes a list and another value with the same entry type,\nor a buffer and another buffer of length 1 and outputs a buffer or a list of the same type with max_len += 1.", + "example": "(append (list 1 2 3 4) 5) ;; Returns (1 2 3 4 5)" + }, + { + "name": "concat", + "input_type": "(buff, buff)|(list, list)", + "output_type": "buff|list", + "signature": "(concat buff-a buff-b)", + "description": "The `concat` function takes two buffers or two lists with the same entry type,\nand returns a concatenated buffer or list of the same entry type, with max_len = max_len_a + max_len_b.", + "example": "(concat \"hello \" \"world\") ;; Returns 0x68656c6c6f20776f726c64\n ;; hex form of \"hello world\"" + }, + { + "name": "as-max-len?", + "input_type": "buff|list, uint", + "output_type": "(optional buff|list)", + "signature": "(as-max-len? buffer u10)", + "description": "The `as-max-len?` function takes a length N (must be a literal) and a buffer or list argument, which must be typed as a list\nor buffer of length M and outputs that same list or buffer, but typed with max length N.\n\nThis function returns an optional type with the resulting iterable. If the input iterable is less than\nor equal to the supplied max-len, it returns `(some )`, otherwise it returns `none`.", + "example": "(as-max-len? (list 2 2 2) u3) ;; Returns (some (2 2 2))\n(as-max-len? (list 1 2 3) u2) ;; Returns none" + }, + { + "name": "len", + "input_type": "buff|list", + "output_type": "uint", + "signature": "(len buffer)", + "description": "The `len` function returns the length of a given buffer or list.", + "example": "(len \"blockstack\") ;; Returns u10\n(len (list 1 2 3 4 5)) ;; Returns u5\n" + }, + { + "name": "list", + "input_type": "A, ...", + "output_type": "(list A)", + "signature": "(list expr1 expr2 expr3 ...)", + "description": "The `list` function constructs a list composed of the inputted values. Each\nsupplied value must be of the same type.", + "example": "(list (+ 1 2) 4 5) ;; Returns (3 4 5)" + }, + { + "name": "var-get", + "input_type": "VarName", + "output_type": "A", + "signature": "(var-get var-name)", + "description": "The `var-get` function looks up and returns an entry from a contract's data map.\nThe value is looked up using `var-name`.", + "example": "(define-data-var cursor int 6)\n(var-get cursor) ;; Returns 6" + }, + { + "name": "var-set", + "input_type": "VarName, AnyType", + "output_type": "bool", + "signature": "(var-set var-name expr1)", + "description": "The `var-set` function sets the value associated with the input variable to the\ninputted value.", + "example": "\n(define-data-var cursor int 6)\n(var-get cursor) ;; Returns 6\n(var-set cursor (+ (var-get cursor) 1)) ;; Returns true\n(var-get cursor) ;; Returns 7" + }, + { + "name": "map-get?", + "input_type": "MapName, tuple", + "output_type": "(optional (tuple))", + "signature": "(map-get? map-name key-tuple)", + "description": "The `map-get?` function looks up and returns an entry from a contract's data map.\nThe value is looked up using `key-tuple`.\nIf there is no value associated with that key in the data map, the function returns a `none` option. Otherwise,\nit returns `(some value)`.", + "example": "(define-map names-map ((name (buff 10))) ((id int)))\n(map-set names-map { name: \"blockstack\" } { id: 1337 })\n(map-get? names-map (tuple (name \"blockstack\"))) ;; Returns (some (tuple (id 1337)))\n(map-get? names-map ((name \"blockstack\"))) ;; Same command, using a shorthand for constructing the tuple\n" + }, + { + "name": "map-set", + "input_type": "MapName, tuple_A, tuple_B", + "output_type": "bool", + "signature": "(map-set map-name key-tuple value-tuple)", + "description": "The `map-set` function sets the value associated with the input key to the\ninputted value. This function performs a _blind_ update; whether or not a value is already associated\nwith the key, the function overwrites that existing association.\n\nNote: the `value-tuple` requires 1 additional byte for storage in the materialized blockchain state,\nand therefore the maximum size of a value that may be inserted into a map is MAX_CLARITY_VALUE - 1.", + "example": "(define-map names-map ((name (buff 10))) ((id int)))\n(map-set names-map { name: \"blockstack\" } { id: 1337 }) ;; Returns true\n(map-set names-map ((name \"blockstack\")) ((id 1337))) ;; Same command, using a shorthand for constructing the tuple\n" + }, + { + "name": "map-insert", + "input_type": "MapName, tuple_A, tuple_B", + "output_type": "bool", + "signature": "(map-insert map-name key-tuple value-tuple)", + "description": "The `map-insert` function sets the value associated with the input key to the\ninputted value if and only if there is not already a value associated with the key in the map.\nIf an insert occurs, the function returns `true`. If a value already existed for\nthis key in the data map, the function returns `false`.\n\nNote: the `value-tuple` requires 1 additional byte for storage in the materialized blockchain state,\nand therefore the maximum size of a value that may be inserted into a map is MAX_CLARITY_VALUE - 1.", + "example": "(define-map names-map ((name (buff 10))) ((id int)))\n(map-insert names-map { name: \"blockstack\" } { id: 1337 }) ;; Returns true\n(map-insert names-map { name: \"blockstack\" } { id: 1337 }) ;; Returns false\n(map-insert names-map ((name \"blockstack\")) ((id 1337))) ;; Same command, using a shorthand for constructing the tuple\n" + }, + { + "name": "map-delete", + "input_type": "MapName, tuple", + "output_type": "bool", + "signature": "(map-delete map-name key-tuple)", + "description": "The `map-delete` function removes the value associated with the input key for\nthe given map. If an item exists and is removed, the function returns `true`.\nIf a value did not exist for this key in the data map, the function returns `false`.", + "example": "(define-map names-map ((name (buff 10))) ((id int)))\n(map-insert names-map { name: \"blockstack\" } { id: 1337 }) ;; Returns true\n(map-delete names-map { name: \"blockstack\" }) ;; Returns true\n(map-delete names-map { name: \"blockstack\" }) ;; Returns false\n(map-delete names-map ((name \"blockstack\"))) ;; Same command, using a shorthand for constructing the tuple\n" + }, + { + "name": "tuple", + "input_type": "(key-name A), (key-name-2 B), ...", + "output_type": "(tuple (key-name A) (key-name-2 B) ...)", + "signature": "(tuple ((key0 expr0) (key1 expr1) ...))", + "description": "The `tuple` function constructs a typed tuple from the supplied key and expression pairs.\nA `get` function can use typed tuples as input to select specific values from a given tuple.\nKey names may not appear multiple times in the same tuple definition. Supplied expressions are evaluated and\nassociated with the expressions' paired key name.", + "example": "(tuple (name \"blockstack\") (id 1337))" + }, + { + "name": "get", + "input_type": "KeyName, (tuple) | (optional (tuple))", + "output_type": "A", + "signature": "(get key-name tuple)", + "description": "The `get` function fetches the value associated with a given key from the supplied typed tuple.\nIf an `Optional` value is supplied as the inputted tuple, `get` returns an `Optional` type of the specified key in\nthe tuple. If the supplied option is a `(none)` option, get returns `(none)`.", + "example": "(define-map names-map ((name (buff 12))) ((id int)))\n(map-insert names-map { name: \"blockstack\" } { id: 1337 }) ;; Returns true\n(get id (tuple (name \"blockstack\") (id 1337))) ;; Returns 1337\n(get id (map-get? names-map (tuple (name \"blockstack\")))) ;; Returns (some 1337)\n(get id (map-get? names-map (tuple (name \"non-existent\")))) ;; Returns none\n" + }, + { + "name": "begin", + "input_type": "AnyType, ... A", + "output_type": "A", + "signature": "(begin expr1 expr2 expr3 ... expr-last)", + "description": "The `begin` function evaluates each of its input expressions, returning the\nreturn value of the last such expression.", + "example": "(begin (+ 1 2) 4 5) ;; Returns 5" + }, + { + "name": "hash160", + "input_type": "buff|uint|int", + "output_type": "(buff 20)", + "signature": "(hash160 value)", + "description": "The `hash160` function computes `RIPEMD160(SHA256(x))` of the inputted value.\nIf an integer (128 bit) is supplied the hash is computed over the little-endian representation of the\ninteger.", + "example": "(hash160 0) ;; Returns 0xe4352f72356db555721651aa612e00379167b30f" + }, + { + "name": "sha256", + "input_type": "buff|uint|int", + "output_type": "(buff 32)", + "signature": "(sha256 value)", + "description": "The `sha256` function computes `SHA256(x)` of the inputted value.\nIf an integer (128 bit) is supplied the hash is computed over the little-endian representation of the\ninteger.", + "example": "(sha256 0) ;; Returns 0x374708fff7719dd5979ec875d56cd2286f6d3cf7ec317a3b25632aab28ec37bb" + }, + { + "name": "sha512", + "input_type": "buff|uint|int", + "output_type": "(buff 64)", + "signature": "(sha512 value)", + "description": "The `sha512` function computes `SHA512(x)` of the inputted value.\nIf an integer (128 bit) is supplied the hash is computed over the little-endian representation of the\ninteger.", + "example": "(sha512 1) ;; Returns 0x6fcee9a7b7a7b821d241c03c82377928bc6882e7a08c78a4221199bfa220cdc55212273018ee613317c8293bb8d1ce08d1e017508e94e06ab85a734c99c7cc34" + }, + { + "name": "sha512/256", + "input_type": "buff|uint|int", + "output_type": "(buff 32)", + "signature": "(sha512/256 value)", + "description": "The `sha512/256` function computes `SHA512/256(x)` (the SHA512 algorithm with the 512/256 initialization vector, truncated\nto 256 bits) of the inputted value.\nIf an integer (128 bit) is supplied the hash is computed over the little-endian representation of the\ninteger.", + "example": "(sha512/256 1) ;; Returns 0x515a7e92e7c60522db968d81ff70b80818fc17aeabbec36baf0dda2812e94a86" + }, + { + "name": "keccak256", + "input_type": "buff|uint|int", + "output_type": "(buff 32)", + "signature": "(keccak256 value)", + "description": "The `keccak256` function computes `KECCAK256(value)` of the inputted value.\nNote that this differs from the `NIST SHA-3` (that is, FIPS 202) standard. If an integer (128 bit)\nis supplied the hash is computed over the little-endian representation of the integer.", + "example": "(keccak256 0) ;; Returns 0xf490de2920c8a35fabeb13208852aa28c76f9be9b03a4dd2b3c075f7a26923b4" + }, + { + "name": "print", + "input_type": "A", + "output_type": "A", + "signature": "(print expr)", + "description": "The `print` function evaluates and returns its input expression. On Blockstack Core\nnodes configured for development (as opposed to production mining nodes), this function prints the resulting value to `STDOUT` (standard output).", + "example": "(print (+ 1 2 3)) ;; Returns 6" + }, + { + "name": "contract-call?", + "input_type": "ContractName, PublicFunctionName, Arg0, ...", + "output_type": "(response A B)", + "signature": "(contract-call? .contract-name function-name arg0 arg1 ...)", + "description": "The `contract-call?` function executes the given public function of the given contract.\nYou _may not_ use this function to call a public function defined in the current contract. If the public\nfunction returns _err_, any database changes resulting from calling `contract-call?` are aborted.\nIf the function returns _ok_, database changes occurred.", + "example": "\n;; instantiate the sample-contracts/tokens.clar contract first!\n(as-contract (contract-call? .tokens mint! u19)) ;; Returns (ok u19)" + }, + { + "name": "as-contract", + "input_type": "A", + "output_type": "A", + "signature": "(as-contract expr)", + "description": "The `as-contract` function switches the current context's `tx-sender` value to the _contract's_\nprincipal and executes `expr` with that context. It returns the resulting value of `expr`.", + "example": "(as-contract tx-sender) ;; Returns S1G2081040G2081040G2081040G208105NK8PE5.docs-test" + }, + { + "name": "contract-of", + "input_type": "Trait", + "output_type": "principal", + "signature": "(contract-of .contract-name)", + "description": "The `contract-of` function returns the principal of the contract implementing the trait.", + "example": "\n(use-trait token-a-trait 'SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF.token-a.token-trait)\n(define-public (forward-get-balance (user principal) (contract ))\n (begin\n (ok (contract-of contract)))) ;; returns the principal of the contract implementing \n" + }, + { + "name": "at-block", + "input_type": "(buff 32), A", + "output_type": "A", + "signature": "(at-block block-hash expr)", + "description": "The `at-block` function evaluates the expression `expr` _as if_ it were evaluated at the end of the\nblock indicated by the _block-hash_ argument. The `expr` closure must be read-only.\n\nNote: The block identifying hash must be a hash returned by the `id-header-hash` block information\nproperty. This hash uniquely identifies Stacks blocks and is unique across Stacks forks. While the hash returned by\n`header-hash` is unique within the context of a single fork, it is not unique across Stacks forks.\n\nThe function returns the result of evaluating `expr`.\n", + "example": "\n(define-data-var data int 1)\n(at-block 0x0000000000000000000000000000000000000000000000000000000000000000 block-height) ;; Returns u0\n(at-block (get-block-info? id-header-hash 0) (var-get data)) ;; Throws NoSuchDataVariable because `data` wasn't initialized at block height 0" + }, + { + "name": "get-block-info?", + "input_type": "BlockInfoPropertyName, BlockHeightInt", + "output_type": "(optional buff) | (optional uint)", + "signature": "(get-block-info? prop-name block-height-expr)", + "description": "The `get-block-info?` function fetches data for a block of the given block height. The\nvalue and type returned are determined by the specified `BlockInfoPropertyName`. If the provided `BlockHeightInt` does\nnot correspond to an existing block prior to the current block, the function returns `none`. The currently available property names\nare `time`, `header-hash`, `burnchain-header-hash`, `id-header-hash`, `miner-address`, and `vrf-seed`.\n\nThe `time` property returns an integer value of the block header time field. This is a Unix epoch timestamp in seconds\nwhich roughly corresponds to when the block was mined. **Warning**: this does not increase monotonically with each block\nand block times are accurate only to within two hours. See [BIP113](https://github.com/bitcoin/bips/blob/master/bip-0113.mediawiki) for more information.\n\nThe `header-hash`, `burnchain-header-hash`, `id-header-hash`, and `vrf-seed` properties return a 32-byte buffer.\n\nThe `miner-address` property returns a `principal` corresponding to the miner of the given block.\n\nThe `id-header-hash` is the block identifier value that must be used as input to the `at-block` function.\n", + "example": "(get-block-info? time u0) ;; Returns (some u1557860301)\n(get-block-info? header-hash u0) ;; Returns (some 0x374708fff7719dd5979ec875d56cd2286f6d3cf7ec317a3b25632aab28ec37bb)\n(get-block-info? vrf-seed u0) ;; Returns (some 0xf490de2920c8a35fabeb13208852aa28c76f9be9b03a4dd2b3c075f7a26923b4)\n" + }, + { + "name": "err", + "input_type": "A", + "output_type": "(response A B)", + "signature": "(err value)", + "description": "The `err` function constructs a response type from the input value. Use `err` for\ncreating return values in public functions. An _err_ value indicates that any database changes during\nthe processing of the function should be rolled back.", + "example": "(err true) ;; Returns (err true)" + }, + { + "name": "ok", + "input_type": "A", + "output_type": "(response A B)", + "signature": "(ok value)", + "description": "The `ok` function constructs a response type from the input value. Use `ok` for\ncreating return values in public functions. An _ok_ value indicates that any database changes during\nthe processing of the function should materialize.", + "example": "(ok 1) ;; Returns (ok 1)" + }, + { + "name": "some", + "input_type": "A", + "output_type": "(optional A)", + "signature": "(some value)", + "description": "The `some` function constructs a `optional` type from the input value.", + "example": "(some 1) ;; Returns (some 1)\n(is-none (some 2)) ;; Returns false" + }, + { + "name": "default-to", + "input_type": "A, (optional A)", + "output_type": "A", + "signature": "(default-to default-value option-value)", + "description": "The `default-to` function attempts to 'unpack' the second argument: if the argument is\na `(some ...)` option, it returns the inner value of the option. If the second argument is a `(none)` value,\n`default-to` it returns the value of `default-value`.", + "example": "\n(define-map names-map ((name (buff 12))) ((id int)))\n(map-set names-map { name: \"blockstack\" } { id: 1337 })\n(default-to 0 (get id (map-get? names-map (tuple (name \"blockstack\"))))) ;; Returns 1337\n(default-to 0 (get id (map-get? names-map (tuple (name \"non-existant\"))))) ;; Returns 0\n" + }, + { + "name": "asserts!", + "input_type": "bool, C", + "output_type": "bool", + "signature": "(asserts! bool-expr thrown-value)", + "description": "The `asserts!` function admits a boolean argument and asserts its evaluation:\nif bool-expr is `true`, `asserts!` returns `true` and proceeds in the program execution.\nIf the supplied argument is returning a false value, `asserts!` _returns_ `thrown-value` and exits the current\ncontrol-flow.", + "example": "(asserts! (is-eq 1 1) (err 1)) ;; Returns true" + }, + { + "name": "unwrap!", + "input_type": "(optional A) | (response A B), C", + "output_type": "A", + "signature": "(unwrap! option-input thrown-value)", + "description": "The `unwrap!` function attempts to 'unpack' the first argument: if the argument is\nan option type, and the argument is a `(some ...)` option, `unwrap!` returns the inner value of the\noption. If the argument is a response type, and the argument is an `(ok ...)` response, `unwrap!` returns\n the inner value of the `ok`. If the supplied argument is either an `(err ...)` or a `(none)` value,\n`unwrap!` _returns_ `thrown-value` from the current function and exits the current control-flow.", + "example": "\n(define-map names-map ((name (buff 12))) ((id int)))\n(map-set names-map { name: \"blockstack\" } { id: 1337 })\n(define-private (get-name-or-err (name (buff 12)))\n (let ((raw-name (unwrap! (map-get? names-map { name: name }) (err 1))))\n (ok raw-name)))\n\n(get-name-or-err \"blockstack\") ;; Returns (ok (tuple (id 1337)))\n(get-name-or-err \"non-existant\") ;; Returns (err 1)" + }, + { + "name": "unwrap-err!", + "input_type": "(response A B), C", + "output_type": "B", + "signature": "(unwrap-err! response-input thrown-value)", + "description": "The `unwrap-err!` function attempts to 'unpack' the first argument: if the argument\nis an `(err ...)` response, `unwrap-err!` returns the inner value of the `err`.\nIf the supplied argument is an `(ok ...)` value,\n`unwrap-err!` _returns_ `thrown-value` from the current function and exits the current control-flow.", + "example": "(unwrap-err! (err 1) false) ;; Returns 1" + }, + { + "name": "unwrap-panic", + "input_type": "(optional A) | (response A B)", + "output_type": "A", + "signature": "(unwrap-panic option-input)", + "description": "The `unwrap` function attempts to 'unpack' its argument: if the argument is\nan option type, and the argument is a `(some ...)` option, this function returns the inner value of the\noption. If the argument is a response type, and the argument is an `(ok ...)` response, it returns\n the inner value of the `ok`. If the supplied argument is either an `(err ...)` or a `(none)` value,\n`unwrap` throws a runtime error, aborting any further processing of the current transaction.", + "example": "\n(define-map names-map ((name (buff 12))) ((id int)))\n(map-set names-map { name: \"blockstack\" } { id: 1337 })\n(unwrap-panic (map-get? names-map { name: \"blockstack\" })) ;; Returns (tuple (id 1337))\n(unwrap-panic (map-get? names-map { name: \"non-existant\" })) ;; Throws a runtime exception\n" + }, + { + "name": "unwrap-err-panic", + "input_type": "(response A B)", + "output_type": "B", + "signature": "(unwrap-err-panic response-input)", + "description": "The `unwrap-err` function attempts to 'unpack' the first argument: if the argument\nis an `(err ...)` response, `unwrap` returns the inner value of the `err`.\nIf the supplied argument is an `(ok ...)` value,\n`unwrap-err` throws a runtime error, aborting any further processing of the current transaction.", + "example": "(unwrap-err-panic (err 1)) ;; Returns 1\n(unwrap-err-panic (ok 1)) ;; Throws a runtime exception" + }, + { + "name": "match", + "input_type": "(optional A) name expression expression | (response A B) name expression name expression", + "output_type": "C", + "signature": "(match opt-input some-binding-name some-branch none-branch) |\n(match-resp input ok-binding-name ok-branch err-binding-name err-branch)", + "description": "The `match` function is used to test and destructure optional and response types.\n\nIf the `input` is an optional, it tests whether the provided\n`input` is a `some` or `none` option, and evaluates `some-branch` or\n`none-branch` in each respective case.\n\nWithin the `some-branch`, the _contained value_ of the `input`\nargument is bound to the provided `some-binding-name` name.\n\nOnly _one_ of the branches will be evaluated (similar to `if` statements).\n\nIf the `input` is a response, it tests whether the provided `input` is\nan `ok` or `err` response type, and evaluates `ok-branch` or\n`err-branch` in each respective case.\n\nWithin the `ok-branch`, the _contained ok value_ of the `input`\nargument is bound to the provided `ok-binding-name` name.\n\nWithin the `err-branch`, the _contained err value_ of the `input`\nargument is bound to the provided `err-binding-name` name.\n\nOnly _one_ of the branches will be evaluated (similar to `if` statements).\n\nNote: Type checking requires that the type of both the ok and err parts of the\nresponse object be determinable. For situations in which one of the parts of a response\nis untyped, you should use `unwrap-panic` or `unwrap-err-panic` instead of `match`.", + "example": "\n(define-private (add-10 (x (optional int)))\n (match x\n value (+ 10 value)\n 10))\n(add-10 (some 5)) ;; returns 15\n(add-10 none) ;; returns 10\n\n(define-private (add-or-pass-err (x (response int (buff 10))) (to-add int))\n (match x\n value (+ to-add value)\n err-value (err err-value)))\n(add-or-pass-err (ok 5) 20) ;; returns 25\n(add-or-pass-err (err \"ERROR\") 20) ;; returns (err \"ERROR\")\n" + }, + { + "name": "try!", + "input_type": "(optional A) | (response A B)", + "output_type": "A", + "signature": "(try! option-input)", + "description": "The `try!` function attempts to 'unpack' the first argument: if the argument is\nan option type, and the argument is a `(some ...)` option, `try!` returns the inner value of the\noption. If the argument is a response type, and the argument is an `(ok ...)` response, `try!` returns\n the inner value of the `ok`. If the supplied argument is either an `(err ...)` or a `none` value,\n`try!` _returns_ either `none` or the `(err ...)` value from the current function and exits the current control-flow.", + "example": "\n(define-map names-map ((name (buff 12))) ((id int)))\n(map-set names-map { name: \"blockstack\" } { id: 1337 })\n(try! (map-get? names-map { name: \"blockstack\" })) ;; Returns (tuple (id 1337))\n(define-private (checked-even (x int))\n (if (is-eq (mod x 2) 0)\n (ok x)\n (err false)))\n(define-private (double-if-even (x int))\n (ok (* 2 (try! (checked-even x)))))\n(double-if-even 10) ;; Returns (ok 20)\n(double-if-even 3) ;; Returns (err false)\n" + }, + { + "name": "is-ok", + "input_type": "(response A B)", + "output_type": "bool", + "signature": "(is-ok value)", + "description": "`is-ok` tests a supplied response value, returning `true` if the response was `ok`,\nand `false` if it was an `err`.", + "example": "(is-ok (ok 1)) ;; Returns true\n(is-ok (err 1)) ;; Returns false" + }, + { + "name": "is-none", + "input_type": "(optional A)", + "output_type": "bool", + "signature": "(is-none value)", + "description": "`is-none` tests a supplied option value, returning `true` if the option value is `(none)`,\nand `false` if it is a `(some ...)`.", + "example": "\n(define-map names-map ((name (buff 12))) ((id int)))\n(map-set names-map { name: \"blockstack\" } { id: 1337 })\n(is-none (get id (map-get? names-map { name: \"blockstack\" }))) ;; Returns false\n(is-none (get id (map-get? names-map { name: \"non-existant\" }))) ;; Returns true" + }, + { + "name": "is-err", + "input_type": "(response A B)", + "output_type": "bool", + "signature": "(is-err value)", + "description": "`is-err` tests a supplied response value, returning `true` if the response was an `err`,\nand `false` if it was an `ok`.", + "example": "(is-err (ok 1)) ;; Returns false\n(is-err (err 1)) ;; Returns true" + }, + { + "name": "is-some", + "input_type": "(optional A)", + "output_type": "bool", + "signature": "(is-some value)", + "description": "`is-some` tests a supplied option value, returning `true` if the option value is `(some ...)`,\nand `false` if it is a `none`.", + "example": "\n(define-map names-map ((name (buff 12))) ((id int)))\n(map-set names-map { name: \"blockstack\" } { id: 1337 })\n(is-some (get id (map-get? names-map { name: \"blockstack\" }))) ;; Returns true\n(is-some (get id (map-get? names-map { name: \"non-existant\" }))) ;; Returns false" + }, + { + "name": "filter", + "input_type": "Function(A) -> bool, (list A)", + "output_type": "(list A)", + "signature": "(filter func list)", + "description": "The `filter` function applies the input function `func` to each element of the\ninput list, and returns the same list with any elements removed for which the `func` returned `false`.", + "example": "(filter not (list true false true false)) ;; Returns (false false)" + }, + { + "name": "ft-get-balance", + "input_type": "TokenName, principal", + "output_type": "uint", + "signature": "(ft-get-balance token-name principal)", + "description": "`ft-get-balance` returns `token-name` balance of the principal `principal`.\nThe token type must have been defined using `define-fungible-token`.", + "example": "\n(define-fungible-token stackaroo)\n(ft-mint? stackaroo u100 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR)\n(ft-get-balance stackaroo 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR) ;; returns u100\n" + }, + { + "name": "nft-get-owner?", + "input_type": "AssetName, A", + "output_type": "(optional principal)", + "signature": "(nft-get-owner? asset-class asset-identifier)", + "description": "`nft-get-owner?` returns the owner of an asset, identified by `asset-identifier`, or `none` if the asset does not exist.\nThe asset type must have been defined using `define-non-fungible-token`, and the supplied `asset-identifier` must be of the same type specified in\nthat definition.", + "example": "\n(define-non-fungible-token stackaroo (buff 40))\n(nft-mint? stackaroo \"Roo\" 'SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF)\n(nft-get-owner? stackaroo \"Roo\") ;; Returns (some SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF)\n(nft-get-owner? stackaroo \"Too\") ;; Returns none\n" + }, + { + "name": "ft-transfer?", + "input_type": "TokenName, uint, principal, principal", + "output_type": "(response bool uint)", + "signature": "(ft-transfer? token-name amount sender recipient)", + "description": "`ft-transfer?` is used to increase the token balance for the `recipient` principal for a token\ntype defined using `define-fungible-token` by debiting the `sender` principal.\n\nThis function returns (ok true) if the transfer is successful. In the event of an unsuccessful transfer it returns\none of the following error codes:\n\n`(err u1)` -- `sender` does not have enough balance to transfer\n`(err u2)` -- `sender` and `recipient` are the same principal\n`(err u3)` -- amount to send is non-positive\n", + "example": "\n(define-fungible-token stackaroo)\n(ft-mint? stackaroo u100 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR)\n(ft-transfer? stackaroo u50 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR 'SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF) ;; returns (ok true)\n(ft-transfer? stackaroo u60 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR 'SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF) ;; returns (err u1)\n" + }, + { + "name": "nft-transfer?", + "input_type": "AssetName, A, principal, principal", + "output_type": "(response bool uint)", + "signature": "(nft-transfer? asset-class asset-identifier sender recipient)", + "description": "`nft-transfer?` is used to change the owner of an asset identified by `asset-identifier`\nfrom `sender` to `recipient`. The `asset-class` must have been defined by `define-non-fungible-token` and `asset-identifier`\nmust be of the type specified in that definition.\n\nThis function returns (ok true) if the transfer is successful. In the event of an unsuccessful transfer it returns\none of the following error codes:\n\n`(err u1)` -- `sender` does not own the asset\n`(err u2)` -- `sender` and `recipient` are the same principal\n`(err u3)` -- asset identified by asset-identifier does not exist\n", + "example": "\n(define-non-fungible-token stackaroo (buff 40))\n(nft-mint? stackaroo \"Roo\" 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR)\n(nft-transfer? stackaroo \"Roo\" 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR 'SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF) ;; returns (ok true)\n(nft-transfer? stackaroo \"Roo\" 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR 'SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF) ;; returns (err u1)\n(nft-transfer? stackaroo \"Stacka\" 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR 'SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF) ;; returns (err u3)\n" + }, + { + "name": "nft-mint?", + "input_type": "AssetName, A, principal", + "output_type": "(response bool uint)", + "signature": "(nft-mint? asset-class asset-identifier recipient)", + "description": "`nft-mint?` is used to instantiate an asset and set that asset's owner to the `recipient` principal.\nThe asset must have been defined using `define-non-fungible-token`, and the supplied `asset-identifier` must be of the same type specified in\nthat definition.\n\nIf an asset identified by `asset-identifier` _already exists_, this function will return an error with the following error code:\n\n`(err u1)`\n\nOtherwise, on successfuly mint, it returns `(ok true)`.\n", + "example": "\n(define-non-fungible-token stackaroo (buff 40))\n(nft-mint? stackaroo \"Roo\" 'SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF) ;; returns (ok true)\n" + }, + { + "name": "ft-mint?", + "input_type": "TokenName, uint, principal", + "output_type": "(response bool uint)", + "signature": "(ft-mint? token-name amount recipient)", + "description": "`ft-mint?` is used to increase the token balance for the `recipient` principal for a token\ntype defined using `define-fungible-token`. The increased token balance is _not_ transfered from another principal, but\nrather minted.\n\nIf a non-positive amount is provided to mint, this function returns `(err 1)`. Otherwise, on successfuly mint, it\nreturns `(ok true)`.\n", + "example": "\n(define-fungible-token stackaroo)\n(ft-mint? stackaroo u100 'SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF) ;; returns (ok true)\n" + }, + { + "name": "stx-get-balance", + "input_type": "principal", + "output_type": "uint", + "signature": "(stx-get-balance owner)", + "description": "`stx-get-balance` is used to query the STX balance of the `owner` principal.\n\nThis function returns the STX balance of the `owner` principal. In the event that the `owner`\nprincipal isn't materialized, it returns 0.\n", + "example": "\n(stx-get-balance 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR) ;; returns u0\n(stx-get-balance (as-contract tx-sender)) ;; returns u10000\n" + }, + { + "name": "stx-transfer?", + "input_type": "uint, principal, principal", + "output_type": "(response bool uint)", + "signature": "(stx-transfer? amount sender recipient)", + "description": "`stx-transfer?` is used to increase the STX balance for the `recipient` principal\nby debiting the `sender` principal. The `sender` principal _must_ be equal to the current context's `tx-sender`.\n\nThis function returns (ok true) if the transfer is successful. In the event of an unsuccessful transfer it returns\none of the following error codes:\n\n`(err u1)` -- `sender` does not have enough balance to transfer\n`(err u2)` -- `sender` and `recipient` are the same principal\n`(err u3)` -- amount to send is non-positive\n`(err u4)` -- the `sender` principal is not the current `tx-sender`\n", + "example": "\n(as-contract\n (stx-transfer? u60 tx-sender 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR)) ;; returns (ok true)\n(as-contract\n (stx-transfer? u50 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR tx-sender)) ;; returns (err u4)\n" + }, + { + "name": "stx-burn?", + "input_type": "uint, principal", + "output_type": "(response bool uint)", + "signature": "(stx-burn? amount sender)", + "description": "`stx-burn?` debits the `sender` principal's STX holdings by `amount`, destroying\nthe STX. The `sender` principal _must_ be equal to the current context's `tx-sender`.\n\nThis function returns (ok true) if the transfer is successful. In the event of an unsuccessful transfer it returns\none of the following error codes:\n\n`(err u1)` -- `sender` does not have enough balance to transfer\n`(err u3)` -- amount to send is non-positive\n`(err u4)` -- the `sender` principal is not the current `tx-sender`\n", + "example": "\n(as-contract\n (stx-burn? u60 tx-sender)) ;; returns (ok true)\n(as-contract\n (stx-burn? u50 'SZ2J6ZY48GV1EZ5V2V5RB9MP66SW86PYKKQ9H6DPR)) ;; returns (err u4)\n" + }, + { + "name": "define-constant", + "input_type": "MethodSignature, MethodBody", + "output_type": "Not Applicable", + "signature": "(define-constant name expression)", + "description": "`define-constant` is used to define a private constant value in a smart contract.\nThe expression passed into the definition is evaluated at contract launch, in the order that it is\nsupplied in the contract. This can lead to undefined function or undefined variable errors in the\nevent that a function or variable used in the expression has not been defined before the constant.\n\nLike other kinds of definition statements, `define-constant` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put a define statement in the middle of a function body).\n", + "example": "\n(define-constant four (+ 2 2))\n(+ 4 four) ;; returns 8\n" + }, + { + "name": "define-private", + "input_type": "MethodSignature, MethodBody", + "output_type": "Not Applicable", + "signature": "(define-private (function-name (arg-name-0 arg-type-0) (arg-name-1 arg-type-1) ...) function-body)", + "description": "`define-private` is used to define _private_ functions for a smart contract. Private\nfunctions may not be called from other smart contracts, nor may they be invoked directly by users.\nInstead, these functions may only be invoked by other functions defined in the same smart contract.\n\nLike other kinds of definition statements, `define-private` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put a define statement in the middle of a function body).\n\nPrivate functions may return any type.", + "example": "\n(define-private (max-of (i1 int) (i2 int))\n (if (> i1 i2)\n i1\n i2))\n(max-of 4 6) ;; returns 6\n" + }, + { + "name": "define-public", + "input_type": "MethodSignature, MethodBody", + "output_type": "Not Applicable", + "signature": "(define-public (function-name (arg-name-0 arg-type-0) (arg-name-1 arg-type-1) ...) function-body)", + "description": "`define-public` is used to define a _public_ function and transaction for a smart contract. Public\nfunctions are callable from other smart contracts and may be invoked directly by users by submitting a transaction\nto the Stacks blockchain.\n\nLike other kinds of definition statements, `define-public` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put a define statement in the middle of a function body).\n\nPublic functions _must_ return a ResponseType (using either `ok` or `err`). Any datamap modifications performed by\na public function is aborted if the function returns an `err` type. Public functions may be invoked by other\ncontracts via `contract-call?`.", + "example": "\n(define-public (hello-world (input int))\n (begin (print (+ 2 input))\n (ok input)))\n" + }, + { + "name": "define-read-only", + "input_type": "MethodSignature, MethodBody", + "output_type": "Not Applicable", + "signature": "(define-read-only (function-name (arg-name-0 arg-type-0) (arg-name-1 arg-type-1) ...) function-body)", + "description": "`define-read-only` is used to define a _public read-only_ function for a smart contract. Such\nfunctions are callable from other smart contracts.\n\nLike other kinds of definition statements, `define-read-only` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put a define statement in the middle of a function body).\n\nRead-only functions may return any type. However, read-only functions\nmay not perform any datamap modifications, or call any functions which\nperform such modifications. This is enforced both during type checks and during\nthe execution of the function. Public read-only functions may\nbe invoked by other contracts via `contract-call?`.", + "example": "\n(define-read-only (just-return-one-hundred)\n (* 10 10))" + }, + { + "name": "define-map", + "input_type": "MapName, KeyTupleDefinition, MapTupleDefinition", + "output_type": "Not Applicable", + "signature": "(define-map map-name ((key-name-0 key-type-0) ...) ((val-name-0 val-type-0) ...))", + "description": "`define-map` is used to define a new datamap for use in a smart contract. Such\nmaps are only modifiable by the current smart contract.\n\nMaps are defined with a key tuple type and value tuple type. These are defined using a list\nof name and type pairs, e.g., a key type might be `((id int))`, which is a tuple with a single \"id\"\nfield of type `int`.\n\nLike other kinds of definition statements, `define-map` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put a define statement in the middle of a function body).", + "example": "\n(define-map squares ((x int)) ((square int)))\n(define-private (add-entry (x int))\n (map-insert squares ((x 2)) ((square (* x x)))))\n(add-entry 1)\n(add-entry 2)\n(add-entry 3)\n(add-entry 4)\n(add-entry 5)\n" + }, + { + "name": "define-data-var", + "input_type": "VarName, TypeDefinition, Value", + "output_type": "Not Applicable", + "signature": "(define-data-var var-name type value)", + "description": "`define-data-var` is used to define a new persisted variable for use in a smart contract. Such\nvariable are only modifiable by the current smart contract.\n\nPersisted variable are defined with a type and a value.\n\nLike other kinds of definition statements, `define-data-var` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put a define statement in the middle of a function body).", + "example": "\n(define-data-var size int 0)\n(define-private (set-size (value int))\n (var-set size value))\n(set-size 1)\n(set-size 2)\n" + }, + { + "name": "define-fungible-token", + "input_type": "TokenName, ", + "output_type": "Not Applicable", + "signature": "(define-fungible-token token-name )", + "description": "`define-fungible-token` is used to define a new fungible token class for use in the current contract.\n\nThe second argument, if supplied, defines the total supply of the fungible token. This ensures that all calls to the `ft-mint?`\nfunction will never be able to create more than `total-supply` tokens. If any such call were to increase the total supply\nof tokens passed that amount, that invocation of `ft-mint?` will result in a runtime error and abort.\n\nLike other kinds of definition statements, `define-fungible-token` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put a define statement in the middle of a function body).\n\nTokens defined using `define-fungible-token` may be used in `ft-transfer?`, `ft-mint?`, and `ft-get-balance` functions", + "example": "\n(define-fungible-token stacks)\n(define-fungible-token limited-supply-stacks u100)\n" + }, + { + "name": "define-non-fungible-token", + "input_type": "AssetName, TypeSignature", + "output_type": "Not Applicable", + "signature": "(define-non-fungible-token asset-name asset-identifier-type)", + "description": "`define-non-fungible-token` is used to define a new non-fungible token class for use in the current contract.\nIndividual assets are identified by their asset identifier, which must be of the type `asset-identifier-type`. Asset\nidentifiers are _unique_ identifiers.\n\nLike other kinds of definition statements, `define-non-fungible-token` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put a define statement in the middle of a function body).\n\nAssets defined using `define-non-fungible-token` may be used in `nft-transfer?`, `nft-mint?`, and `nft-get-owner?` functions", + "example": "\n(define-non-fungible-token names (buff 50))\n" + }, + { + "name": "define-trait", + "input_type": "VarName, [MethodSignature]", + "output_type": "Not Applicable", + "signature": "(define-trait trait-name ((func1-name (arg1-type arg2-type ...) (return-type))))", + "description": "`define-trait` is used to define a new trait definition for use in a smart contract. Other contracts\ncan implement a given trait and then have their contract identifier being passed as function arguments in order to be called\ndynamically with `contract-call?`.\n\nTraits are defined with a name, and a list functions defined with a name, a list of argument types, and return type.\n\nLike other kinds of definition statements, `define-trait` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put a define statement in the middle of a function body).\n", + "example": "\n(define-trait token-trait\n ((transfer? (principal principal uint) (response uint uint))\n (get-balance (principal) (response uint uint))))\n" + }, + { + "name": "use-trait", + "input_type": "VarName, TraitIdentifier", + "output_type": "Not Applicable", + "signature": "(use-trait trait-alias trait-identifier)", + "description": "`use-trait` is used to bring a trait, defined in another contract, to the current contract. Subsequent\nreferences to an imported trait are signaled with the syntax ``.\n\nTraits import are defined with a name, used as an alias, and a trait identifier. Trait identifiers can either be\nusing the sugared syntax (.token-a.token-trait), or be fully qualified ('SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF.token-a.token-trait).\n\nLike other kinds of definition statements, `use-trait` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put such a statement in the middle of a function body).\n ", + "example": "\n(use-trait token-a-trait 'SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF.token-a.token-trait)\n(define-public (forward-get-balance (user principal) (contract ))\n (begin\n (ok 1)))\n" + }, + { + "name": "impl-trait", + "input_type": "TraitIdentifier", + "output_type": "Not Applicable", + "signature": "(impl-trait trait-identifier)", + "description": "`impl-trait` can be use for asserting that a contract is fully implementing a given trait.\nAdditional checks are being performed when the contract is being published, rejecting the deployment if the\ncontract is violating the trait specification.\n\nTrait identifiers can either be using the sugared syntax (.token-a.token-trait), or be fully qualified\n('SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF.token-a.token-trait).\n\nLike other kinds of definition statements, `impl-trait` may only be used at the top level of a smart contract\ndefinition (i.e., you cannot put such a statement in the middle of a function body).\n", + "example": "\n(impl-trait 'SPAXYA5XS51713FDTQ8H94EJ4V579CXMTRNBZKSF.token-a.token-trait)\n" + } + ], + "keywords": [ + { + "name": "contract-caller", + "output_type": "principal", + "description": "Returns the caller of the current contract context. If this contract is the first one called by a signed transaction,\nthe caller will be equal to the signing principal. If `contract-call?` was used to invoke a function from a new contract, `contract-caller`\nchanges to the _calling_ contract's principal. If `as-contract` is used to change the `tx-sender` context, `contract-caller` _also_ changes\nto the same contract principal.", + "example": "(print contract-caller) ;; Will print out a Stacks address of the transaction sender" + }, + { + "name": "tx-sender", + "output_type": "principal", + "description": "Returns the original sender of the current transaction, or if `as-contract` was called to modify the sending context, it returns that\ncontract principal.", + "example": "(print tx-sender) ;; Will print out a Stacks address of the transaction sender" + }, + { + "name": "block-height", + "output_type": "uint", + "description": "Returns the current block height of the Stacks blockchain as an int", + "example": "(> block-height 1000) ;; returns true if the current block-height has passed 1000 blocks." + }, + { + "name": "none", + "output_type": "(optional ?)", + "description": "Represents the _none_ option indicating no value for a given optional (analogous to a null value).", + "example": "\n(define-public (only-if-positive (a int))\n (if (> a 0)\n (some a)\n none))\n(only-if-positive 4) ;; Returns (some 4)\n(only-if-positive (- 3)) ;; Returns none\n" + }, + { + "name": "true", + "output_type": "bool", + "description": "Boolean true constant.", + "example": "\n(and true false) ;; Evaluates to false\n(or false true) ;; Evaluates to true\n" + }, + { + "name": "false", + "output_type": "bool", + "description": "Boolean false constant.", + "example": "\n(and true false) ;; Evaluates to false\n(or false true) ;; Evaluates to true\n" + } + ] +} diff --git a/src/common/mdx.ts b/src/common/mdx.ts index 58818952..f51a8ea2 100644 --- a/src/common/mdx.ts +++ b/src/common/mdx.ts @@ -1,17 +1,44 @@ -export const remarkPlugins = (defaultLang: string) => [ - [ - require('../lib/remark-shiki'), - { theme: 'Material-Theme-Default', defaultLang: defaultLang }, - ], - require('remark-slug'), -]; +import { MDXComponents } from '@components/mdx/mdx-components'; +import { cliReferenceData } from '@common/_data/cliRef'; +import renderToString from 'next-mdx-remote/render-to-string'; +import CLARITY_REFERENCE from '@common/_data/clarityRef.json'; -const replaceTicks = value => { - const _value = value.trim(); - if (_value.startsWith('`') && !_value.endsWith('`')) { - return _value.replace('`', ''); - } - return _value; +export const wrapValueInTicks = value => '`' + value.replace('`', '').replace('`', '') + '`'; + +export const convertRemoteDataToMDX = async (arr: any[], key: string) => + Promise.all(arr.map(entry => renderToString(entry[key], MDXComponents))); + +export const convertBlockstackCLIUsageToMdx = async () => { + const results = await convertRemoteDataToMDX(cliReferenceData, 'usage'); + return { + props: { + mdx: results, + }, + }; }; -export const wrapValueInTicks = value => '`' + value.replace('`', '').replace('`', '') + '`'; +export const convertClarityRefUsageToMdx = async () => { + const [_functions, _keywords] = await Promise.all([ + convertRemoteDataToMDX(CLARITY_REFERENCE.functions, 'description'), + convertRemoteDataToMDX(CLARITY_REFERENCE.keywords, 'description'), + ]); + + const functions = CLARITY_REFERENCE.functions.map((fn, index) => ({ + ...fn, + description: _functions[index], + })); + + const keywords = CLARITY_REFERENCE.keywords.map((fn, index) => ({ + ...fn, + description: _keywords[index], + })); + + return { + props: { + mdx: { + functions, + keywords, + }, + }, + }; +}; diff --git a/src/common/routes/get-routes.js b/src/common/routes/get-routes.js index b8083b54..cbc2e2f5 100644 --- a/src/common/routes/get-routes.js +++ b/src/common/routes/get-routes.js @@ -139,6 +139,7 @@ const getHeadings = mdContent => { const routes = sections.map(section => { const _routes = section.routes.map(route => { try { + const extension = /\.(mdx?)$/; const fileContent = fs.readFileSync(path.join('./src/pages/', route.path + '.md'), 'utf8'); const data = fm(fileContent); const headings = getHeadings(data.body); diff --git a/src/common/shiki-clarity.ts b/src/common/shiki-clarity.ts deleted file mode 100644 index 80c17e74..00000000 --- a/src/common/shiki-clarity.ts +++ /dev/null @@ -1,41 +0,0 @@ -import clarityRefData from '@common/_data/clarityRef.json'; -import { getHighlighter, getTheme } from 'shiki'; -import { SHIKI_THEME } from '@common/constants'; - -export const renderClarityRefCodeWithShiki = async () => { - const { functions: _fns, keywords: _keywords, ...rest } = clarityRefData; - - const theme = getTheme(SHIKI_THEME); - const highlighter = await getHighlighter({ - theme, - }); - - const functions = _fns.map(entry => ({ - ...entry, - example: highlighter.codeToHtml(entry.example.trim(), 'clarity'), - })); - - const keywords = _keywords.map(entry => ({ - ...entry, - example: highlighter.codeToHtml(entry.example.trim(), 'clarity'), - })); - - return { - props: { - reference: { - ...rest, - functions, - keywords, - }, - }, - }; -}; - -export const getStaticProps = async context => { - const ref = await renderClarityRefCodeWithShiki(); - return { - props: { - ref, - }, - }; -}; diff --git a/src/components/clarity-ref.tsx b/src/components/clarity-ref.tsx index 7b88a786..e84cc5ce 100644 --- a/src/components/clarity-ref.tsx +++ b/src/components/clarity-ref.tsx @@ -1,76 +1,83 @@ import React from 'react'; import { MDXComponents } from '@components/mdx/mdx-components'; -import renderToString from 'next-mdx-remote/render-to-string'; +import { Box } from '@blockstack/ui'; +import { TableOfContents } from '@components/toc'; import hydrate from 'next-mdx-remote/hydrate'; -import { remarkPlugins, wrapValueInTicks } from '@common/mdx'; -import clarityRefData from '@common/_data/clarityRef.json'; -const wrapInClarityCodes = value => '```clarity' + `\n` + value.trim() + `\n` + '```'; +const renderFunctionsSection = entry => ( + <> + {entry.name} -const convertKeywordsToMdx = entry => { - return ` - ### ${entry.name} - - ${wrapValueInTicks(entry.output_type)} - - ${entry.description} - - #### Example - - ${wrapInClarityCodes(entry.example)} + + Signature:{' '} + {entry.signature} + - `; -}; + + Input:{' '} + {entry.input_type} + -const convertFunctionsToMdx = entry => { - return ` - ### ${entry.name} - - ${wrapInClarityCodes(entry.signature)} - - **Input:** ${wrapValueInTicks(entry.input_type)} - - **Output:** ${wrapValueInTicks(entry.output_type)} - - ${entry.description} - - #### Example - - ${wrapInClarityCodes(entry.example)} + + Output:{' '} + {entry.output_type} + - `; -}; + {hydrate(entry.description, MDXComponents)} -const makeMdxDocument = (data, converter) => { - let mdx = ``; - data.forEach(entry => { - mdx += converter(entry); - }); - return mdx; -}; + Example + + {/* @ts-ignore */} + {entry.example} + +); -// getStaticProps -export async function convertClarityRefToMdx() { - const functionsMdx = makeMdxDocument(clarityRefData.functions, convertFunctionsToMdx); - const keywordsMdx = makeMdxDocument(clarityRefData.keywords, convertKeywordsToMdx); +const renderKeywordsSection = entry => ( + <> + {entry.name} - const functions = await renderToString(functionsMdx, MDXComponents, { - remarkPlugins: remarkPlugins('clarity'), - }); - const keywords = await renderToString(keywordsMdx, MDXComponents, { - remarkPlugins: remarkPlugins('clarity'), - }); - return { - props: { - reference: { - functions, - keywords, - }, - }, - }; -} + + Output:{' '} + {entry.output_type} + -export const ClarityKeywordReference = ({ reference }) => - hydrate(reference.keywords, MDXComponents); -export const ClarityFunctionReference = ({ reference }) => - hydrate(reference.functions, MDXComponents); + {hydrate(entry.description, MDXComponents)} + + Example + + {/* @ts-ignore */} + {entry.example} + +); + +export const ClarityKeywordReference = ({ entries }) => { + return ( + <> + + ({ + content: entry.name, + level: 1, + }))} + /> + + {entries.map(renderKeywordsSection)} + + ); +}; +export const ClarityFunctionReference = ({ entries }) => ( + <> + + ({ + content: entry.name, + level: 1, + }))} + /> + + {entries.map(renderFunctionsSection)} + +); diff --git a/src/components/cli-reference.tsx b/src/components/cli-reference.tsx index 20880f37..1332e934 100644 --- a/src/components/cli-reference.tsx +++ b/src/components/cli-reference.tsx @@ -1,66 +1,76 @@ import React from 'react'; import { cliReferenceData } from '@common/_data/cliRef'; import { MDXComponents } from '@components/mdx/mdx-components'; -import renderToString from 'next-mdx-remote/render-to-string'; +import { Grid, Box } from '@blockstack/ui'; +import { border } from '@common/utils'; import hydrate from 'next-mdx-remote/hydrate'; -import { remarkPlugins, wrapValueInTicks } from '@common/mdx'; -const wrapInCode = value => value && '' + value + ''; - -const makeMdxTableRow = ({ name: _name, type: _type, value: _value, format: _format }) => { - const name = wrapValueInTicks(_name); - const type = wrapValueInTicks(_type); - const value = wrapValueInTicks(_value); - const format = wrapValueInTicks(_format); - - return ` - ##### Name - ${wrapValueInTicks(name)} - - ##### Type - ${wrapValueInTicks(type)} - - ##### Value - ${wrapValueInTicks(value)} - - ##### Format - ${wrapValueInTicks(format)} - `; - // eslint-disable-next-line @typescript-eslint/restrict-plus-operands - // return ' | ' + name + ' | ' + type + ' | ' + value + ' | ' + wrapValueInTicks(format) + '` |'; +const styles = { + maxWidth: '100%', + overflowX: 'auto', + overflowY: 'hidden', + whiteSpace: 'pre', }; +const InlineCode = props => ; -const convertEntryToMarkdown = entry => { - return ` - ## ${entry.command} - - **Group:**: ${entry.group} - - ${entry.usage} +const ReferenceEntry = ({ entry, usage }) => ( + <> + {entry.command} - ### Arguments - - | Name | Type | Value | Format | - | ------------ | ----------- | ------- | ------- | - - ${entry.args.map(makeMdxTableRow)} - `; -}; - -const makeMdxDocument = data => { - let mdx = ``; - data.forEach(entry => { - mdx += convertEntryToMarkdown(entry); - }); - return mdx; -}; + + Group: {entry.group} + -export async function convertCliRefToMdx() { - const mdx = makeMdxDocument(cliReferenceData); - const reference = await renderToString(mdx, MDXComponents, { - remarkPlugins: remarkPlugins('bash'), - }); - return { props: { reference } }; -} + {hydrate(usage, MDXComponents)} + Arguments + + + Name + + + Type + + + Value + + + Format + + + {entry.args.map((arg, index) => { + const { name, type, value, format } = arg; + return ( + + + ${name} + + + ${type} + + + ${value} + + + ${format} + + + ); + })} + +); -export const CLIReferenceTable = ({ reference }) => hydrate(reference, MDXComponents); +export const CLIReferenceTable = ({ mdx }) => + cliReferenceData.map((entry, index) => ); diff --git a/src/components/code-block/index.tsx b/src/components/code-block/index.tsx index 17db0824..7add95b4 100644 --- a/src/components/code-block/index.tsx +++ b/src/components/code-block/index.tsx @@ -1,13 +1,4 @@ import React from 'react'; -import 'prismjs/components/prism-bash'; -import 'prismjs/components/prism-css'; -import 'prismjs/components/prism-jsx'; -import 'prismjs/components/prism-tsx'; -import 'prismjs/components/prism-json'; -import 'prismjs/components/prism-toml'; -import 'prismjs/components/prism-python'; -import 'prismjs/components/prism-kotlin'; - import { SimpleCodeBlock } from '@components/code-block/components'; import { useForceUpdate } from '@blockstack/ui'; diff --git a/src/components/feedback.tsx b/src/components/feedback.tsx index 1183ddf8..7fa1b953 100644 --- a/src/components/feedback.tsx +++ b/src/components/feedback.tsx @@ -16,7 +16,7 @@ const Icon: React.FC }> = ({ icon: IconComponen export const FeedbackSection: React.FC = props => { return ( - + Was this page helpful? diff --git a/src/components/header.tsx b/src/components/header.tsx index b9d4aeb4..358d5eb0 100644 --- a/src/components/header.tsx +++ b/src/components/header.tsx @@ -121,16 +121,6 @@ const Header = ({ ...rest }: any) => { - - Branding Assets - diff --git a/src/components/layouts/default-layout.tsx b/src/components/layouts/default-layout.tsx index d7341e00..d6d35d9c 100644 --- a/src/components/layouts/default-layout.tsx +++ b/src/components/layouts/default-layout.tsx @@ -1,7 +1,7 @@ import React from 'react'; import { Contents } from '@components/layouts/docs-layout'; import Head from 'next/head'; -export const Layout = ({ meta, ...props }) => { +export const Layout = ({ meta, dynamicHeadings = [], ...props }) => { const { title, description = 'The Blockstack design system, built with React and styled-system.', @@ -13,7 +13,7 @@ export const Layout = ({ meta, ...props }) => { {title || (headings?.length && headings[0].content)} | Blockstack Docs - {props.children} + {props.children} ); }; diff --git a/src/components/layouts/docs-layout.tsx b/src/components/layouts/docs-layout.tsx index 735023f3..d1bbb69f 100644 --- a/src/components/layouts/docs-layout.tsx +++ b/src/components/layouts/docs-layout.tsx @@ -69,32 +69,61 @@ const styleOverwrites = { pl: '64px ', }, p: { - '& + p': { + display: 'inline-block', + fontSize: '16.5px', + lineHeight: '28px', + ':before': { + content: "''", + marginTop: '-0.4878787878787879em', + display: 'block', + height: 0, + }, + ':after': { + content: "''", + marginBottom: '-0.4878787878787879em', + display: 'block', + height: 0, + }, + }, + li: { + pb: 0, + ':last-child': { + mb: 0, + pb: 0, + }, + '*:last-child': { + mb: 0, + }, + pre: { + display: 'block', + my: space('extra-loose'), + }, + p: { + display: 'inline', + }, + 'ol, ul': { + mt: space('base-loose'), + }, + ':before': { + verticalAlign: 'top', + }, + ':marker': { + verticalAlign: 'top', + }, + mb: space('base'), + 'p + p': { mt: space('extra-loose'), }, - '&, ol, ul': { - '& code': { - fontSize: '14px', - }, - '&, & > *': { - display: 'inline-block', - fontSize: '16.5px', - lineHeight: '28px', - ':before': { - content: "''", - marginTop: '-0.4878787878787879em', - display: 'block', - height: 0, - }, - ':after': { - content: "''", - marginBottom: '-0.4878787878787879em', - display: 'block', - height: 0, - }, - }, + 'p + p, ul + p, ol + p': { + display: 'inline-block', + mt: space('extra-loose'), }, }, + 'p + p, ul + p, ol + p': { + display: 'inline-block', + mt: space('extra-loose'), + }, + '& > *:not(pre) a > code': { color: color('accent'), '&:hover': { @@ -102,35 +131,10 @@ const styleOverwrites = { }, }, pre: { - '&.shiki': { - bg: '#0f1117 !important', - overflow: 'auto', - py: space('base-loose'), - px: space('extra-loose'), - borderRadius: ['unset', 'unset', '12px', '12px'], - code: { - fontSize: '14.556040756914118px', - lineHeight: '24px', - padding: '0.05px 0', - ':before': { - content: "''", - marginTop: '-0.47483499999999995em', - display: 'block', - height: 0, - }, - ':after': { - content: "''", - marginBottom: '-0.493835em', - display: 'block', - height: 0, - }, - whiteSpace: 'pre', - }, - }, '& + h2, & + h3': { mt: space('extra-loose'), }, - '& + h4, & + h5, & + h6': { + '& + h4, & + h5, & + h6, & + blockquote, & + ul, & + ol': { mt: 0, }, }, @@ -201,8 +205,10 @@ const styleOverwrites = { }, }, 'ol, ul': { - '& + blockquote': { - mt: space('extra-tight'), + mb: 0, + mt: space('extra-loose'), + '& + blockquote, & + pre': { + // mt: space('extra-tight'), }, }, blockquote: { @@ -235,10 +241,6 @@ const styleOverwrites = { boxShadow: 'none', my: space('extra-loose'), }, - 'li pre': { - display: 'block', - my: space('base'), - }, }; export const Contents = ({ headings, children }) => ( @@ -256,7 +258,15 @@ export const Contents = ({ headings, children }) => ( > {children} - {headings?.length && headings.length > 1 ? : null} + {headings?.length && headings.length > 1 ? ( + + ) : null} ); @@ -295,7 +305,7 @@ const DocsLayout: React.FC<{ isHome?: boolean }> = ({ children, isHome }) => { {children} - {!isErrorPage &&