Browse Source

fix: format content, fix code types

fix/enable-imgix
Thomas Osmonson 4 years ago
parent
commit
ce4fb6717c
  1. 6
      babel.config.js
  2. 32
      lib/babel-plugin-nextjs-mdx-patch.js
  3. 455
      lib/shiki-languages/data/extraGrammars/TOML.tmLanguage
  4. 249
      lib/shiki-languages/data/extraGrammars/clarity.tmLanguage.json
  5. 667
      lib/shiki-languages/data/extraGrammars/graphql.json
  6. 590
      lib/shiki-languages/data/extraGrammars/haml.json
  7. 1067
      lib/shiki-languages/data/extraGrammars/kotlin.tmLanguage
  8. 2287
      lib/shiki-languages/data/extraGrammars/latex.plist
  9. 1265
      lib/shiki-languages/data/extraGrammars/nginx.tmLanguage
  10. 1648
      lib/shiki-languages/data/extraGrammars/postcss.json
  11. 750
      lib/shiki-languages/data/extraGrammars/sass.tmLanguage
  12. 1199
      lib/shiki-languages/data/extraGrammars/stylus.json
  13. 563
      lib/shiki-languages/data/extraGrammars/vue-html.json
  14. 1093
      lib/shiki-languages/data/extraGrammars/vue.json
  15. 372
      lib/shiki-languages/data/grammars/ASPVBnet.plist
  16. 169
      lib/shiki-languages/data/grammars/Batch File.tmLanguage
  17. 440
      lib/shiki-languages/data/grammars/Clojure.tmLanguage
  18. 143
      lib/shiki-languages/data/grammars/Dockerfile.tmLanguage
  19. 2145
      lib/shiki-languages/data/grammars/Groovy.tmLanguage
  20. 854
      lib/shiki-languages/data/grammars/Handlebars.json
  21. 387
      lib/shiki-languages/data/grammars/JSON.tmLanguage
  22. 213
      lib/shiki-languages/data/grammars/JSONC.tmLanguage.json
  23. 964
      lib/shiki-languages/data/grammars/Jade.json
  24. 3575
      lib/shiki-languages/data/grammars/JavaScript.tmLanguage.json
  25. 3438
      lib/shiki-languages/data/grammars/MagicPython.tmLanguage.json
  26. 435
      lib/shiki-languages/data/grammars/MagicRegExp.tmLanguage.json
  27. 475
      lib/shiki-languages/data/grammars/Makefile.json
  28. 1432
      lib/shiki-languages/data/grammars/Objective-C.tmLanguage
  29. 490
      lib/shiki-languages/data/grammars/Perl 6.tmLanguage
  30. 3707
      lib/shiki-languages/data/grammars/Perl.plist
  31. 237
      lib/shiki-languages/data/grammars/Platform.tmLanguage
  32. 1186
      lib/shiki-languages/data/grammars/PowershellSyntax.tmLanguage
  33. 316
      lib/shiki-languages/data/grammars/R.plist
  34. 237
      lib/shiki-languages/data/grammars/Regular Expressions (JavaScript).tmLanguage
  35. 4092
      lib/shiki-languages/data/grammars/Ruby.plist
  36. 767
      lib/shiki-languages/data/grammars/SQL.plist
  37. 1231
      lib/shiki-languages/data/grammars/Shell-Unix-Bash.tmLanguage.json
  38. 3303
      lib/shiki-languages/data/grammars/TypeScript.tmLanguage.json
  39. 3574
      lib/shiki-languages/data/grammars/TypeScriptReact.tmLanguage.json
  40. 455
      lib/shiki-languages/data/grammars/c++.json
  41. 980
      lib/shiki-languages/data/grammars/c.json
  42. 668
      lib/shiki-languages/data/grammars/coffeescript.json
  43. 4333
      lib/shiki-languages/data/grammars/csharp.tmLanguage.json
  44. 153
      lib/shiki-languages/data/grammars/cshtml.json
  45. 1184
      lib/shiki-languages/data/grammars/css.plist
  46. 268
      lib/shiki-languages/data/grammars/diff.tmLanguage
  47. 533
      lib/shiki-languages/data/grammars/fsharp.json
  48. 221
      lib/shiki-languages/data/grammars/git-commit.tmLanguage
  49. 57
      lib/shiki-languages/data/grammars/git-rebase.tmLanguage
  50. 611
      lib/shiki-languages/data/grammars/go.json
  51. 553
      lib/shiki-languages/data/grammars/html.json
  52. 1030
      lib/shiki-languages/data/grammars/java.json
  53. 619
      lib/shiki-languages/data/grammars/less.tmLanguage.json
  54. 192
      lib/shiki-languages/data/grammars/lua.json
  55. 1889
      lib/shiki-languages/data/grammars/markdown.tmLanguage
  56. 2638
      lib/shiki-languages/data/grammars/php.json
  57. 181
      lib/shiki-languages/data/grammars/properties.plist
  58. 595
      lib/shiki-languages/data/grammars/rust.json
  59. 1672
      lib/shiki-languages/data/grammars/scss.json
  60. 133
      lib/shiki-languages/data/grammars/shaderlab.json
  61. 257
      lib/shiki-languages/data/grammars/swift.json
  62. 426
      lib/shiki-languages/data/grammars/xml.json
  63. 93
      lib/shiki-languages/data/grammars/xsl.json
  64. 629
      lib/shiki-languages/data/grammars/yaml.json
  65. 2
      lib/shiki-languages/dist/index.d.ts
  66. 6
      lib/shiki-languages/dist/index.js
  67. 14
      lib/shiki-languages/dist/lang.d.ts
  68. 480
      lib/shiki-languages/dist/lang.js
  69. 12
      lib/shiki-languages/dist/types.d.ts
  70. 2
      lib/shiki-languages/dist/types.js
  71. 22
      lib/shiki-languages/package.json
  72. 35
      next.config.js
  73. 10
      package.json
  74. 2
      src/common/_data/clarityRef.json
  75. 2
      src/common/constants.ts
  76. 2
      src/common/hooks/use-active-heading.tsx
  77. 17
      src/common/mdx.ts
  78. 41
      src/common/shiki-clarity.ts
  79. 120
      src/components/clarity-ref.tsx
  80. 99
      src/components/cli-reference.tsx
  81. 2
      src/components/content-wrapper.tsx
  82. 82
      src/components/home/code-examples.tsx
  83. 21
      src/components/layouts/default-layout.tsx
  84. 28
      src/components/layouts/docs-layout.tsx
  85. 35
      src/components/mdx/mdx-components.tsx
  86. 20
      src/lib/md-loader.js
  87. 37
      src/lib/remark-shiki.js
  88. 2
      src/pages/core/atlas/howitworks.md
  89. 6
      src/pages/core/atlas/howtouse.md
  90. 7
      src/pages/core/cmdLineRef.md
  91. 4
      src/pages/core/naming/did.md
  92. 10
      src/pages/core/smart/clarityRef.md
  93. 6
      src/pages/core/smart/tutorial-counter.md
  94. 96
      src/pages/develop/radiks-setup.md
  95. 607
      yarn.lock

6
babel.config.js

@ -1,4 +1,8 @@
module.exports = {
presets: ['next/babel'],
plugins: ['babel-plugin-macros', ['styled-components', { ssr: true }]],
plugins: [
'./lib/babel-plugin-nextjs-mdx-patch',
'babel-plugin-macros',
['styled-components', { ssr: true }],
],
};

32
lib/babel-plugin-nextjs-mdx-patch.js

@ -0,0 +1,32 @@
/**
* Currently it's not possible to export data fetching functions from MDX pages
* because MDX includes them in `layoutProps`, and Next.js removes them at some
* point, causing a `ReferenceError`.
*
* https://github.com/mdx-js/mdx/issues/742#issuecomment-612652071
*
* This plugin can be removed once MDX removes `layoutProps`, at least that
* seems to be the current plan.
*/
// https://nextjs.org/docs/basic-features/data-fetching
const DATA_FETCH_FNS = ['getStaticPaths', 'getStaticProps', 'getServerProps']
module.exports = () => {
return {
visitor: {
ObjectProperty(path) {
if (
DATA_FETCH_FNS.includes(path.node.value.name) &&
path.findParent(
(path) =>
path.isVariableDeclarator() &&
path.node.id.name === 'layoutProps',
)
) {
path.remove()
}
},
},
}
}

455
lib/shiki-languages/data/extraGrammars/TOML.tmLanguage

@ -0,0 +1,455 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>toml</string>
<string>tml</string>
</array>
<key>name</key>
<string>TOML</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#comments</string>
</dict>
<dict>
<key>include</key>
<string>#tables</string>
</dict>
<dict>
<key>include</key>
<string>#keys</string>
</dict>
</array>
<key>repository</key>
<dict>
<key>array</key>
<dict>
<key>begin</key>
<string>(?&lt;!\w)(\[)\s*</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.array.toml</string>
</dict>
</dict>
<key>comment</key>
<string>Array</string>
<key>end</key>
<string>\s*(\])(?!\w)</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.array.toml</string>
</dict>
</dict>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#comments</string>
</dict>
<dict>
<key>include</key>
<string>#dataTypes</string>
</dict>
</array>
</dict>
<key>boolean</key>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>constant.other.boolean.toml</string>
</dict>
</dict>
<key>comment</key>
<string>Boolean</string>
<key>match</key>
<string>(?&lt;!\w)(true|false)(?!\w)</string>
</dict>
<key>comments</key>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>comment.line.number-sign.toml</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.toml</string>
</dict>
</dict>
<key>comment</key>
<string>Comments</string>
<key>match</key>
<string>\s*((#).*)$</string>
</dict>
<key>dataTypes</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#inlinetable</string>
</dict>
<dict>
<key>include</key>
<string>#array</string>
</dict>
<dict>
<key>include</key>
<string>#string</string>
</dict>
<dict>
<key>include</key>
<string>#dateTimeWithTz</string>
</dict>
<dict>
<key>include</key>
<string>#dateTime</string>
</dict>
<dict>
<key>include</key>
<string>#date</string>
</dict>
<dict>
<key>include</key>
<string>#float</string>
</dict>
<dict>
<key>include</key>
<string>#integer</string>
</dict>
<dict>
<key>include</key>
<string>#boolean</string>
</dict>
</array>
</dict>
<key>dateTimeWithTz</key>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>constant.other.datetime-with-timezone.toml</string>
</dict>
</dict>
<key>comment</key>
<string>DateTime</string>
<key>match</key>
<string>(?&lt;!\w)(\d{4}\-\d{2}\-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[\+\-]\d{2}:\d{2}))(?!\w)</string>
</dict>
<key>dateTime</key>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>constant.other.datetime.toml</string>
</dict>
</dict>
<key>comment</key>
<string>DateTime</string>
<key>match</key>
<string>(\d{4}\-\d{2}\-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d+)?)</string>
</dict>
<key>date</key>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>constant.other.date.toml</string>
</dict>
</dict>
<key>comment</key>
<string>DateTime</string>
<key>match</key>
<string>(\d{4}\-\d{2}\-\d{2})</string>
</dict>
<key>float</key>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>constant.numeric.float.toml</string>
</dict>
</dict>
<key>comment</key>
<string>Float, decimal and exponential representation</string>
<key>match</key>
<string>(?&lt;!\w)([\+\-]?(0|([1-9](([0-9]|_[0-9])+)?))(?:(?:\.(0|([1-9](([0-9]|_[0-9])+)?)))?[eE][\+\-]?[1-9]_?[0-9]*|(?:\.[0-9_]*)))(?!\w)</string>
</dict>
<key>illegal</key>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>invalid.illegal.toml</string>
</dict>
</dict>
<key>comment</key>
<string>Invalid things -&gt; everything unmatched</string>
<key>match</key>
<string>(.*)</string>
</dict>
<key>inlinetable</key>
<dict>
<key>begin</key>
<string>(?&lt;!\w)(\{)\s*</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.inlinetable.toml</string>
</dict>
</dict>
<key>end</key>
<string>\s*(\})(?!\w)</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.inlinetable.toml</string>
</dict>
</dict>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#keys</string>
</dict>
<dict>
<key>include</key>
<string>#dataTypes</string>
</dict>
</array>
</dict>
<key>integer</key>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>constant.numeric.integer.toml</string>
</dict>
</dict>
<key>comment</key>
<string>Integer (with and without + and - prefixes)</string>
<key>match</key>
<string>(?&lt;!\w)((?:[\+\-]?(0|([1-9](([0-9]|_[0-9])+)?))))(?!\w)</string>
</dict>
<key>keys</key>
<dict>
<key>comment</key>
<string>Key-value-pairs</string>
<key>patterns</key>
<array>
<dict>
<key>comment</key>
<string>Assignments without key are invalid</string>
<key>match</key>
<string>(\s*=.*)$</string>
<key>name</key>
<string>invalid.illegal.noKeyDefined.toml</string>
</dict>
<dict>
<key>comment</key>
<string>Assignments without value are unusual</string>
<key>match</key>
<string>(\s*[A-Za-z_\-][A-Za-z0-9_\-]*\s*=)(?=\s*$)</string>
<key>name</key>
<string>invalid.deprecated.noValueGiven.toml</string>
</dict>
<dict>
<key>begin</key>
<string>\s*([A-Za-z_-][A-Za-z0-9_-]*|".+"|'.+'|[0-9]+)\s*(=)\s*</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.key.toml</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.definition.keyValuePair.toml</string>
</dict>
</dict>
<key>end</key>
<string>($|(?==)|\,|\s*(?=\}))</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#comments</string>
</dict>
<dict>
<key>include</key>
<string>#dataTypes</string>
</dict>
<dict>
<key>include</key>
<string>#illegal</string>
</dict>
</array>
</dict>
</array>
</dict>
<key>string</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>'''</string>
<key>comment</key>
<string>literal string block (no escape sequences)</string>
<key>end</key>
<string>'''</string>
<key>name</key>
<string>string.quoted.triple.literal.block.toml</string>
</dict>
<dict>
<key>comment</key>
<string>literal string line (no escape sequences)</string>
<key>match</key>
<string>'.*?'</string>
<key>name</key>
<string>string.quoted.single.literal.line.toml</string>
</dict>
<dict>
<key>begin</key>
<string>"""</string>
<key>comment</key>
<string>basic string block</string>
<key>end</key>
<string>"""</string>
<key>name</key>
<string>string.quoted.triple.basic.block.toml</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\([btnfr"\\ \n]|u[0-9A-Fa-f]{4}|U[0-9A-Fa-f]{8})</string>
<key>name</key>
<string>constant.character.escape.toml</string>
</dict>
<dict>
<key>match</key>
<string>\\[^btnfr"\\\n]</string>
<key>name</key>
<string>invalid.illegal.escape.toml</string>
</dict>
</array>
</dict>
<dict>
<key>comment</key>
<string>basic string line</string>
<key>match</key>
<string>"[^"\\]*(?:\\.[^"\\]*)*"</string>
<key>name</key>
<string>string.quoted.single.basic.line.toml</string>
</dict>
</array>
</dict>
<key>tables</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.table.toml</string>
</dict>
<key>2</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>[^\s.]+</string>
<key>name</key>
<string>entity.other.attribute-name.table.toml</string>
</dict>
</array>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.table.toml</string>
</dict>
</dict>
<key>match</key>
<string>^\s*(\[)([^\[\]]*)(\])</string>
<key>name</key>
<string>meta.tag.table.toml</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.table.array.toml</string>
</dict>
<key>2</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>[^\s.]+</string>
<key>name</key>
<string>entity.other.attribute-name.table.array.toml</string>
</dict>
</array>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.table.array.toml</string>
</dict>
</dict>
<key>match</key>
<string>^\s*(\[\[)([^\[\]]*)(\]\])</string>
<key>name</key>
<string>meta.tag.table.array.toml</string>
</dict>
</array>
</dict>
</dict>
<key>scopeName</key>
<string>source.toml</string>
<key>uuid</key>
<string>ffffeb76-439f-4c5e-b60f-d8a13606d63d</string>
</dict>
</plist>

249
lib/shiki-languages/data/extraGrammars/clarity.tmLanguage.json

@ -0,0 +1,249 @@
{
"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"
}

667
lib/shiki-languages/data/extraGrammars/graphql.json

@ -0,0 +1,667 @@
{
"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"
}
}
}

590
lib/shiki-languages/data/extraGrammars/haml.json

@ -0,0 +1,590 @@
{
"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": "$|(?!\\.|#|\\{|\\(|\\[|&amp;|=|-|~|!=|&=|/)",
"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": "(?<!\\#)\\{(?=.+(,|(do)|\\{|\\}|\\||(\\#.*))\\s*)",
"end": "\\s*\\}(?!\\s*\\,)(?!\\s*\\|)(?!\\#\\{.*\\})",
"name": "meta.section.attributes.haml",
"patterns": [
{
"include": "source.ruby"
},
{
"include": "#continuation"
},
{
"include": "#rubyline"
}
]
},
{
"begin": "\\(",
"end": "\\)",
"name": "meta.section.attributes.plain.haml",
"patterns": [
{
"match": "([\\w-]+)",
"name": "constant.other.symbol.ruby"
},
{
"match": "\\=",
"name": "punctuation"
},
{
"include": "#variables"
},
{
"begin": "\"",
"end": "\"",
"name": "string.quoted.double.ruby",
"patterns": [
{
"match": "\\\\(x\\h{2}|[0-2][0-7]{0,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)",
"name": "constant.character.escape.ruby"
},
{
"include": "#interpolated_ruby"
}
]
},
{
"include": "#interpolated_ruby"
}
]
},
{
"begin": "\\[(?=.+(,|\\[|\\]|\\||(\\#.*))\\s*)",
"end": "\\s*\\](?!.*(?!\\#\\[)\\])",
"name": "meta.section.object.haml",
"patterns": [
{
"include": "source.ruby"
},
{
"include": "#continuation"
},
{
"include": "#rubyline"
}
]
},
{
"include": "#interpolated_ruby_line"
},
{
"include": "#rubyline"
},
{
"match": "/",
"name": "punctuation.terminator.tag.haml"
}
]
},
{
"begin": "^(\\s*):(ruby|opal)$",
"end": "^(?=\\1\\s+|$\\n*)",
"name": "source.ruby.embedded.filter.haml",
"patterns": [
{
"include": "source.ruby"
}
]
},
{
"begin": "^(\\s*):ruby$",
"end": "^(?=\\1\\s+|$\\n*))",
"name": "source.ruby.embedded.filter.haml",
"patterns": [
{
"include": "source.ruby"
}
]
},
{
"begin": "^(\\s*):(style|sass)$",
"end": "^(?=\\1\\s+|$\\n*)",
"name": "source.sass.embedded.filter.haml",
"patterns": [
{
"include": "source.sass"
}
]
},
{
"begin": "^(\\s*):coffee(script)?",
"end": "^(?!\\1\\s+|$\\n*)",
"name": "source.coffee.embedded.filter.haml",
"patterns": [
{
"include": "source.coffee"
}
]
},
{
"begin": "^(\\s*):plain$",
"end": "^(?=\\1\\s+|$\\n*)",
"name": "text.plain.embedded.filter.haml",
"patterns": [
{
"include": "text.plain"
}
]
},
{
"begin": "^(\\s*)(:ruby)",
"beginCaptures": {
"2": {
"name": "keyword.control.filter.haml"
}
},
"end": "(?m:(?<=\\n)(?!\\1\\s+|$\\n*))",
"name": "source.ruby.embedded.filter.haml",
"patterns": [
{
"include": "source.ruby"
}
]
},
{
"begin": "^(\\s*)(:sass)",
"beginCaptures": {
"2": {
"name": "keyword.control.filter.haml"
}
},
"end": "^(?!\\1\\s+|$\\n*)",
"name": "source.embedded.filter.sass",
"patterns": [
{
"include": "source.sass"
}
]
},
{
"begin": "^(\\s*):(styles|sass)$",
"end": "^(?=\\1\\s+|$\\n*)",
"name": "source.sass.embedded.filter.haml",
"patterns": [
{
"include": "source.sass"
}
]
},
{
"begin": "^(\\s*):plain$",
"end": "^(?=\\1\\s+|$\\n*)",
"name": "text.plain.embedded.filter.haml",
"patterns": [
{
"include": "text.plain"
}
]
},
{
"captures": {
"1": {
"name": "meta.escape.haml"
}
},
"match": "^\\s*(\\.)"
},
{
"begin": "^\\s*(?==|-|~|!=|&=)",
"end": "$",
"patterns": [
{
"include": "#interpolated_ruby_line"
},
{
"include": "#rubyline"
}
]
},
{
"begin": "^(\\s*)(:php)",
"end": "^(?!\\1\\s+|$\\n*)",
"name": "meta.embedded.php",
"captures": {
"2": {
"name": "entity.name.tag.haml"
}
},
"patterns": [
{
"include": "text.html.php#language"
}
]
},
{
"begin": "^(\\s*)(:markdown)",
"end": "^(?!\\1\\s+|$\\n*)",
"name": "meta.embedded.markdown",
"captures": {
"2": {
"name": "entity.name.tag.haml"
}
},
"patterns": [
{
"include": "text.html.markdown"
}
]
},
{
"begin": "^(\\s*)(:(css|styles?))$",
"end": "^(?!\\1\\s+|$\\n*)",
"name": "meta.embedded.css",
"captures": {
"2": {
"name": "entity.name.tag.haml"
}
},
"patterns": [
{
"include": "source.css"
}
]
},
{
"begin": "^(\\s*)(:sass)$",
"end": "^(?!\\1\\s+|$\\n*)",
"name": "meta.embedded.sass",
"captures": {
"2": {
"name": "entity.name.tag.haml"
}
},
"patterns": [
{
"include": "source.sass"
}
]
},
{
"begin": "^(\\s*)(:scss)$",
"end": "^(?!\\1\\s+|$\\n*)",
"name": "meta.embedded.scss",
"captures": {
"2": {
"name": "entity.name.tag.haml"
}
},
"patterns": [
{
"include": "source.scss"
}
]
}
],
"repository": {
"continuation": {
"captures": {
"1": {
"name": "punctuation.separator.continuation.haml"
}
},
"match": "(\\|)\\s*\\n"
},
"interpolated_ruby": {
"patterns": [
{
"captures": {
"0": {
"name": "punctuation.section.embedded.ruby"
},
"1": {
"name": "source.ruby.embedded.source.empty"
}
},
"match": "#\\{(\\})",
"name": "source.ruby.embedded.source"
},
{
"begin": "#\\{",
"captures": {
"0": {
"name": "punctuation.section.embedded.ruby"
}
},
"end": "(\\})",
"name": "source.ruby.embedded.source",
"patterns": [
{
"include": "#nest_curly_and_self"
},
{
"include": "source.ruby"
}
]
},
{
"include": "#variables"
}
]
},
"interpolated_ruby_line": {
"begin": "!?==",
"contentName": "string.source.ruby.embedded.haml",
"end": "$",
"name": "meta.line.ruby.interpolated.haml",
"patterns": [
{
"include": "#interpolated_ruby"
},
{
"include": "source.ruby#escaped_char"
}
]
},
"nest_curly_and_self": {
"patterns": [
{
"begin": "\\{",
"captures": {
"0": {
"name": "punctuation.section.scope.ruby"
}
},
"end": "\\}",
"patterns": [
{
"include": "#nest_curly_and_self"
},
{
"include": "source.ruby"
}
]
}
]
},
"variables": {
"patterns": [
{
"captures": {
"1": {
"name": "punctuation.definition.variable.ruby"
}
},
"match": "(#@)[a-zA-Z_]\\w*",
"name": "variable.other.readwrite.instance.ruby"
},
{
"captures": {
"1": {
"name": "punctuation.definition.variable.ruby"
}
},
"match": "(#@@)[a-zA-Z_]\\w*",
"name": "variable.other.readwrite.class.ruby"
},
{
"captures": {
"1": {
"name": "punctuation.definition.variable.ruby"
}
},
"match": "(#\\$)[a-zA-Z_]\\w*",
"name": "variable.other.readwrite.global.ruby"
}
]
},
"rubyline": {
"begin": "(&amp|!)?(=|-|~)",
"contentName": "source.ruby.embedded.haml",
"end": "((do|\\{)( \\|[.*]+\\|)?)$|$|^(?!.*\\|\\s*)$\\n?",
"endCaptures": {
"1": {
"name": "source.ruby.embedded.html"
},
"2": {
"name": "keyword.control.ruby.start-block"
}
},
"name": "meta.line.ruby.haml",
"patterns": [
{
"match": "\\s+((elseif|foreach|switch|declare|default|use))(?=\\s|\\()",
"captures": {
"1": {
"name": "keyword.control.php"
}
}
},
{
"match": "\\s+(require_once|include_once)(?=\\s|\\()",
"captures": {
"1": {
"name": "keyword.control.import.include.php"
}
}
},
{
"match": "\\s+(catch|try|throw|exception|finally|die)(?=\\s|\\(|\\n*)",
"name": "keyword.control.exception.php"
},
{
"match": "\\s+(function\\s*)((?=\\())",
"captures": {
"1": {
"name": "storage.type.function.php"
}
}
},
{
"match": "\\s+(use\\s*)((?=\\())",
"captures": {
"1": {
"name": "keyword.control.php"
}
}
},
{
"match": "(\\||,|<|do|\\{)\\s*(\\#.*)?$\\n*",
"name": "source.ruby",
"patterns": [
{
"include": "#rubyline"
}
]
},
{
"comment": "Hack to let ruby comments work in this context properly",
"match": "#.*$",
"name": "comment.line.number-sign.ruby"
},
{
"include": "source.ruby"
},
{
"include": "#continuation"
}
]
}
},
"scopeName": "text.haml",
"uuid": "3D727049-DD05-45DF-92A5-D50EA36FD035"
}

1067
lib/shiki-languages/data/extraGrammars/kotlin.tmLanguage

File diff suppressed because it is too large

2287
lib/shiki-languages/data/extraGrammars/latex.plist

File diff suppressed because it is too large

1265
lib/shiki-languages/data/extraGrammars/nginx.tmLanguage

File diff suppressed because it is too large

1648
lib/shiki-languages/data/extraGrammars/postcss.json

File diff suppressed because one or more lines are too long

750
lib/shiki-languages/data/extraGrammars/sass.tmLanguage

@ -0,0 +1,750 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>sass</string>
</array>
<key>foldingStartMarker</key>
<string>/\*|^#|^\*|^\b|^\.</string>
<key>foldingStopMarker</key>
<string>\*/|^\s*$</string>
<key>name</key>
<string>Sass</string>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>^(/\*)</string>
<key>end</key>
<string>\*/|(?=^[a-zA-Z0-9#.%$@\[=*+])</string>
<key>name</key>
<string>comment.block.sass</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#comment-tag</string>
</dict>
<dict>
<key>include</key>
<string>#comment-param</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>\s/\*</string>
<key>end</key>
<string>\*/</string>
<key>name</key>
<string>comment.block.sass</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#comment-tag</string>
</dict>
<dict>
<key>include</key>
<string>#comment-param</string>
</dict>
</array>
</dict>
<dict>
<key>include</key>
<string>#double-slash</string>
</dict>
<dict>
<key>include</key>
<string>#double-quoted</string>
</dict>
<dict>
<key>include</key>
<string>#single-quoted</string>
</dict>
<dict>
<key>include</key>
<string>#interpolation</string>
</dict>
<dict>
<key>include</key>
<string>#curly-brackets</string>
</dict>
<dict>
<key>include</key>
<string>#placeholder-selector</string>
</dict>
<dict>
<key>begin</key>
<string>\$[a-zA-Z0-9_-]+(?=:)</string>
<key>end</key>
<string>$\n?|(?=\)\s\)|\)\n)</string>
<key>name</key>
<string>sass-script-maps</string>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>variable.other</string>
</dict>
</dict>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#double-slash</string>
</dict>
<dict>
<key>include</key>
<string>#double-quoted</string>
</dict>
<dict>
<key>include</key>
<string>#single-quoted</string>
</dict>
<dict>
<key>include</key>
<string>#interpolation</string>
</dict>
<dict>
<key>include</key>
<string>#variable</string>
</dict>
<dict>
<key>include</key>
<string>#rgb-value</string>
</dict>
<dict>
<key>include</key>
<string>#numeric</string>
</dict>
<dict>
<key>include</key>
<string>#unit</string>
</dict>
<dict>
<key>include</key>
<string>#flag</string>
</dict>
<dict>
<key>include</key>
<string>#comma</string>
</dict>
<dict>
<key>include</key>
<string>#function</string>
</dict>
<dict>
<key>include</key>
<string>#function-content</string>
</dict>
<dict>
<key>include</key>
<string>#operator</string>
</dict>
<dict>
<key>include</key>
<string>#reserved-words</string>
</dict>
<dict>
<key>include</key>
<string>#parent-selector</string>
</dict>
<dict>
<key>include</key>
<string>#property-value</string>
</dict>
<dict>
<key>include</key>
<string>#dotdotdot</string>
</dict>
</array>
</dict>
<dict>
<key>include</key>
<string>#variable-root</string>
</dict>
<dict>
<key>include</key>
<string>#numeric</string>
</dict>
<dict>
<key>include</key>
<string>#unit</string>
</dict>
<dict>
<key>include</key>
<string>#flag</string>
</dict>
<dict>
<key>include</key>
<string>#comma</string>
</dict>
<dict>
<key>include</key>
<string>#semicolon</string>
</dict>
<dict>
<key>include</key>
<string>#dotdotdot</string>
</dict>
<dict>
<key>begin</key>
<string>@include|\+(?!\W|\d)</string>
<key>end</key>
<string>(?=\n|\()</string>
<key>name</key>
<string>support.function.name.sass.library</string>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>keyword.control.at-rule.css.sass</string>
</dict>
</dict>
</dict>
<dict>
<key>begin</key>
<string>@mixin|^=|@function</string>
<key>end</key>
<string>$\n?|(?=\()</string>
<key>name</key>
<string>support.function.name.sass.no-completions</string>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>keyword.control.at-rule.css.sass</string>
</dict>
</dict>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>[a-zA-Z0-9_-]+</string>
<key>name</key>
<string>entity.name.function</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(?&lt;=@import)\s[a-zA-Z0-9_/.*-]+</string>
<key>name</key>
<string>string.quoted.double.css.sass</string>
</dict>
<dict>
<key>begin</key>
<string>@</string>
<key>end</key>
<string>$\n?|\s(?!(all|braille|embossed|handheld|print|projection|screen|speech|tty|tv|if|only|not)(\s|,))</string>
<key>name</key>
<string>keyword.control.at-rule.css.sass</string>
</dict>
<dict>
<key>begin</key>
<string>#</string>
<key>end</key>
<string>$\n?|(?=\s|,|\(|\)|\.|\[|>)</string>
<key>name</key>
<string>entity.other.attribute-name.id.css.sass</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#interpolation</string>
</dict>
<dict>
<key>include</key>
<string>#pseudo-class</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>\.|(?&lt;=&amp;)(-|_)</string>
<key>end</key>
<string>$\n?|(?=\s|,|\(|\)|\[|>)</string>
<key>name</key>
<string>entity.other.attribute-name.class.css.sass</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#interpolation</string>
</dict>
<dict>
<key>include</key>
<string>#pseudo-class</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>\[</string>
<key>end</key>
<string>\]</string>
<key>name</key>
<string>entity.other.attribute-selector.sass</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#double-quoted</string>
</dict>
<dict>
<key>include</key>
<string>#single-quoted</string>
</dict>
<dict>
<key>match</key>
<string>\^|\$|\*|~</string>
<key>name</key>
<string>keyword.other.regex.sass</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(?&lt;=\]|\)|not\(|\*|>|>\s):[a-z:-]+|(::|:-)[a-z:-]+</string>
<key>name</key>
<string>entity.other.attribute-name.pseudo-class.css.sass</string>
</dict>
<dict>
<key>begin</key>
<string>:</string>
<key>end</key>
<string>$\n?|(?=\s\(|and\(|\),)</string>
<key>name</key>
<string>meta.property-list.css.sass</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>(?&lt;=:)[a-z-]+\s</string>
<key>name</key>
<string>support.type.property-name.css.sass</string>
</dict>
<dict>
<key>include</key>
<string>#double-slash</string>
</dict>
<dict>
<key>include</key>
<string>#double-quoted</string>
</dict>
<dict>
<key>include</key>
<string>#single-quoted</string>
</dict>
<dict>
<key>include</key>
<string>#interpolation</string>
</dict>
<dict>
<key>include</key>
<string>#curly-brackets</string>
</dict>
<dict>
<key>include</key>
<string>#variable</string>
</dict>
<dict>
<key>include</key>
<string>#rgb-value</string>
</dict>
<dict>
<key>include</key>
<string>#numeric</string>
</dict>
<dict>
<key>include</key>
<string>#unit</string>
</dict>
<dict>
<key>include</key>
<string>#flag</string>
</dict>
<dict>
<key>include</key>
<string>#comma</string>
</dict>
<dict>
<key>include</key>
<string>#semicolon</string>
</dict>
<dict>
<key>include</key>
<string>#function</string>
</dict>
<dict>
<key>include</key>
<string>#function-content</string>
</dict>
<dict>
<key>include</key>
<string>#operator</string>
</dict>
<dict>
<key>include</key>
<string>#parent-selector</string>
</dict>
<dict>
<key>include</key>
<string>#property-value</string>
</dict>
</array>
</dict>
<dict>
<key>include</key>
<string>#rgb-value</string>
</dict>
<dict>
<key>include</key>
<string>#function</string>
</dict>
<dict>
<key>include</key>
<string>#function-content</string>
</dict>
<dict>
<key>begin</key>
<string>(?&lt;!\-|\()\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)|&amp;</string>
<key>end</key>
<string>$\n?|(?=\s|,|\(|\)|\.|\#|\[|>|-|_)</string>
<key>name</key>
<string>entity.name.tag.css.sass.symbol</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#interpolation</string>
</dict>
<dict>
<key>include</key>
<string>#pseudo-class</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(?&lt;=})(?!\n|\(|\)|[a-zA-Z0-9_-]+:)</string>
<key>end</key>
<string>\s|(?=,|\.|\[|\)|\n)</string>
<key>name</key>
<string>entity.name.tag.css.sass</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#interpolation</string>
</dict>
<dict>
<key>include</key>
<string>#pseudo-class</string>
</dict>
</array>
</dict>
<dict>
<key>include</key>
<string>#operator</string>
</dict>
<dict>
<key>match</key>
<string>[a-z-]+((?=:|#{))</string>
<key>name</key>
<string>support.type.property-name.css.sass</string>
</dict>
<dict>
<key>include</key>
<string>#reserved-words</string>
</dict>
<dict>
<key>include</key>
<string>#property-value</string>
</dict>
</array>
<key>repository</key>
<dict>
<key>comma</key>
<dict>
<key>match</key>
<string>\band\b|\bor\b|,</string>
<key>name</key>
<string>comment.punctuation.comma.sass</string>
</dict>
<key>comment-tag</key>
<dict>
<key>begin</key>
<string>(?&lt;={{)</string>
<key>end</key>
<string>(?=}})</string>
<key>name</key>
<string>comment.tag.sass</string>
</dict>
<key>comment-param</key>
<dict>
<key>match</key>
<string>\@(\w+)</string>
<key>name</key>
<string>keyword.control.at-rule.css.sass</string>
</dict>
<key>curly-brackets</key>
<dict>
<key>match</key>
<string>{|}</string>
<key>name</key>
<string>invalid</string>
</dict>
<key>dotdotdot</key>
<dict>
<key>match</key>
<string>\.\.\.</string>
<key>name</key>
<string>variable.other</string>
</dict>
<key>double-slash</key>
<dict>
<key>begin</key>
<string>//</string>
<key>end</key>
<string>$\n?</string>
<key>name</key>
<string>comment.line.sass</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#comment-tag</string>
</dict>
<dict>
<key>include</key>
<string>#comment-param</string>
</dict>
</array>
</dict>
<key>double-quoted</key>
<dict>
<key>begin</key>
<string>"</string>
<key>end</key>
<string>"</string>
<key>name</key>
<string>string.quoted.double.css.sass</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#quoted-interpolation</string>
</dict>
</array>
</dict>
<key>flag</key>
<dict>
<key>match</key>
<string>!(important|default|optional|global)</string>
<key>name</key>
<string>keyword.other.important.css.sass</string>
</dict>
<key>function</key>
<dict>
<key>match</key>
<string>(?&lt;=[\s|\(|,|:])(?!url|format|attr)[a-zA-Z0-9_-][\w-]*(?=\()</string>
<key>name</key>
<string>support.function.name.sass</string>
</dict>
<key>function-content</key>
<dict>
<key>begin</key>
<string>(?&lt;=url\(|format\(|attr\()</string>
<key>end</key>
<string>.(?=\))</string>
<key>name</key>
<string>string.quoted.double.css.sass</string>
</dict>
<key>interpolation</key>
<dict>
<key>begin</key>
<string>#{</string>
<key>end</key>
<string>}</string>
<key>name</key>
<string>support.function.interpolation.sass</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#variable</string>
</dict>
<dict>
<key>include</key>
<string>#numeric</string>
</dict>
<dict>
<key>include</key>
<string>#operator</string>
</dict>
<dict>
<key>include</key>
<string>#unit</string>
</dict>
<dict>
<key>include</key>
<string>#comma</string>
</dict>
<dict>
<key>include</key>
<string>#double-quoted</string>
</dict>
<dict>
<key>include</key>
<string>#single-quoted</string>
</dict>
</array>
</dict>
<key>numeric</key>
<dict>
<key>match</key>
<string>(-|\.)?[0-9]+(\.[0-9]+)?</string>
<key>name</key>
<string>constant.numeric.css.sass</string>
</dict>
<key>operator</key>
<dict>
<key>match</key>
<string>\+|\s-\s|\s-(?=\$)|(?&lt;=\()-(?=\$)|\s-(?=\()|\*|/|%|=|!|&lt;|&gt;|~</string>
<key>name</key>
<string>keyword.operator.sass</string>
</dict>
<key>parent-selector</key>
<dict>
<key>match</key>
<string>&amp;</string>
<key>name</key>
<string>entity.name.tag.css.sass</string>
</dict>
<key>placeholder-selector</key>
<dict>
<key>begin</key>
<string>(?&lt;!\d)%(?!\d)</string>
<key>end</key>
<string>$\n?|\s</string>
<key>name</key>
<string>entity.other.attribute-name.placeholder-selector.sass</string>
</dict>
<key>property-value</key>
<dict>
<key>match</key>
<string>[a-zA-Z0-9_-]+</string>
<key>name</key>
<string>meta.property-value.css.sass, support.constant.property-value.css.sass</string>
</dict>
<key>pseudo-class</key>
<dict>
<key>match</key>
<string>:[a-z:-]+</string>
<key>name</key>
<string>entity.other.attribute-name.pseudo-class.css.sass</string>
</dict>
<key>quoted-interpolation</key>
<dict>
<key>begin</key>
<string>#{</string>
<key>end</key>
<string>}</string>
<key>name</key>
<string>support.function.interpolation.sass</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#variable</string>
</dict>
<dict>
<key>include</key>
<string>#numeric</string>
</dict>
<dict>
<key>include</key>
<string>#operator</string>
</dict>
<dict>
<key>include</key>
<string>#unit</string>
</dict>
<dict>
<key>include</key>
<string>#comma</string>
</dict>
</array>
</dict>
<key>reserved-words</key>
<dict>
<key>match</key>
<string>\b(false|from|in|not|null|through|to|true)\b</string>
<key>name</key>
<string>support.type.property-name.css.sass</string>
</dict>
<key>rgb-value</key>
<dict>
<key>match</key>
<string>(#)([0-9a-fA-F]{3}|[0-9a-fA-F]{6})\b</string>
<key>name</key>
<string>constant.other.color.rgb-value.css.sass</string>
</dict>
<key>semicolon</key>
<dict>
<key>match</key>
<string>;</string>
<key>name</key>
<string>invalid</string>
</dict>
<key>single-quoted</key>
<dict>
<key>begin</key>
<string>'</string>
<key>end</key>
<string>'</string>
<key>name</key>
<string>string.quoted.single.css.sass</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#quoted-interpolation</string>
</dict>
</array>
</dict>
<key>unit</key>
<dict>
<key>match</key>
<string>(?&lt;=[\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|%)</string>
<key>name</key>
<string>keyword.other.unit.css.sass</string>
</dict>
<key>variable-root</key>
<dict>
<key>match</key>
<string>\$[a-zA-Z0-9_-]+</string>
<key>name</key>
<string>variable.other.root</string>
</dict>
<key>variable</key>
<dict>
<key>match</key>
<string>\$[a-zA-Z0-9_-]+</string>
<key>name</key>
<string>variable.other.value</string>
</dict>
</dict>
<key>scopeName</key>
<string>source.sass</string>
<key>uuid</key>
<string>E8D3BD64-D3C3-4CDC-B721-2120C9F06B68</string>
</dict>
</plist>

1199
lib/shiki-languages/data/extraGrammars/stylus.json

File diff suppressed because one or more lines are too long

563
lib/shiki-languages/data/extraGrammars/vue-html.json

@ -0,0 +1,563 @@
{
"uuid": "ca2e4260-5d62-45bf-8cf1-d8b5cc19c8f8",
"repository": {
"entities": {
"patterns": [
{
"captures": {
"3": {
"name": "punctuation.definition.entity.html"
},
"1": {
"name": "punctuation.definition.entity.html"
}
},
"match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)",
"name": "constant.character.entity.html"
},
{
"match": "&",
"name": "invalid.illegal.bad-ampersand.html"
}
]
},
"unquoted-attribute": {
"match": "(?<==)(?:[^\\s<>/'\"]|/(?!>))+",
"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:-]++)(?=[^>]*></\\2>)",
"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": "<!--",
"end": "--\\s*>",
"name": "comment.block.html",
"patterns": [
{
"match": "--",
"name": "invalid.illegal.bad-comments-or-CDATA.html"
}
]
},
{
"captures": {
"0": {
"name": "punctuation.definition.tag.html"
}
},
"begin": "<!",
"end": ">",
"name": "meta.tag.sgml.html",
"patterns": [
{
"captures": {
"1": {
"name": "entity.name.tag.doctype.html"
}
},
"begin": "(?i:DOCTYPE)",
"end": "(?=>)",
"name": "meta.tag.sgml.doctype.html",
"patterns": [
{
"match": "\"[^\">]*\"",
"name": "string.quoted.double.doctype.identifiers-and-DTDs.html"
}
]
},
{
"begin": "\\[CDATA\\[",
"end": "]](?=>)",
"name": "constant.other.inline-data.html"
},
{
"match": "(\\s*)(?!--|>)\\S(\\s*)",
"name": "invalid.illegal.bad-comments-or-CDATA.html"
}
]
},
{
"beginCaptures": {
"2": {
"name": "entity.name.tag.block.any.html"
},
"1": {
"name": "punctuation.definition.tag.begin.html"
}
},
"patterns": [
{
"include": "#tag-stuff"
}
],
"begin": "(</?)((?i:template)[a-zA-Z0-9:-]+\\b)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"end": "(>)",
"name": "meta.tag.block.any.html"
},
{
"beginCaptures": {
"2": {
"name": "entity.name.tag.style.html"
},
"1": {
"name": "punctuation.definition.tag.begin.html"
}
},
"begin": "(<)(template)\\b(?=[^/>]*/>\\s*$)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"end": "(/>)",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
{
"beginCaptures": {
"2": {
"name": "entity.name.tag.style.html"
},
"1": {
"name": "punctuation.definition.tag.begin.html"
}
},
"begin": "(<)(template)",
"endCaptures": {
"2": {
"name": "entity.name.tag.style.html"
},
"3": {
"name": "punctuation.definition.tag.end.html"
},
"1": {
"name": "punctuation.definition.tag.begin.html"
}
},
"end": "(</)(template)(>)",
"patterns": [
{
"include": "#tag-stuff"
},
{
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"begin": "(>)",
"end": "(?=</template>)",
"patterns": [
{
"include": "text.html.vue-html"
}
],
"contentName": "text.html.vue-html"
}
]
},
{
"captures": {
"2": {
"name": "entity.name.tag.structure.any.html"
},
"1": {
"name": "punctuation.definition.tag.begin.html"
}
},
"patterns": [
{
"include": "#tag-stuff"
}
],
"begin": "(</?)((?i:body|head|html)\\b)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"end": "(>)",
"name": "meta.tag.structure.any.html"
},
{
"beginCaptures": {
"2": {
"name": "entity.name.tag.block.any.html"
},
"1": {
"name": "punctuation.definition.tag.begin.html"
}
},
"patterns": [
{
"include": "#tag-stuff"
}
],
"begin": "(</?)((?i:address|blockquote|dd|div|dl|dt|fieldset|form|frame|frameset|h1|h2|h3|h4|h5|h6|iframe|noframes|object|ol|p|ul|applet|center|dir|hr|menu|pre)(?!-)\\b)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"end": "(>)",
"name": "meta.tag.block.any.html"
},
{
"beginCaptures": {
"2": {
"name": "entity.name.tag.inline.any.html"
},
"1": {
"name": "punctuation.definition.tag.begin.html"
}
},
"patterns": [
{
"include": "#tag-stuff"
}
],
"begin": "(</?)((?i:a|abbr|acronym|area|b|base|basefont|bdo|big|br|button|caption|cite|code|col|colgroup|del|dfn|em|font|head|html|i|img|input|ins|isindex|kbd|label|legend|li|link|map|meta|noscript|optgroup|option|param|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|var)(?!-)\\b)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"end": "(/?>)",
"name": "meta.tag.inline.any.html"
},
{
"beginCaptures": {
"2": {
"name": "entity.name.tag.other.html"
},
"1": {
"name": "punctuation.definition.tag.begin.html"
}
},
"patterns": [
{
"include": "#tag-stuff"
}
],
"begin": "(</?)([a-zA-Z0-9:-]+)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"end": "(/?>)",
"name": "meta.tag.other.html"
},
{
"include": "#entities"
},
{
"match": "<>",
"name": "invalid.illegal.incomplete.html"
},
{
"match": "<",
"name": "invalid.illegal.bad-angle-bracket.html"
}
],
"fileTypes": [],
"name": "Vue Template",
"scopeName": "text.html.vue-html"
}

1093
lib/shiki-languages/data/extraGrammars/vue.json

File diff suppressed because it is too large

372
lib/shiki-languages/data/grammars/ASPVBnet.plist

@ -0,0 +1,372 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>comment</key>
<string>Modified from the original ASP bundle. Originally modified by Thomas Aylott subtleGradient.com</string>
<key>fileTypes</key>
<array>
<string>vb</string>
</array>
<key>keyEquivalent</key>
<string>^~A</string>
<key>name</key>
<string>ASP vb.NET</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\n</string>
<key>name</key>
<string>meta.ending-space</string>
</dict>
<dict>
<key>include</key>
<string>#round-brackets</string>
</dict>
<dict>
<key>begin</key>
<string>^(?=\t)</string>
<key>end</key>
<string>(?=[^\t])</string>
<key>name</key>
<string>meta.leading-space</string>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>meta.odd-tab.tabs</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>meta.even-tab.tabs</string>
</dict>
</dict>
<key>match</key>
<string>(\t)(\t)?</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>^(?= )</string>
<key>end</key>
<string>(?=[^ ])</string>
<key>name</key>
<string>meta.leading-space</string>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>meta.odd-tab.spaces</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>meta.even-tab.spaces</string>
</dict>
</dict>
<key>match</key>
<string>( )( )?</string>
</dict>
</array>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>storage.type.function.asp</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>entity.name.function.asp</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.parameters.asp</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>variable.parameter.function.asp</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>punctuation.definition.parameters.asp</string>
</dict>
</dict>
<key>match</key>
<string>^\s*((?i:function|sub))\s*([a-zA-Z_]\w*)\s*(\()([^)]*)(\)).*\n?</string>
<key>name</key>
<string>meta.function.asp</string>
</dict>
<dict>
<key>begin</key>
<string>(^[ \t]+)?(?=')</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.whitespace.comment.leading.asp</string>
</dict>
</dict>
<key>end</key>
<string>(?!\G)</string>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>'</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.asp</string>
</dict>
</dict>
<key>end</key>
<string>\n</string>
<key>name</key>
<string>comment.line.apostrophe.asp</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>(?i:\b(If|Then|Else|ElseIf|Else If|End If|While|Wend|For|To|Each|Case|Select|End Select|Return|Continue|Do|Until|Loop|Next|With|Exit Do|Exit For|Exit Function|Exit Property|Exit Sub|IIf)\b)</string>
<key>name</key>
<string>keyword.control.asp</string>
</dict>
<dict>
<key>match</key>
<string>(?i:\b(Mod|And|Not|Or|Xor|as)\b)</string>
<key>name</key>
<string>keyword.operator.asp</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>storage.type.asp</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>variable.other.bfeac.asp</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>meta.separator.comma.asp</string>
</dict>
</dict>
<key>match</key>
<string>(?i:(dim)\s*(?:(\b[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\b)\s*(,?)))</string>
<key>name</key>
<string>variable.other.dim.asp</string>
</dict>
<dict>
<key>match</key>
<string>(?i:\s*\b(Call|Class|Const|Dim|Redim|Function|Sub|Private Sub|Public Sub|End sub|End Function|Set|Let|Get|New|Randomize|Option Explicit|On Error Resume Next|On Error GoTo)\b\s*)</string>
<key>name</key>
<string>storage.type.asp</string>
</dict>
<dict>
<key>match</key>
<string>(?i:\b(Private|Public|Default)\b)</string>
<key>name</key>
<string>storage.modifier.asp</string>
</dict>
<dict>
<key>match</key>
<string>(?i:\s*\b(Empty|False|Nothing|Null|True)\b)</string>
<key>name</key>
<string>constant.language.asp</string>
</dict>
<dict>
<key>begin</key>
<string>"</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.asp</string>
</dict>
</dict>
<key>end</key>
<string>"</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.asp</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.double.asp</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>""</string>
<key>name</key>
<string>constant.character.escape.apostrophe.asp</string>
</dict>
</array>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.variable.asp</string>
</dict>
</dict>
<key>match</key>
<string>(\$)[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\b\s*</string>
<key>name</key>
<string>variable.other.asp</string>
</dict>
<dict>
<key>match</key>
<string>(?i:\b(Application|ObjectContext|Request|Response|Server|Session)\b)</string>
<key>name</key>
<string>support.class.asp</string>
</dict>
<dict>
<key>match</key>
<string>(?i:\b(Contents|StaticObjects|ClientCertificate|Cookies|Form|QueryString|ServerVariables)\b)</string>
<key>name</key>
<string>support.class.collection.asp</string>
</dict>
<dict>
<key>match</key>
<string>(?i:\b(TotalBytes|Buffer|CacheControl|Charset|ContentType|Expires|ExpiresAbsolute|IsClientConnected|PICS|Status|ScriptTimeout|CodePage|LCID|SessionID|Timeout)\b)</string>
<key>name</key>
<string>support.constant.asp</string>
</dict>
<dict>
<key>match</key>
<string>(?i:\b(Lock|Unlock|SetAbort|SetComplete|BinaryRead|AddHeader|AppendToLog|BinaryWrite|Clear|End|Flush|Redirect|Write|CreateObject|HTMLEncode|MapPath|URLEncode|Abandon|Convert|Regex)\b)</string>
<key>name</key>
<string>support.function.asp</string>
</dict>
<dict>
<key>match</key>
<string>(?i:\b(Application_OnEnd|Application_OnStart|OnTransactionAbort|OnTransactionCommit|Session_OnEnd|Session_OnStart)\b)</string>
<key>name</key>
<string>support.function.event.asp</string>
</dict>
<dict>
<key>match</key>
<string>(?i:(?&lt;=as )(\b[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\b))</string>
<key>name</key>
<string>support.type.vb.asp</string>
</dict>
<dict>
<key>match</key>
<string>(?i:\b(Array|Add|Asc|Atn|CBool|CByte|CCur|CDate|CDbl|Chr|CInt|CLng|Conversions|Cos|CreateObject|CSng|CStr|Date|DateAdd|DateDiff|DatePart|DateSerial|DateValue|Day|Derived|Math|Escape|Eval|Exists|Exp|Filter|FormatCurrency|FormatDateTime|FormatNumber|FormatPercent|GetLocale|GetObject|GetRef|Hex|Hour|InputBox|InStr|InStrRev|Int|Fix|IsArray|IsDate|IsEmpty|IsNull|IsNumeric|IsObject|Item|Items|Join|Keys|LBound|LCase|Left|Len|LoadPicture|Log|LTrim|RTrim|Trim|Maths|Mid|Minute|Month|MonthName|MsgBox|Now|Oct|Remove|RemoveAll|Replace|RGB|Right|Rnd|Round|ScriptEngine|ScriptEngineBuildVersion|ScriptEngineMajorVersion|ScriptEngineMinorVersion|Second|SetLocale|Sgn|Sin|Space|Split|Sqr|StrComp|String|StrReverse|Tan|Time|Timer|TimeSerial|TimeValue|TypeName|UBound|UCase|Unescape|VarType|Weekday|WeekdayName|Year)\b)</string>
<key>name</key>
<string>support.function.vb.asp</string>
</dict>
<dict>
<key>match</key>
<string>-?\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f)?\b</string>
<key>name</key>
<string>constant.numeric.asp</string>
</dict>
<dict>
<key>match</key>
<string>(?i:\b(vbtrue|vbfalse|vbcr|vbcrlf|vbformfeed|vblf|vbnewline|vbnullchar|vbnullstring|int32|vbtab|vbverticaltab|vbbinarycompare|vbtextcomparevbsunday|vbmonday|vbtuesday|vbwednesday|vbthursday|vbfriday|vbsaturday|vbusesystemdayofweek|vbfirstjan1|vbfirstfourdays|vbfirstfullweek|vbgeneraldate|vblongdate|vbshortdate|vblongtime|vbshorttime|vbobjecterror|vbEmpty|vbNull|vbInteger|vbLong|vbSingle|vbDouble|vbCurrency|vbDate|vbString|vbObject|vbError|vbBoolean|vbVariant|vbDataObject|vbDecimal|vbByte|vbArray)\b)</string>
<key>name</key>
<string>support.type.vb.asp</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>entity.name.function.asp</string>
</dict>
</dict>
<key>match</key>
<string>(?i:(\b[a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?\b)(?=\(\)?))</string>
<key>name</key>
<string>support.function.asp</string>
</dict>
<dict>
<key>match</key>
<string>(?i:((?&lt;=(\+|=|-|\&amp;|\\|/|&lt;|&gt;|\(|,))\s*\b([a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?)\b(?!(\(|\.))|\b([a-zA-Z_x7f-xff][a-zA-Z0-9_x7f-xff]*?)\b(?=\s*(\+|=|-|\&amp;|\\|/|&lt;|&gt;|\(|\)))))</string>
<key>name</key>
<string>variable.other.asp</string>
</dict>
<dict>
<key>match</key>
<string>!|\$|%|&amp;|\*|\-\-|\-|\+\+|\+|~|===|==|=|!=|!==|&lt;=|&gt;=|&lt;&lt;=|&gt;&gt;=|&gt;&gt;&gt;=|&lt;&gt;|&lt;|&gt;|!|&amp;&amp;|\|\||\?\:|\*=|/=|%=|\+=|\-=|&amp;=|\^=|\b(in|instanceof|new|delete|typeof|void)\b</string>
<key>name</key>
<string>keyword.operator.js</string>
</dict>
</array>
<key>repository</key>
<dict>
<key>round-brackets</key>
<dict>
<key>begin</key>
<string>\(</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.section.round-brackets.begin.asp</string>
</dict>
</dict>
<key>end</key>
<string>\)</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.section.round-brackets.end.asp</string>
</dict>
</dict>
<key>name</key>
<string>meta.round-brackets</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>$self</string>
</dict>
</array>
</dict>
</dict>
<key>scopeName</key>
<string>source.asp.vb.net</string>
<key>uuid</key>
<string>7F9C9343-D48E-4E7D-BFE8-F680714DCD3E</string>
</dict>
</plist>

169
lib/shiki-languages/data/grammars/Batch File.tmLanguage

@ -0,0 +1,169 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>uuid</key>
<string>E07EC438-7B75-4437-8AA1-DA94C1E6EACC</string>
<key>patterns</key>
<array>
<dict>
<key>name</key>
<string>keyword.command.dosbatch</string>
<key>match</key>
<string>\b(?i)(?:append|assoc|at|attrib|break|cacls|cd|chcp|chdir|chkdsk|chkntfs|cls|cmd|color|comp|compact|convert|copy|date|del|dir|diskcomp|diskcopy|doskey|echo|endlocal|erase|fc|find|findstr|format|ftype|graftabl|help|keyb|label|md|mkdir|mode|more|move|path|pause|popd|print|prompt|pushd|rd|recover|ren|rename|replace|restore|rmdir|set|setlocal|shift|sort|start|subst|time|title|tree|type|ver|verify|vol|xcopy)\b</string>
</dict>
<dict>
<key>name</key>
<string>keyword.control.statement.dosbatch</string>
<key>match</key>
<string>\b(?i)(?:goto|call|exit)\b</string>
</dict>
<dict>
<key>name</key>
<string>keyword.control.conditional.if.dosbatch</string>
<key>match</key>
<string>\b(?i)if\s+((not)\s+)(exist|defined|errorlevel|cmdextversion)\b</string>
</dict>
<dict>
<key>name</key>
<string>keyword.control.conditional.dosbatch</string>
<key>match</key>
<string>\b(?i)(?:if|else)\b</string>
</dict>
<dict>
<key>name</key>
<string>keyword.control.repeat.dosbatch</string>
<key>match</key>
<string>\b(?i)for\b</string>
</dict>
<dict>
<key>name</key>
<string>keyword.operator.dosbatch</string>
<key>match</key>
<string>\b(?:EQU|NEQ|LSS|LEQ|GTR|GEQ)\b</string>
</dict>
<dict>
<key>name</key>
<string>comment.line.rem.dosbatch</string>
<key>match</key>
<string>\b(?i)rem(?:$|\s.*$)</string>
</dict>
<dict>
<key>name</key>
<string>comment.line.colons.dosbatch</string>
<key>match</key>
<string>\s*:\s*:.*$</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.parameter.function.begin.shell</string>
</dict>
</dict>
<key>name</key>
<string>variable.parameter.function.dosbatch</string>
<key>match</key>
<string>(?i)(%)(~(?:f|d|p|n|x|s|a|t|z|\$[^:]*:)*)?\d</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.parameter.loop.begin.shell</string>
</dict>
</dict>
<key>name</key>
<string>variable.parameter.loop.dosbatch</string>
<key>match</key>
<string>(?i)(%%)(~(?:f|d|p|n|x|s|a|t|z|\$[^:]*:)*)?[a-z]</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.other.parsetime.begin.shell</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>variable.other.parsetime.end.shell</string>
</dict>
</dict>
<key>name</key>
<string>variable.other.parsetime.dosbatch</string>
<key>match</key>
<string>(%)[^%]+(%)</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.other.delayed.begin.shell</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>variable.other.delayed.end.shell</string>
</dict>
</dict>
<key>name</key>
<string>variable.other.delayed.dosbatch</string>
<key>match</key>
<string>(!)[^!]+(!)</string>
</dict>
<dict>
<key>begin</key>
<string>"</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.shell</string>
</dict>
</dict>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.shell</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.double.dosbatch</string>
<key>end</key>
<string>"|$</string>
</dict>
<dict>
<key>name</key>
<string>keyword.operator.pipe.dosbatch</string>
<key>match</key>
<string>[|]</string>
</dict>
<dict>
<key>name</key>
<string>keyword.operator.redirect.shell</string>
<key>match</key>
<string>&amp;&gt;|\d*&gt;&amp;\d*|\d*(&gt;&gt;|&gt;|&lt;)|\d*&lt;&amp;|\d*&lt;&gt;</string>
</dict>
</array>
<key>name</key>
<string>Batch File</string>
<key>scopeName</key>
<string>source.dosbatch</string>
<key>fileTypes</key>
<array>
<string>bat</string>
</array>
</dict>
</plist>

440
lib/shiki-languages/data/grammars/Clojure.tmLanguage

@ -0,0 +1,440 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>clj</string>
<string>cljs</string>
<string>clojure</string>
</array>
<key>foldingStartMarker</key>
<string>\(\s*$</string>
<key>foldingStopMarker</key>
<string>^\s*\)</string>
<key>keyEquivalent</key>
<string>^~C</string>
<key>name</key>
<string>Clojure</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#comment</string>
</dict>
<dict>
<key>include</key>
<string>#shebang-comment</string>
</dict>
<dict>
<key>include</key>
<string>#qouted-sexp</string>
</dict>
<dict>
<key>include</key>
<string>#sexp</string>
</dict>
<dict>
<key>include</key>
<string>#keyfn</string>
</dict>
<dict>
<key>include</key>
<string>#string</string>
</dict>
<dict>
<key>include</key>
<string>#vector</string>
</dict>
<dict>
<key>include</key>
<string>#set</string>
</dict>
<dict>
<key>include</key>
<string>#map</string>
</dict>
<dict>
<key>include</key>
<string>#regexp</string>
</dict>
<dict>
<key>include</key>
<string>#var</string>
</dict>
<dict>
<key>include</key>
<string>#constants</string>
</dict>
<dict>
<key>include</key>
<string>#symbol</string>
</dict>
<dict>
<key>include</key>
<string>#whitespace</string>
</dict>
</array>
<key>repository</key>
<dict>
<key>comment</key>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.clojure</string>
</dict>
</dict>
<key>match</key>
<string>(;).*$\n?</string>
<key>name</key>
<string>comment.line.semicolon.clojure</string>
</dict>
<key>constants</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>(nil)(?=(\s|\)|\]|\}))</string>
<key>name</key>
<string>constant.language.nil.clojure</string>
</dict>
<dict>
<key>match</key>
<string>(true|false)</string>
<key>name</key>
<string>constant.language.boolean.clojure</string>
</dict>
<dict>
<key>match</key>
<string>(\d+/\d+)</string>
<key>name</key>
<string>constant.numeric.ratio.clojure</string>
</dict>
<dict>
<key>match</key>
<string>(\d+r\d+)</string>
<key>name</key>
<string>constant.numeric.arbitrary-radix.clojure</string>
</dict>
<dict>
<key>match</key>
<string>(0x\d+)</string>
<key>name</key>
<string>constant.numeric.hexidecimal.clojure</string>
</dict>
<dict>
<key>match</key>
<string>(0\d+)</string>
<key>name</key>
<string>constant.numeric.octal.clojure</string>
</dict>
<dict>
<key>match</key>
<string>(\d+)</string>
<key>name</key>
<string>constant.numeric.decimal.clojure</string>
</dict>
<dict>
<key>match</key>
<string>(?&lt;=(\s|\(|\[|\{)):[a-zA-Z0-9\#\.\-\_\:\+\=\&gt;\&lt;\/\!\?\*]+(?=(\s|\)|\]|\}))</string>
<key>name</key>
<string>constant.keyword.clojure</string>
</dict>
</array>
</dict>
<key>keyfn</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>(?&lt;=(\s|\(|\[|\{))(if(-[-a-z\?]*)?|when(-[-a-z]*)?|for(-[-a-z]*)?|cond|do|let(-[-a-z\?]*)?|binding|loop|recur|fn|throw[a-z\-]*|try|catch|finally|([a-z]*case))(?=(\s|\)|\]|\}))</string>
<key>name</key>
<string>storage.control.clojure</string>
</dict>
<dict>
<key>match</key>
<string>(?&lt;=(\s|\(|\[|\{))(declare-?|(in-)?ns|import|use|require|load|compile|(def[a-z\-]*))(?=(\s|\)|\]|\}))</string>
<key>name</key>
<string>keyword.control.clojure</string>
</dict>
</array>
</dict>
<key>map</key>
<dict>
<key>begin</key>
<string>(\{)</string>
<key>end</key>
<string>(\})</string>
<key>name</key>
<string>meta.map.clojure</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>$self</string>
</dict>
</array>
</dict>
<key>qouted-sexp</key>
<dict>
<key>begin</key>
<string>(['``]\()</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.section.expression.begin.clojure</string>
</dict>
</dict>
<key>end</key>
<string>(\))(\n)?</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.section.expression.end.clojure</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>meta.after-expression.clojure</string>
</dict>
</dict>
<key>name</key>
<string>meta.qouted-expression.clojure</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>$self</string>
</dict>
</array>
</dict>
<key>regexp</key>
<dict>
<key>begin</key>
<string>#\"</string>
<key>end</key>
<string>\"</string>
<key>name</key>
<string>string.regexp.clojure</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#regexp_escaped_char</string>
</dict>
</array>
</dict>
<key>regexp_escaped_char</key>
<dict>
<key>match</key>
<string>\\(\")</string>
<key>name</key>
<string>string.regexp.clojure</string>
</dict>
<key>set</key>
<dict>
<key>begin</key>
<string>(\#\{)</string>
<key>end</key>
<string>(\})</string>
<key>name</key>
<string>meta.set.clojure</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>$self</string>
</dict>
</array>
</dict>
<key>sexp</key>
<dict>
<key>begin</key>
<string>(\()</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.section.expression.begin.clojure</string>
</dict>
</dict>
<key>end</key>
<string>(\))(\n)?</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.section.expression.end.clojure</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>meta.after-expression.clojure</string>
</dict>
</dict>
<key>name</key>
<string>meta.expression.clojure</string>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>(?&lt;=\()(ns|def|def-|defn|defn-|defvar|defvar-|defmacro|defmacro-|deftest)\s+(.+?)(?=\s)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.control.clojure</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>entity.global.clojure</string>
</dict>
</dict>
<key>end</key>
<string>(?=\))</string>
<key>name</key>
<string>meta.definition.global.clojure</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>$self</string>
</dict>
</array>
</dict>
<dict>
<key>include</key>
<string>$self</string>
</dict>
</array>
</dict>
<key>shebang-comment</key>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.shebang.clojure</string>
</dict>
</dict>
<key>match</key>
<string>^(\#!).*$\n?</string>
<key>name</key>
<string>comment.line.semicolon.clojure</string>
</dict>
<key>string</key>
<dict>
<key>begin</key>
<string>(")</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.clojure</string>
</dict>
</dict>
<key>end</key>
<string>(")</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.clojure</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.double.clojure</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>constant.character.escape.clojure</string>
</dict>
</array>
</dict>
<key>symbol</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>(\w[\w\d]+)</string>
<key>name</key>
<string>meta.symbol.clojure</string>
</dict>
</array>
</dict>
<key>var</key>
<dict>
<key>match</key>
<string>(?&lt;=(\s|\(|\[|\{)\#)'[a-zA-Z0-9\.\-\_\:\+\=\&gt;\&lt;\/\!\?\*]+(?=(\s|\)|\]|\}))</string>
<key>name</key>
<string>meta.var.clojure</string>
</dict>
<key>vector</key>
<dict>
<key>begin</key>
<string>(\[)</string>
<key>end</key>
<string>(\])</string>
<key>name</key>
<string>meta.vector.clojure</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>$self</string>
</dict>
</array>
</dict>
<key>whitespace</key>
<dict>
<key>match</key>
<string>\s+$</string>
<key>name</key>
<string>invalid.trailing-whitespace</string>
</dict>
</dict>
<key>scopeName</key>
<string>source.clojure</string>
<key>smartTypingPairs</key>
<array>
<array>
<string>"</string>
<string>"</string>
</array>
<array>
<string>(</string>
<string>)</string>
</array>
<array>
<string>{</string>
<string>}</string>
</array>
<array>
<string>[</string>
<string>]</string>
</array>
</array>
<key>uuid</key>
<string>6A87759F-F746-4E84-B788-965B46363202</string>
</dict>
</plist>

143
lib/shiki-languages/data/grammars/Dockerfile.tmLanguage

@ -0,0 +1,143 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>Dockerfile</string>
</array>
<key>name</key>
<string>Dockerfile</string>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.control.dockerfile</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.other.special-method.dockerfile</string>
</dict>
</dict>
<key>match</key>
<string>^\s*(?:(ONBUILD)\s+)?(FROM|MAINTAINER|RUN|EXPOSE|ENV|ADD|VOLUME|USER|WORKDIR|COPY|LABEL|STOPSIGNAL|ARG)\s</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.operator.dockerfile</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.other.special-method.dockerfile</string>
</dict>
</dict>
<key>match</key>
<string>^\s*(?:(ONBUILD)\s+)?(CMD|ENTRYPOINT)\s</string>
</dict>
<dict>
<key>begin</key>
<string>"</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.dockerfile</string>
</dict>
</dict>
<key>end</key>
<string>"</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.dockerfile</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.double.dockerfile</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>constant.character.escaped.dockerfile</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>'</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.dockerfile</string>
</dict>
</dict>
<key>end</key>
<string>'</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.dockerfile</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.single.dockerfile</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>constant.character.escaped.dockerfile</string>
</dict>
</array>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.whitespace.comment.leading.dockerfile</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>comment.line.number-sign.dockerfile</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.dockerfile</string>
</dict>
</dict>
<key>comment</key>
<string>comment.line</string>
<key>match</key>
<string>^(\s*)((#).*$\n?)</string>
</dict>
</array>
<key>scopeName</key>
<string>source.dockerfile</string>
<key>uuid</key>
<string>a39d8795-59d2-49af-aa00-fe74ee29576e</string>
</dict>
</plist>

2145
lib/shiki-languages/data/grammars/Groovy.tmLanguage

File diff suppressed because it is too large

854
lib/shiki-languages/data/grammars/Handlebars.json

@ -0,0 +1,854 @@
{
"name": "Handlebars",
"repository": {
"html_tags": {
"patterns": [
{
"begin": "(<)([a-zA-Z0-9:-]+)(?=[^>]*></\\2>)",
"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"
}
]
},
{
"begin": "<!--",
"captures": {
"0": {
"name": "punctuation.definition.comment.html"
}
},
"end": "--\\s*>",
"name": "comment.block.html",
"patterns": [
{
"match": "--",
"name": "invalid.illegal.bad-comments-or-CDATA.html"
}
]
},
{
"begin": "<!",
"captures": {
"0": {
"name": "punctuation.definition.tag.html"
}
},
"end": ">",
"name": "meta.tag.sgml.html",
"patterns": [
{
"begin": "(DOCTYPE|doctype)",
"captures": {
"1": {
"name": "entity.name.tag.doctype.html"
}
},
"end": "(?=>)",
"name": "meta.tag.sgml.doctype.html",
"patterns": [
{
"match": "\"[^\">]*\"",
"name": "string.quoted.double.doctype.identifiers-and-DTDs.html"
}
]
},
{
"begin": "\\[CDATA\\[",
"end": "]](?=>)",
"name": "constant.other.inline-data.html"
},
{
"match": "(\\s*)(?!--|>)\\S(\\s*)",
"name": "invalid.illegal.bad-comments-or-CDATA.html"
}
]
},
{
"begin": "(?:^\\s+)?(<)((?i:style))\\b(?![^>]*/>)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
"2": {
"name": "entity.name.tag.style.html"
},
"3": {
"name": "punctuation.definition.tag.html"
}
},
"end": "(</)((?i:style))(>)(?:\\s*\\n)?",
"name": "source.css.embedded.html",
"patterns": [
{
"include": "#tag-stuff"
},
{
"begin": "(>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.html"
}
},
"end": "(?=</(?i:style))",
"patterns": [
{
"include": "source.css"
}
]
}
]
},
{
"begin": "(?:^\\s+)?(<)((?i:script))\\b(?![^>]*/>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.html"
},
"2": {
"name": "entity.name.tag.script.html"
}
},
"end": "(?<=</(script|SCRIPT))(>)(?:\\s*\\n)?",
"endCaptures": {
"2": {
"name": "punctuation.definition.tag.html"
}
},
"name": "source.js.embedded.html",
"patterns": [
{
"include": "#tag-stuff"
},
{
"begin": "(?<!</(?:script|SCRIPT))(>)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
"2": {
"name": "entity.name.tag.script.html"
}
},
"end": "(</)((?i:script))",
"patterns": [
{
"captures": {
"1": {
"name": "punctuation.definition.comment.js"
}
},
"match": "(//).*?((?=</script)|$\\n?)",
"name": "comment.line.double-slash.js"
},
{
"begin": "/\\*",
"captures": {
"0": {
"name": "punctuation.definition.comment.js"
}
},
"end": "\\*/|(?=</script)",
"name": "comment.block.js"
},
{
"include": "source.js"
}
]
}
]
},
{
"begin": "(</?)((?i:body|head|html)\\b)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
"2": {
"name": "entity.name.tag.structure.any.html"
}
},
"end": "(>)",
"name": "meta.tag.structure.any.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
{
"begin": "(</?)((?i:address|blockquote|dd|div|header|section|footer|aside|nav|dl|dt|fieldset|form|frame|frameset|h1|h2|h3|h4|h5|h6|iframe|noframes|object|ol|p|ul|applet|center|dir|hr|menu|pre)\\b)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
"2": {
"name": "entity.name.tag.block.any.html"
}
},
"end": "(>)",
"name": "meta.tag.block.any.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
{
"begin": "(</?)((?i:a|abbr|acronym|area|b|base|basefont|bdo|big|br|button|caption|cite|code|col|colgroup|del|dfn|em|font|head|html|i|img|input|ins|isindex|kbd|label|legend|li|link|map|meta|noscript|optgroup|option|param|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|var)\\b)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
"2": {
"name": "entity.name.tag.inline.any.html"
}
},
"end": "((?: ?/)?>)",
"name": "meta.tag.inline.any.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
{
"begin": "(</?)([a-zA-Z0-9:-]+)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
"2": {
"name": "entity.name.tag.other.html"
}
},
"end": "(>)",
"name": "meta.tag.other.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
{
"begin": "(</?)([a-zA-Z0-9{}:-]+)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
"2": {
"name": "entity.name.tag.tokenised.html"
}
},
"end": "(>)",
"name": "meta.tag.tokenised.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
{
"include": "#entities"
},
{
"match": "<>",
"name": "invalid.illegal.incomplete.html"
},
{
"match": "<",
"name": "invalid.illegal.bad-angle-bracket.html"
}
]
},
"entities": {
"patterns": [
{
"captures": {
"1": {
"name": "punctuation.definition.entity.html"
},
"3": {
"name": "punctuation.definition.entity.html"
}
},
"name": "constant.character.entity.html",
"match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)"
},
{
"name": "invalid.illegal.bad-ampersand.html",
"match": "&"
}
]
},
"end_block": {
"begin": "(\\{\\{~?/)([a-zA-Z0-9_\\.-]+)\\s*",
"end": "(~?\\}\\})",
"name": "meta.function.block.end.handlebars",
"endCaptures": {
"1": {
"name": "support.constant.handlebars"
}
},
"beginCaptures": {
"1": {
"name": "support.constant.handlebars"
},
"2": {
"name": "support.constant.handlebars"
}
},
"patterns": []
},
"yfm": {
"patterns": [
{
"patterns": [
{
"include": "source.yaml"
}
],
"begin": "(?<!\\s)---\\n$",
"end": "^---\\s",
"name": "markup.raw.yaml.front-matter"
}
]
},
"comments": {
"patterns": [
{
"patterns": [
{
"name": "keyword.annotation.handlebars",
"match": "@\\w*"
},
{
"include": "#comments"
}
],
"begin": "\\{\\{!",
"end": "\\}\\}",
"name": "comment.block.handlebars"
},
{
"captures": {
"0": {
"name": "punctuation.definition.comment.html"
}
},
"begin": "<!--",
"end": "-{2,3}\\s*>",
"name": "comment.block.html",
"patterns": [
{
"name": "invalid.illegal.bad-comments-or-CDATA.html",
"match": "--"
}
]
}
]
},
"block_comments": {
"patterns": [
{
"patterns": [
{
"name": "keyword.annotation.handlebars",
"match": "@\\w*"
},
{
"include": "#comments"
}
],
"begin": "\\{\\{!--",
"end": "--\\}\\}",
"name": "comment.block.handlebars"
},
{
"captures": {
"0": {
"name": "punctuation.definition.comment.html"
}
},
"begin": "<!--",
"end": "-{2,3}\\s*>",
"name": "comment.block.html",
"patterns": [
{
"name": "invalid.illegal.bad-comments-or-CDATA.html",
"match": "--"
}
]
}
]
},
"block_helper": {
"begin": "(\\{\\{~?\\#)([-a-zA-Z0-9_\\./]+)\\s?(@?[-a-zA-Z0-9_\\./]+)*\\s?(@?[-a-zA-Z0-9_\\./]+)*\\s?(@?[-a-zA-Z0-9_\\./]+)*",
"end": "(~?\\}\\})",
"name": "meta.function.block.start.handlebars",
"endCaptures": {
"1": {
"name": "support.constant.handlebars"
}
},
"beginCaptures": {
"1": {
"name": "support.constant.handlebars"
},
"2": {
"name": "support.constant.handlebars"
},
"3": {
"name": "variable.parameter.handlebars"
},
"4": {
"name": "support.constant.handlebars"
},
"5": {
"name": "variable.parameter.handlebars"
},
"6": {
"name": "support.constant.handlebars"
}
},
"patterns": [
{
"include": "#string"
},
{
"include": "#handlebars_attribute"
}
]
},
"string-single-quoted": {
"begin": "'",
"end": "'",
"name": "string.quoted.single.handlebars",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.html"
}
},
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.html"
}
},
"patterns": [
{
"include": "#escaped-single-quote"
},
{
"include": "#block_comments"
},
{
"include": "#comments"
},
{
"include": "#block_helper"
},
{
"include": "#else_token"
},
{
"include": "#end_block"
},
{
"include": "#partial_and_var"
}
]
},
"string": {
"patterns": [
{
"include": "#string-single-quoted"
},
{
"include": "#string-double-quoted"
}
]
},
"escaped-single-quote": {
"name": "constant.character.escape.js",
"match": "\\\\'"
},
"escaped-double-quote": {
"name": "constant.character.escape.js",
"match": "\\\\\""
},
"partial_and_var": {
"begin": "(\\{\\{~?\\{*(>|!<)*)\\s*(@?[-a-zA-Z0-9_\\./]+)*",
"end": "(~?\\}\\}\\}*)",
"name": "meta.function.inline.other.handlebars",
"beginCaptures": {
"1": {
"name": "support.constant.handlebars"
},
"3": {
"name": "variable.parameter.handlebars"
}
},
"endCaptures": {
"1": {
"name": "support.constant.handlebars"
}
},
"patterns": [
{
"include": "#string"
},
{
"include": "#handlebars_attribute"
}
]
},
"handlebars_attribute_name": {
"begin": "\\b([-a-zA-Z0-9_\\.]+)\\b=",
"captures": {
"1": {
"name": "variable.parameter.handlebars"
}
},
"end": "(?='|\"|)",
"name": "entity.other.attribute-name.handlebars"
},
"handlebars_attribute_value": {
"begin": "([-a-zA-Z0-9_\\./]+)\\b\\s*",
"captures": {
"1": {
"name": "variable.parameter.handlebars"
}
},
"end": "('|\"|)",
"name": "entity.other.attribute-value.handlebars",
"patterns": [
{
"include": "#string"
}
]
},
"handlebars_attribute": {
"patterns": [
{
"include": "#handlebars_attribute_name"
},
{
"include": "#handlebars_attribute_value"
}
]
},
"extends": {
"patterns": [
{
"end": "(\\}\\})",
"begin": "(\\{\\{!<)\\s([-a-zA-Z0-9_\\./]+)",
"beginCaptures": {
"1": {
"name": "support.function.handlebars"
},
"2": {
"name": "support.class.handlebars"
}
},
"endCaptures": {
"1": {
"name": "support.function.handlebars"
}
},
"name": "meta.preprocessor.handlebars"
}
]
},
"else_token": {
"begin": "(\\{\\{~?else)(@?\\s(if)\\s([-a-zA-Z0-9_\\./]+))?",
"end": "(~?\\}\\}\\}*)",
"name": "meta.function.inline.else.handlebars",
"beginCaptures": {
"1": {
"name": "support.constant.handlebars"
},
"3": {
"name": "support.constant.handlebars"
},
"4": {
"name": "variable.parameter.handlebars"
}
},
"endCaptures": {
"1": {
"name": "support.constant.handlebars"
}
}
},
"string-double-quoted": {
"begin": "\"",
"end": "\"",
"name": "string.quoted.double.handlebars",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.html"
}
},
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.html"
}
},
"patterns": [
{
"include": "#escaped-double-quote"
},
{
"include": "#block_comments"
},
{
"include": "#comments"
},
{
"include": "#block_helper"
},
{
"include": "#else_token"
},
{
"include": "#end_block"
},
{
"include": "#partial_and_var"
}
]
},
"inline_script": {
"begin": "(?:^\\s+)?(<)((?i:script))\\b(?:.*(type)=([\"'](?:text/x-handlebars-template|text/x-handlebars|text/template|x-tmpl-handlebars)[\"']))(?![^>]*/>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.html"
},
"2": {
"name": "entity.name.tag.script.html"
},
"3": {
"name": "entity.other.attribute-name.html"
},
"4": {
"name": "string.quoted.double.html"
}
},
"end": "(?<=</(script|SCRIPT))(>)(?:\\s*\\n)?",
"endCaptures": {
"2": {
"name": "punctuation.definition.tag.html"
}
},
"name": "source.handlebars.embedded.html",
"patterns": [
{
"include": "#tag-stuff"
},
{
"begin": "(?<!</(?:script|SCRIPT))(>)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
"2": {
"name": "entity.name.tag.script.html"
}
},
"end": "(</)((?i:script))",
"patterns": [
{
"include": "#block_comments"
},
{
"include": "#comments"
},
{
"include": "#block_helper"
},
{
"include": "#end_block"
},
{
"include": "#else_token"
},
{
"include": "#partial_and_var"
},
{
"include": "#html_tags"
},
{
"include": "text.html.basic"
}
]
}
]
},
"tag_generic_attribute": {
"begin": "\\b([a-zA-Z0-9_-]+)\\b\\s*(=)",
"captures": {
"1": {
"name": "entity.other.attribute-name.generic.html"
},
"2": {
"name": "punctuation.separator.key-value.html"
}
},
"patterns": [
{
"include": "#string"
}
],
"name": "entity.other.attribute-name.html",
"end": "(?<='|\"|)"
},
"tag_id_attribute": {
"begin": "\\b(id)\\b\\s*(=)",
"captures": {
"1": {
"name": "entity.other.attribute-name.id.html"
},
"2": {
"name": "punctuation.separator.key-value.html"
}
},
"end": "(?<='|\"|)",
"name": "meta.attribute-with-value.id.html",
"patterns": [
{
"include": "#string"
}
]
},
"tag-stuff": {
"patterns": [
{
"include": "#tag_id_attribute"
},
{
"include": "#tag_generic_attribute"
},
{
"include": "#string"
},
{
"include": "#block_comments"
},
{
"include": "#comments"
},
{
"include": "#block_helper"
},
{
"include": "#end_block"
},
{
"include": "#else_token"
},
{
"include": "#partial_and_var"
}
]
}
},
"scopeName": "text.html.handlebars",
"patterns": [
{
"include": "#yfm"
},
{
"include": "#extends"
},
{
"include": "#block_comments"
},
{
"include": "#comments"
},
{
"include": "#block_helper"
},
{
"include": "#end_block"
},
{
"include": "#else_token"
},
{
"include": "#partial_and_var"
},
{
"include": "#inline_script"
},
{
"include": "#html_tags"
},
{
"include": "text.html.basic"
}
],
"fileTypes": [
"handlebars",
"handlebars.html",
"hbr",
"hbrs",
"hbs",
"hdbs",
"hjs",
"mu",
"mustache",
"rac",
"stache",
"template",
"tmpl"
],
"uuid": "70E91676-DE0A-4266-A2B9-3AD2E535E484",
"version": "https://github.com/daaain/Handlebars/commit/bdaec7aaf5eaac45d1878096110d1db7975fb100"
}

387
lib/shiki-languages/data/grammars/JSON.tmLanguage

@ -0,0 +1,387 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>json</string>
<string>sublime-settings</string>
<string>sublime-menu</string>
<string>sublime-keymap</string>
<string>sublime-mousemap</string>
<string>sublime-theme</string>
<string>sublime-build</string>
<string>sublime-project</string>
<string>sublime-completions</string>
</array>
<key>foldingStartMarker</key>
<string>(?x) # turn on extended mode
^ # a line beginning with
\s* # some optional space
[{\[] # the start of an object or array
(?! # but not followed by
.* # whatever
[}\]] # and the close of an object or array
,? # an optional comma
\s* # some optional space
$ # at the end of the line
)
| # ...or...
[{\[] # the start of an object or array
\s* # some optional space
$ # at the end of the line</string>
<key>foldingStopMarker</key>
<string>(?x) # turn on extended mode
^ # a line beginning with
\s* # some optional space
[}\]] # and the close of an object or array</string>
<key>keyEquivalent</key>
<string>^~J</string>
<key>name</key>
<string>JSON (Javascript Next)</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#value</string>
</dict>
</array>
<key>repository</key>
<dict>
<key>array</key>
<dict>
<key>begin</key>
<string>\[</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.array.begin.json</string>
</dict>
</dict>
<key>end</key>
<string>\]</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.array.end.json</string>
</dict>
</dict>
<key>name</key>
<string>meta.structure.array.json</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#value</string>
</dict>
<dict>
<key>match</key>
<string>,</string>
<key>name</key>
<string>punctuation.separator.array.json</string>
</dict>
<dict>
<key>match</key>
<string>[^\s\]]</string>
<key>name</key>
<string>invalid.illegal.expected-array-separator.json</string>
</dict>
</array>
</dict>
<key>comments</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>/\*\*</string>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.json</string>
</dict>
</dict>
<key>end</key>
<string>\*/</string>
<key>name</key>
<string>comment.block.documentation.json</string>
</dict>
<dict>
<key>begin</key>
<string>/\*</string>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.json</string>
</dict>
</dict>
<key>end</key>
<string>\*/</string>
<key>name</key>
<string>comment.block.json</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.json</string>
</dict>
</dict>
<key>match</key>
<string>(//).*$\n?</string>
<key>name</key>
<string>comment.line.double-slash.js</string>
</dict>
</array>
</dict>
<key>constant</key>
<dict>
<key>match</key>
<string>\b(?:true|false|null)\b</string>
<key>name</key>
<string>constant.language.json</string>
</dict>
<key>number</key>
<dict>
<key>match</key>
<string>(?x) # turn on extended mode
-? # an optional minus
(?:
0 # a zero
| # ...or...
[1-9] # a 1-9 character
\d* # followed by zero or more digits
)
(?:
(?:
\. # a period
\d+ # followed by one or more digits
)?
(?:
[eE] # an e character
[+-]? # followed by an option +/-
\d+ # followed by one or more digits
)? # make exponent optional
)? # make decimal portion optional</string>
<key>name</key>
<string>constant.numeric.json</string>
</dict>
<key>object</key>
<dict>
<key>begin</key>
<string>\{</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.dictionary.begin.json</string>
</dict>
</dict>
<key>end</key>
<string>\}</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.dictionary.end.json</string>
</dict>
</dict>
<key>name</key>
<string>meta.structure.dictionary.json</string>
<key>patterns</key>
<array>
<dict>
<key>comment</key>
<string>the JSON object key</string>
<key>include</key>
<string>#objectkey</string>
</dict>
<dict>
<key>include</key>
<string>#comments</string>
</dict>
<dict>
<key>begin</key>
<string>:</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.separator.dictionary.key-value.json</string>
</dict>
</dict>
<key>end</key>
<string>(,)|(?=\})</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.separator.dictionary.pair.json</string>
</dict>
</dict>
<key>name</key>
<string>meta.structure.dictionary.value.json</string>
<key>patterns</key>
<array>
<dict>
<key>comment</key>
<string>the JSON object value</string>
<key>include</key>
<string>#value</string>
</dict>
<dict>
<key>match</key>
<string>[^\s,]</string>
<key>name</key>
<string>invalid.illegal.expected-dictionary-separator.json</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>[^\s\}]</string>
<key>name</key>
<string>invalid.illegal.expected-dictionary-separator.json</string>
</dict>
</array>
</dict>
<key>string</key>
<dict>
<key>begin</key>
<string>"</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.json</string>
</dict>
</dict>
<key>end</key>
<string>"</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.json</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.double.json</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#stringcontent</string>
</dict>
</array>
</dict>
<key>objectkey</key>
<dict>
<key>begin</key>
<string>"</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.support.type.property-name.begin.json</string>
</dict>
</dict>
<key>end</key>
<string>"</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.support.type.property-name.end.json</string>
</dict>
</dict>
<key>name</key>
<string>support.type.property-name.json</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#stringcontent</string>
</dict>
</array>
</dict>
<key>stringcontent</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>(?x) # turn on extended mode
\\ # a literal backslash
(?: # ...followed by...
["\\/bfnrt] # one of these characters
| # ...or...
u # a u
[0-9a-fA-F]{4}) # and four hex digits</string>
<key>name</key>
<string>constant.character.escape.json</string>
</dict>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>invalid.illegal.unrecognized-string-escape.json</string>
</dict>
</array>
</dict>
<key>value</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#constant</string>
</dict>
<dict>
<key>include</key>
<string>#number</string>
</dict>
<dict>
<key>include</key>
<string>#string</string>
</dict>
<dict>
<key>include</key>
<string>#array</string>
</dict>
<dict>
<key>include</key>
<string>#object</string>
</dict>
<dict>
<key>include</key>
<string>#comments</string>
</dict>
</array>
</dict>
</dict>
<key>scopeName</key>
<string>source.json</string>
<key>uuid</key>
<string>8f97457b-516e-48ce-83c7-08ae12fb327a</string>
</dict>
</plist>

213
lib/shiki-languages/data/grammars/JSONC.tmLanguage.json

@ -0,0 +1,213 @@
{
"information_for_contributors": [
"This file has been converted from https://github.com/Microsoft/vscode-JSON.tmLanguage/blob/master/JSON.tmLanguage",
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/Microsoft/vscode-JSON.tmLanguage/commit/9bd83f1c252b375e957203f21793316203f61f70",
"name": "JSON with comments",
"scopeName": "source.json.comments",
"patterns": [
{
"include": "#value"
}
],
"repository": {
"array": {
"begin": "\\[",
"beginCaptures": {
"0": {
"name": "punctuation.definition.array.begin.json.comments"
}
},
"end": "\\]",
"endCaptures": {
"0": {
"name": "punctuation.definition.array.end.json.comments"
}
},
"name": "meta.structure.array.json.comments",
"patterns": [
{
"include": "#value"
},
{
"match": ",",
"name": "punctuation.separator.array.json.comments"
},
{
"match": "[^\\s\\]]",
"name": "invalid.illegal.expected-array-separator.json.comments"
}
]
},
"comments": {
"patterns": [
{
"begin": "/\\*\\*(?!/)",
"captures": {
"0": {
"name": "punctuation.definition.comment.json.comments"
}
},
"end": "\\*/",
"name": "comment.block.documentation.json.comments"
},
{
"begin": "/\\*",
"captures": {
"0": {
"name": "punctuation.definition.comment.json.comments"
}
},
"end": "\\*/",
"name": "comment.block.json.comments"
},
{
"captures": {
"1": {
"name": "punctuation.definition.comment.json.comments"
}
},
"match": "(//).*$\\n?",
"name": "comment.line.double-slash.js"
}
]
},
"constant": {
"match": "\\b(?:true|false|null)\\b",
"name": "constant.language.json.comments"
},
"number": {
"match": "(?x) # turn on extended mode\n -? # an optional minus\n (?:\n 0 # a zero\n | # ...or...\n [1-9] # a 1-9 character\n \\d* # followed by zero or more digits\n )\n (?:\n (?:\n \\. # a period\n \\d+ # followed by one or more digits\n )?\n (?:\n [eE] # an e character\n [+-]? # followed by an option +/-\n \\d+ # followed by one or more digits\n )? # make exponent optional\n )? # make decimal portion optional",
"name": "constant.numeric.json.comments"
},
"object": {
"begin": "\\{",
"beginCaptures": {
"0": {
"name": "punctuation.definition.dictionary.begin.json.comments"
}
},
"end": "\\}",
"endCaptures": {
"0": {
"name": "punctuation.definition.dictionary.end.json.comments"
}
},
"name": "meta.structure.dictionary.json.comments",
"patterns": [
{
"comment": "the JSON object key",
"include": "#objectkey"
},
{
"include": "#comments"
},
{
"begin": ":",
"beginCaptures": {
"0": {
"name": "punctuation.separator.dictionary.key-value.json.comments"
}
},
"end": "(,)|(?=\\})",
"endCaptures": {
"1": {
"name": "punctuation.separator.dictionary.pair.json.comments"
}
},
"name": "meta.structure.dictionary.value.json.comments",
"patterns": [
{
"comment": "the JSON object value",
"include": "#value"
},
{
"match": "[^\\s,]",
"name": "invalid.illegal.expected-dictionary-separator.json.comments"
}
]
},
{
"match": "[^\\s\\}]",
"name": "invalid.illegal.expected-dictionary-separator.json.comments"
}
]
},
"string": {
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.json.comments"
}
},
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.json.comments"
}
},
"name": "string.quoted.double.json.comments",
"patterns": [
{
"include": "#stringcontent"
}
]
},
"objectkey": {
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.support.type.property-name.begin.json.comments"
}
},
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.support.type.property-name.end.json.comments"
}
},
"name": "string.json.comments support.type.property-name.json.comments",
"patterns": [
{
"include": "#stringcontent"
}
]
},
"stringcontent": {
"patterns": [
{
"match": "(?x) # turn on extended mode\n \\\\ # a literal backslash\n (?: # ...followed by...\n [\"\\\\/bfnrt] # one of these characters\n | # ...or...\n u # a u\n [0-9a-fA-F]{4}) # and four hex digits",
"name": "constant.character.escape.json.comments"
},
{
"match": "\\\\.",
"name": "invalid.illegal.unrecognized-string-escape.json.comments"
}
]
},
"value": {
"patterns": [
{
"include": "#constant"
},
{
"include": "#number"
},
{
"include": "#string"
},
{
"include": "#array"
},
{
"include": "#object"
},
{
"include": "#comments"
}
]
}
}
}

964
lib/shiki-languages/data/grammars/Jade.json

@ -0,0 +1,964 @@
{
"fileTypes": [
"jade"
],
"name": "Jade",
"patterns": [
{
"comment": "Doctype declaration.",
"match": "^(!!!|doctype)(\\s*[a-zA-Z0-9-_]+)?",
"name": "meta.tag.sgml.doctype.html"
},
{
"begin": "^(\\s*)//-",
"comment": "Unbuffered (jade-only) comments.",
"end": "^(?!(\\1\\s)|\\s*$)",
"name": "comment.unbuffered.block.jade"
},
{
"begin": "^(\\s*)//",
"comment": "Buffered (html) comments.",
"end": "^(?!(\\1\\s)|\\s*$)",
"name": "string.comment.buffered.block.jade",
"patterns": [
{
"captures": {
"1": {
"name": "invalid.illegal.comment.comment.block.jade"
}
},
"comment": "Buffered comments inside buffered comments will generate invalid html.",
"match": "^\\s*(//)(?!-)",
"name": "string.comment.buffered.block.jade"
}
]
},
{
"begin": "^(\\s*)-$",
"comment": "Unbuffered code block.",
"end": "^(?!(\\1\\s)|\\s*$)",
"name": "source.js",
"patterns": [
{
"include": "source.js"
}
]
},
{
"begin": "^(\\s*)(script)(?=[.#(\\s])((?![^\\n]*type=)|(?=[^\\n]*(text|application)/javascript))",
"beginCaptures": {
"2": {
"name": "entity.name.tag.script.jade"
}
},
"comment": "Script tag with JavaScript code.",
"end": "^(?!(\\1\\s)|\\s*$)",
"name": "meta.tag.other",
"patterns": [
{
"begin": "\\G(?=\\()",
"end": "$",
"name": "stuff.tag.script.jade",
"patterns": [
{
"include": "#tag_attributes"
}
]
},
{
"begin": "\\G(?=[.#])",
"end": "$",
"name": "stuff.tag.script.jade",
"patterns": [
{
"include": "#complete_tag"
}
]
},
{
"include": "source.js"
}
]
},
{
"begin": "^(\\s*)(style)((\\.$)|(?=[.#(].*\\.$))",
"beginCaptures": {
"2": {
"name": "entity.name.tag.script.jade"
}
},
"comment": "Style tag with CSS code.",
"end": "^(?!(\\1\\s)|\\s*$)",
"name": "meta.tag.other",
"patterns": [
{
"begin": "\\G(?=\\()",
"end": "$",
"name": "stuff.tag.style.jade",
"patterns": [
{
"include": "#tag_attributes"
}
]
},
{
"begin": "\\G(?=[.#])",
"end": "$",
"name": "stuff.tag.style.jade",
"patterns": [
{
"include": "#complete_tag"
}
]
},
{
"include": "source.css"
}
]
},
{
"begin": "^(\\s*):(sass)(?=\\(|$)",
"beginCaptures": {
"2": {
"name": "constant.language.name.sass.filter.jade"
}
},
"end": "^(?!(\\1\\s)|\\s*$)",
"name": "source.sass.filter.jade",
"patterns": [
{
"include": "#tag_attributes"
},
{
"include": "source.sass"
}
]
},
{
"begin": "^(\\s*):(less)(?=\\(|$)",
"beginCaptures": {
"2": {
"name": "constant.language.name.less.filter.jade"
}
},
"end": "^(?!(\\1\\s)|\\s*$)",
"name": "source.less.filter.jade",
"patterns": [
{
"include": "#tag_attributes"
},
{
"include": "source.less"
}
]
},
{
"begin": "^(\\s*):(stylus)(?=\\(|$)",
"beginCaptures": {
"2": {
"name": "constant.language.name.stylus.filter.jade"
}
},
"end": "^(?!(\\1\\s)|\\s*$)",
"patterns": [
{
"include": "#tag_attributes"
},
{
"include": "source.stylus"
}
]
},
{
"begin": "^(\\s*):(coffee(-?script)?)(?=\\(|$)",
"beginCaptures": {
"2": {
"name": "constant.language.name.coffeescript.filter.jade"
}
},
"end": "^(?!(\\1\\s)|\\s*$)",
"name": "source.coffeescript.filter.jade",
"patterns": [
{
"include": "#tag_attributes"
},
{
"include": "source.coffee"
}
]
},
{
"begin": "^(\\s*)((:(?=.))|(:$))",
"beginCaptures": {
"4": {
"name": "invalid.illegal.empty.generic.filter.jade"
}
},
"comment": "Generic Jade filter.",
"end": "^(?!(\\1\\s)|\\s*$)",
"patterns": [
{
"begin": "\\G(?<=:)(?=.)",
"end": "$",
"name": "name.generic.filter.jade",
"patterns": [
{
"match": "\\G\\(",
"name": "invalid.illegal.name.generic.filter.jade"
},
{
"match": "[\\w-]",
"name": "constant.language.name.generic.filter.jade"
},
{
"include": "#tag_attributes"
},
{
"match": "\\W",
"name": "invalid.illegal.name.generic.filter.jade"
}
]
}
]
},
{
"begin": "^(\\s*)(?=[\\w.#].*?\\.$)(?=(?:(?:(?:(?:(?:#[\\w-]+)|(?:\\.[\\w-]+))|(?:(?:[#!]\\{[^}]*\\})|(?:\\w(?:(?:[\\w:-]+[\\w-])|(?:[\\w-]*)))))(?:(?:#[\\w-]+)|(?:\\.[\\w-]+)|(?:\\((?:[^()\\'\\\"]*(?:(?:\\'(?:[^\\']|(?:(?<!\\\\)\\\\\\'))*\\')|(?:\\\"(?:[^\\\"]|(?:(?<!\\\\)\\\\\\\"))*\\\")))*[^()]*\\))*)*)(?:(?:(?::\\s+)|(?<=\\)))(?:(?:(?:(?:#[\\w-]+)|(?:\\.[\\w-]+))|(?:(?:[#!]\\{[^}]*\\})|(?:\\w(?:(?:[\\w:-]+[\\w-])|(?:[\\w-]*)))))(?:(?:#[\\w-]+)|(?:\\.[\\w-]+)|(?:\\((?:[^()\\'\\\"]*(?:(?:\\'(?:[^\\']|(?:(?<!\\\\)\\\\\\'))*\\')|(?:\\\"(?:[^\\\"]|(?:(?<!\\\\)\\\\\\\"))*\\\")))*[^()]*\\))*)*))*)\\.$)(?:(?:(#[\\w-]+)|(\\.[\\w-]+))|((?:[#!]\\{[^}]*\\})|(?:\\w(?:(?:[\\w:-]+[\\w-])|(?:[\\w-]*)))))",
"beginCaptures": {
"2": {
"name": "constant.id.tag.jade"
},
"3": {
"name": "constant.language.js"
},
"4": {
"name": "meta.tag.other entity.name.tag.jade"
}
},
"comment": "Generated from dot_block_tag.py",
"end": "^(?!(\\1\\s)|\\s*$)",
"patterns": [
{
"include": "#tag_attributes"
},
{
"include": "#complete_tag"
},
{
"begin": "^(?=.)",
"end": "$",
"name": "text.block.jade",
"patterns": [
{
"include": "#inline_jade"
},
{
"include": "#embedded_html"
},
{
"include": "#html_entity"
},
{
"include": "#interpolated_value"
},
{
"include": "#interpolated_error"
}
]
}
]
},
{
"begin": "^\\s*",
"comment": "All constructs that generally span a single line starting with any number of white-spaces.",
"end": "$",
"patterns": [
{
"include": "#inline_jade"
},
{
"include": "#blocks_and_includes"
},
{
"include": "#unbuffered_code"
},
{
"include": "#mixin_definition"
},
{
"include": "#mixin_call"
},
{
"include": "#flow_control"
},
{
"include": "#case_conds"
},
{
"begin": "\\|",
"comment": "Tag pipe text line.",
"end": "$",
"name": "text.block.pipe.jade",
"patterns": [
{
"include": "#inline_jade"
},
{
"include": "#embedded_html"
},
{
"include": "#html_entity"
},
{
"include": "#interpolated_value"
},
{
"include": "#interpolated_error"
}
]
},
{
"include": "#printed_expression"
},
{
"begin": "\\G(?=(#[^\\{\\w-])|[^\\w.#])",
"comment": "Line starting with characters incompatible with tag name/id/class is standalone text.",
"end": "$",
"patterns": [
{
"begin": "</?(?=[!#])",
"end": ">|$",
"patterns": [
{
"include": "#inline_jade"
},
{
"include": "#interpolated_value"
},
{
"include": "#interpolated_error"
}
]
},
{
"include": "#inline_jade"
},
{
"include": "#embedded_html"
},
{
"include": "#html_entity"
},
{
"include": "#interpolated_value"
},
{
"include": "#interpolated_error"
}
]
},
{
"include": "#complete_tag"
}
]
}
],
"repository": {
"blocks_and_includes": {
"captures": {
"1": {
"name": "storage.type.import.include.jade"
},
"4": {
"name": "variable.control.import.include.jade"
}
},
"comment": "Template blocks and includes.",
"match": "(extends|include|yield|append|prepend|block( (append|prepend))?)\\s+(.*)$",
"name": "meta.first-class.jade"
},
"case_conds": {
"begin": "(default|when)((\\s+|(?=:))|$)",
"captures": {
"1": {
"name": "storage.type.function.jade"
}
},
"comment": "Jade case conditionals.",
"end": "$",
"name": "meta.control.flow.jade",
"patterns": [
{
"begin": "\\G(?!:)",
"end": "(?=:\\s+)|$",
"name": "js.embedded.control.flow.jade",
"patterns": [
{
"include": "#case_when_paren"
},
{
"include": "source.js"
}
]
},
{
"begin": ":\\s+",
"end": "$",
"name": "tag.case.control.flow.jade",
"patterns": [
{
"include": "#complete_tag"
}
]
}
]
},
"case_when_paren": {
"begin": "\\(",
"end": "\\)",
"name": "js.when.control.flow.jade",
"patterns": [
{
"include": "#case_when_paren"
},
{
"match": ":",
"name": "invalid.illegal.name.tag.jade"
},
{
"include": "source.js"
}
]
},
"complete_tag": {
"begin": "(?=[\\w.#])|(:\\s*)",
"end": "(\\.?$)|(?=:.)",
"patterns": [
{
"include": "#blocks_and_includes"
},
{
"include": "#unbuffered_code"
},
{
"include": "#mixin_call"
},
{
"include": "#flow_control"
},
{
"match": "(?<=:)\\w.*$",
"name": "invalid.illegal.name.tag.jade"
},
{
"include": "#tag_name"
},
{
"include": "#tag_id"
},
{
"include": "#tag_classes"
},
{
"include": "#tag_attributes"
},
{
"include": "#tag_mixin_attributes"
},
{
"captures": {
"2": {
"name": "invalid.illegal.end.tag.jade"
},
"4": {
"name": "invalid.illegal.end.tag.jade"
}
},
"match": "((\\.)\\s+$)|((:)\\s*$)"
},
{
"include": "#printed_expression"
},
{
"include": "#tag_text"
}
]
},
"embedded_html": {
"begin": "(?=<[^>]*>)",
"end": "$|(?=>)",
"name": "html",
"patterns": [
{
"include": "text.html.basic"
},
{
"include": "#interpolated_value"
},
{
"include": "#interpolated_error"
}
]
},
"flow_control": {
"begin": "(for|if|else if|else|each|until|while|unless|case)(\\s+|$)",
"captures": {
"1": {
"name": "storage.type.function.jade"
}
},
"comment": "Jade control flow.",
"end": "$",
"name": "meta.control.flow.jade",
"patterns": [
{
"begin": "",
"end": "$",
"name": "js.embedded.control.flow.jade",
"patterns": [
{
"include": "source.js"
}
]
}
]
},
"html_entity": {
"patterns": [
{
"match": "(&)([a-zA-Z0-9]+|#[0-9]+|#x[0-9a-fA-F]+)(;)",
"name": "constant.character.entity.html.text.jade"
},
{
"match": "[<>&]",
"name": "invalid.illegal.html_entity.text.jade"
}
]
},
"inline_jade": {
"begin": "(?<!\\\\)(#\\[)",
"captures": {
"1": {
"name": "entity.name.function.jade"
},
"2": {
"name": "entity.name.function.jade"
}
},
"end": "(\\])",
"name": "inline.jade",
"patterns": [
{
"include": "#inline_jade"
},
{
"include": "#mixin_call"
},
{
"begin": "(?<!\\])(?=[\\w.#])|(:\\s*)",
"end": "(?=\\]|(:.)|=|\\s)",
"name": "tag.inline.jade",
"patterns": [
{
"include": "#tag_name"
},
{
"include": "#tag_id"
},
{
"include": "#tag_classes"
},
{
"include": "#tag_attributes"
},
{
"include": "#tag_mixin_attributes"
},
{
"include": "#inline_jade"
},
{
"match": "\\[",
"name": "invalid.illegal.tag.jade"
}
]
},
{
"include": "#unbuffered_code"
},
{
"include": "#printed_expression"
},
{
"match": "\\[",
"name": "invalid.illegal.tag.jade"
},
{
"include": "#inline_jade_text"
}
]
},
"inline_jade_text": {
"begin": "",
"end": "(?=\\])",
"patterns": [
{
"begin": "\\[",
"end": "\\]",
"patterns": [
{
"include": "#inline_jade_text"
}
]
},
{
"include": "#inline_jade"
},
{
"include": "#embedded_html"
},
{
"include": "#html_entity"
},
{
"include": "#interpolated_value"
},
{
"include": "#interpolated_error"
}
]
},
"interpolated_error": {
"match": "(?<!\\\\)[#!]\\{(?=[^}]*$)",
"name": "invalid.illegal.tag.jade"
},
"interpolated_value": {
"begin": "(?<!\\\\)[#!]\\{(?=.*?\\})",
"end": "\\}",
"name": "string.interpolated.jade",
"patterns": [
{
"match": "{",
"name": "invalid.illegal.tag.jade"
},
{
"include": "source.js"
}
]
},
"js_braces": {
"begin": "\\{",
"end": "\\}",
"patterns": [
{
"include": "#js_braces"
},
{
"include": "source.js"
}
]
},
"js_brackets": {
"begin": "\\[",
"end": "\\]",
"patterns": [
{
"include": "#js_brackets"
},
{
"include": "source.js"
}
]
},
"js_parens": {
"begin": "\\(",
"end": "\\)",
"patterns": [
{
"include": "#js_parens"
},
{
"include": "source.js"
}
]
},
"mixin_call": {
"begin": "((?:mixin\\s+)|\\+)([\\w-]+)",
"beginCaptures": {
"1": {
"name": "storage.type.function.jade"
},
"2": {
"name": "meta.tag.other entity.name.function.jade"
}
},
"end": "(?!\\()|$",
"patterns": [
{
"begin": "(?<!\\))\\(",
"end": "\\)",
"name": "args.mixin.jade",
"patterns": [
{
"include": "#js_parens"
},
{
"include": "#string"
},
{
"captures": {
"1": {
"name": "meta.tag.other entity.other.attribute-name.tag.jade"
}
},
"match": "([^\\s(),=/]+)\\s*=\\s*"
},
{
"include": "source.js"
}
]
},
{
"include": "#tag_attributes"
}
]
},
"mixin_definition": {
"captures": {
"1": {
"name": "storage.type.function.jade"
},
"2": {
"name": "meta.tag.other entity.name.function.jade"
},
"3": {
"name": "punctuation.definition.parameters.begin.js"
},
"4": {
"name": "variable.parameter.function.js"
},
"5": {
"name": "punctuation.definition.parameters.begin.js"
}
},
"match": "(mixin\\s+)([\\w-]+)(?:(\\()\\s*((?:[a-zA-Z_]\\w*\\s*)(?:,\\s*[a-zA-Z_]\\w*\\s*)*)(\\)))?$"
},
"printed_expression": {
"begin": "(!?\\=)\\s*",
"captures": {
"1": {
"name": "constant"
}
},
"end": "(?=\\])|$",
"name": "source.js",
"patterns": [
{
"include": "#js_brackets"
},
{
"include": "source.js"
}
]
},
"string": {
"begin": "(['\"])",
"end": "(?<!\\\\)\\1",
"name": "string.quoted.jade",
"patterns": [
{
"match": "\\\\((x[0-9a-fA-F]{2})|(u[0-9]{4})|.)",
"name": "constant.character.quoted.jade"
},
{
"include": "#interpolated_value"
},
{
"include": "#interpolated_error"
}
]
},
"tag_attribute_name": {
"captures": {
"1": {
"name": "entity.other.attribute-name.tag.jade"
}
},
"match": "([^\\s(),=/!]+)\\s*"
},
"tag_attribute_name_paren": {
"begin": "\\(\\s*",
"end": "\\)",
"name": "entity.other.attribute-name.tag.jade",
"patterns": [
{
"include": "#tag_attribute_name_paren"
},
{
"include": "#tag_attribute_name"
}
]
},
"tag_attributes": {
"begin": "(\\(\\s*)",
"captures": {
"1": {
"name": "constant.name.attribute.tag.jade"
}
},
"end": "(\\))",
"name": "meta.tag.other",
"patterns": [
{
"include": "#tag_attribute_name_paren"
},
{
"include": "#tag_attribute_name"
},
{
"match": "!(?!=)",
"name": "invalid.illegal.tag.jade"
},
{
"begin": "=\\s*",
"end": "$|(?=,|(?:\\s+[^!%&*-+~|<>:?/])|\\))",
"name": "attribute_value",
"patterns": [
{
"include": "#string"
},
{
"include": "#js_parens"
},
{
"include": "#js_brackets"
},
{
"include": "#js_braces"
},
{
"include": "source.js"
}
]
},
{
"begin": "(?<=[%&*-+~|<>:?/])\\s+",
"end": "$|(?=,|(?:\\s+[^!%&*-+~|<>:?/])|\\))",
"name": "attribute_value2",
"patterns": [
{
"include": "#string"
},
{
"include": "#js_parens"
},
{
"include": "#js_brackets"
},
{
"include": "#js_braces"
},
{
"include": "source.js"
}
]
}
]
},
"tag_classes": {
"captures": {
"1": {
"name": "invalid.illegal.tag.jade"
}
},
"match": "\\.([^\\w-])?[\\w-]*",
"name": "constant.language.js"
},
"tag_id": {
"match": "#[\\w-]+",
"name": "constant.id.tag.jade"
},
"tag_mixin_attributes": {
"begin": "(&attributes\\()",
"captures": {
"1": {
"name": "entity.name.function.jade"
}
},
"end": "(\\))",
"name": "meta.tag.other",
"patterns": [
{
"match": "attributes(?=\\))",
"name": "storage.type.keyword.jade"
},
{
"include": "source.js"
}
]
},
"tag_name": {
"begin": "([#!]\\{(?=.*?\\}))|(\\w(([\\w:-]+[\\w-])|([\\w-]*)))",
"end": "(\\G(?<!\\5[^\\w-]))|\\}|$",
"name": "meta.tag.other entity.name.tag.jade",
"patterns": [
{
"begin": "\\G(?<=\\{)",
"end": "(?=\\})",
"name": "meta.tag.other entity.name.tag.jade",
"patterns": [
{
"match": "{",
"name": "invalid.illegal.tag.jade"
},
{
"include": "source.js"
}
]
}
]
},
"tag_text": {
"begin": "(?=.)",
"end": "$",
"patterns": [
{
"include": "#inline_jade"
},
{
"include": "#embedded_html"
},
{
"include": "#html_entity"
},
{
"include": "#interpolated_value"
},
{
"include": "#interpolated_error"
}
]
},
"unbuffered_code": {
"begin": "(-|(([a-zA-Z0-9_]+)\\s+=))",
"beginCaptures": {
"3": {
"name": "variable.parameter.javascript.embedded.jade"
}
},
"comment": "name = function() {}",
"end": "(?=\\])|$",
"name": "source.js",
"patterns": [
{
"include": "#js_brackets"
},
{
"include": "source.js"
}
]
}
},
"scopeName": "text.jade",
"uuid": "eee6ba25-6ac2-4f7e-9c70-cddf2bd3448b",
"version": "https://github.com/davidrios/jade-tmbundle/commit/7c1304aa5a0d916a93fd296d3dd994219ecdc90f"
}

3575
lib/shiki-languages/data/grammars/JavaScript.tmLanguage.json

File diff suppressed because one or more lines are too long

3438
lib/shiki-languages/data/grammars/MagicPython.tmLanguage.json

File diff suppressed because it is too large

435
lib/shiki-languages/data/grammars/MagicRegExp.tmLanguage.json

@ -0,0 +1,435 @@
{
"name": "MagicRegExp",
"scopeName": "source.regexp.python",
"fileTypes": [
"re"
],
"uuid": "39e15186-71e6-11e5-b82c-7c6d62900c7c",
"patterns": [
{
"include": "#regexp-expression"
}
],
"repository": {
"regexp-base-expression": {
"patterns": [
{
"name": "support.other.match.any.regexp",
"match": "\\."
},
{
"name": "support.other.match.begin.regexp",
"match": "\\^"
},
{
"name": "support.other.match.end.regexp",
"match": "\\$"
},
{
"name": "keyword.operator.quantifier.regexp",
"match": "[+*?]\\??"
},
{
"name": "keyword.operator.disjunction.regexp",
"match": "\\|"
},
{
"name": "keyword.operator.quantifier.regexp",
"match": "(?x)\n \\{(\n \\d+ | \\d+,(\\d+)? | ,\\d+\n )\\}\n"
},
{
"include": "#regexp-escape-sequence"
}
]
},
"regexp-backreference-number": {
"name": "meta.backreference.regexp",
"match": "(\\\\[1-9]\\d?)",
"captures": {
"1": {
"name": "entity.name.tag.backreference.regexp"
}
}
},
"regexp-backreference": {
"name": "meta.backreference.named.regexp",
"match": "(?x)\n (\\() (\\?P= \\w+(?:\\s+[[:alnum:]]+)?) (\\))\n",
"captures": {
"1": {
"name": "punctuation.parenthesis.backreference.named.begin.regexp support.other.parenthesis.regexp"
},
"2": {
"name": "entity.name.tag.named.backreference.regexp"
},
"3": {
"name": "punctuation.parenthesis.backreference.named.end.regexp support.other.parenthesis.regexp"
}
}
},
"regexp-flags": {
"name": "storage.modifier.flag.regexp",
"match": "\\(\\?[aiLmsux]+\\)"
},
"regexp-escape-special": {
"name": "support.other.escape.special.regexp",
"match": "\\\\([AbBdDsSwWZ])"
},
"regexp-escape-character": {
"name": "constant.character.escape.regexp",
"match": "(?x)\n \\\\ (\n x[0-9A-Fa-f]{2}\n | 0[0-7]{1,2}\n | [0-7]{3}\n )\n"
},
"regexp-escape-unicode": {
"name": "constant.character.unicode.regexp",
"match": "(?x)\n \\\\ (\n u[0-9A-Fa-f]{4}\n | U[0-9A-Fa-f]{8}\n )\n"
},
"regexp-escape-catchall": {
"name": "constant.character.escape.regexp",
"match": "\\\\(.|\\n)"
},
"regexp-escape-sequence": {
"patterns": [
{
"include": "#regexp-escape-special"
},
{
"include": "#regexp-escape-character"
},
{
"include": "#regexp-escape-unicode"
},
{
"include": "#regexp-backreference-number"
},
{
"include": "#regexp-escape-catchall"
}
]
},
"regexp-charecter-set-escapes": {
"patterns": [
{
"name": "constant.character.escape.regexp",
"match": "\\\\[abfnrtv\\\\]"
},
{
"include": "#regexp-escape-special"
},
{
"name": "constant.character.escape.regexp",
"match": "\\\\([0-7]{1,3})"
},
{
"include": "#regexp-escape-character"
},
{
"include": "#regexp-escape-unicode"
},
{
"include": "#regexp-escape-catchall"
}
]
},
"regexp-expression": {
"patterns": [
{
"include": "#regexp-base-expression"
},
{
"include": "#regexp-character-set"
},
{
"include": "#regexp-comments"
},
{
"include": "#regexp-flags"
},
{
"include": "#regexp-named-group"
},
{
"include": "#regexp-backreference"
},
{
"include": "#regexp-lookahead"
},
{
"include": "#regexp-lookahead-negative"
},
{
"include": "#regexp-lookbehind"
},
{
"include": "#regexp-lookbehind-negative"
},
{
"include": "#regexp-conditional"
},
{
"include": "#regexp-parentheses-non-capturing"
},
{
"include": "#regexp-parentheses"
}
]
},
"regexp-character-set": {
"patterns": [
{
"match": "(?x)\n \\[ \\^? \\] (?! .*?\\])\n"
},
{
"name": "meta.character.set.regexp",
"begin": "(\\[)(\\^)?(\\])?",
"end": "(\\])",
"beginCaptures": {
"1": {
"name": "constant.other.set.regexp punctuation.character.set.begin.regexp"
},
"2": {
"name": "keyword.operator.negation.regexp"
},
"3": {
"name": "constant.character.set.regexp"
}
},
"endCaptures": {
"1": {
"name": "constant.other.set.regexp punctuation.character.set.end.regexp"
},
"2": {
"name": "invalid.illegal.newline.python"
}
},
"patterns": [
{
"include": "#regexp-charecter-set-escapes"
},
{
"name": "constant.character.set.regexp",
"match": "[^\\n]"
}
]
}
]
},
"regexp-named-group": {
"name": "meta.named.regexp",
"begin": "(?x)\n (\\() (\\?P <\\w+(?:\\s+[[:alnum:]]+)?>)\n",
"end": "(\\))",
"beginCaptures": {
"1": {
"name": "punctuation.parenthesis.named.begin.regexp support.other.parenthesis.regexp"
},
"2": {
"name": "entity.name.tag.named.group.regexp"
}
},
"endCaptures": {
"1": {
"name": "punctuation.parenthesis.named.end.regexp support.other.parenthesis.regexp"
},
"2": {
"name": "invalid.illegal.newline.python"
}
},
"patterns": [
{
"include": "#regexp-expression"
}
]
},
"regexp-comments": {
"name": "comment.regexp",
"begin": "\\(\\?#",
"end": "(\\))",
"beginCaptures": {
"0": {
"name": "punctuation.comment.begin.regexp"
}
},
"endCaptures": {
"1": {
"name": "punctuation.comment.end.regexp"
},
"2": {
"name": "invalid.illegal.newline.python"
}
},
"patterns": [
{
"include": "#codetags"
}
]
},
"regexp-lookahead": {
"begin": "(\\()\\?=",
"end": "(\\))",
"beginCaptures": {
"0": {
"name": "keyword.operator.lookahead.regexp"
},
"1": {
"name": "punctuation.parenthesis.lookahead.begin.regexp"
}
},
"endCaptures": {
"1": {
"name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.regexp"
},
"2": {
"name": "invalid.illegal.newline.python"
}
},
"patterns": [
{
"include": "#regexp-expression"
}
]
},
"regexp-lookahead-negative": {
"begin": "(\\()\\?!",
"end": "(\\))",
"beginCaptures": {
"0": {
"name": "keyword.operator.lookahead.negative.regexp"
},
"1": {
"name": "punctuation.parenthesis.lookahead.begin.regexp"
}
},
"endCaptures": {
"1": {
"name": "punctuation.parenthesis.lookahead.end.regexp keyword.operator.lookahead.negative.regexp"
},
"2": {
"name": "invalid.illegal.newline.python"
}
},
"patterns": [
{
"include": "#regexp-expression"
}
]
},
"regexp-lookbehind": {
"begin": "(\\()\\?<=",
"end": "(\\))",
"beginCaptures": {
"0": {
"name": "keyword.operator.lookbehind.regexp"
},
"1": {
"name": "punctuation.parenthesis.lookbehind.begin.regexp"
}
},
"endCaptures": {
"1": {
"name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.regexp"
},
"2": {
"name": "invalid.illegal.newline.python"
}
},
"patterns": [
{
"include": "#regexp-expression"
}
]
},
"regexp-lookbehind-negative": {
"begin": "(\\()\\?<!",
"end": "(\\))",
"beginCaptures": {
"0": {
"name": "keyword.operator.lookbehind.negative.regexp"
},
"1": {
"name": "punctuation.parenthesis.lookbehind.begin.regexp"
}
},
"endCaptures": {
"1": {
"name": "punctuation.parenthesis.lookbehind.end.regexp keyword.operator.lookbehind.negative.regexp"
},
"2": {
"name": "invalid.illegal.newline.python"
}
},
"patterns": [
{
"include": "#regexp-expression"
}
]
},
"regexp-conditional": {
"begin": "(\\()\\?\\((\\w+(?:\\s+[[:alnum:]]+)?|\\d+)\\)",
"end": "(\\))",
"beginCaptures": {
"0": {
"name": "keyword.operator.conditional.regexp"
},
"1": {
"name": "punctuation.parenthesis.conditional.begin.regexp"
}
},
"endCaptures": {
"1": {
"name": "punctuation.parenthesis.conditional.end.regexp keyword.operator.conditional.negative.regexp"
},
"2": {
"name": "invalid.illegal.newline.python"
}
},
"patterns": [
{
"include": "#regexp-expression"
}
]
},
"regexp-parentheses-non-capturing": {
"begin": "\\(\\?:",
"end": "(\\))",
"beginCaptures": {
"0": {
"name": "punctuation.parenthesis.non-capturing.begin.regexp support.other.parenthesis.regexp"
}
},
"endCaptures": {
"1": {
"name": "punctuation.parenthesis.non-capturing.end.regexp support.other.parenthesis.regexp"
},
"2": {
"name": "invalid.illegal.newline.python"
}
},
"patterns": [
{
"include": "#regexp-expression"
}
]
},
"regexp-parentheses": {
"begin": "\\(",
"end": "(\\))",
"beginCaptures": {
"0": {
"name": "punctuation.parenthesis.begin.regexp support.other.parenthesis.regexp"
}
},
"endCaptures": {
"1": {
"name": "punctuation.parenthesis.end.regexp support.other.parenthesis.regexp"
},
"2": {
"name": "invalid.illegal.newline.python"
}
},
"patterns": [
{
"include": "#regexp-expression"
}
]
}
},
"version": "https://github.com/MagicStack/MagicPython/commit/a45287d159f82256c768ad2e1114ca9751d28670"
}

475
lib/shiki-languages/data/grammars/Makefile.json

@ -0,0 +1,475 @@
{
"fileTypes": [
"Makefile",
"makefile",
"GNUmakefile",
"OCamlMakefile"
],
"name": "Makefile",
"patterns": [
{
"include": "#comment"
},
{
"include": "#variable-assignment"
},
{
"include": "#recipe"
},
{
"include": "#directives"
}
],
"repository": {
"comment": {
"begin": "(^[ \\t]+)?(?=#)",
"beginCaptures": {
"1": {
"name": "punctuation.whitespace.comment.leading.makefile"
}
},
"end": "(?!\\G)",
"patterns": [
{
"begin": "#",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.makefile"
}
},
"end": "\\n",
"name": "comment.line.number-sign.makefile",
"patterns": [
{
"match": "\\\\\\n",
"name": "constant.character.escape.continuation.makefile"
}
]
}
]
},
"directives": {
"patterns": [
{
"begin": "^[ ]*([s\\-]?include)\\b",
"beginCaptures": {
"1": {
"name": "keyword.control.include.makefile"
}
},
"end": "^",
"patterns": [
{
"include": "#comment"
},
{
"include": "#variables"
},
{
"match": "%",
"name": "constant.other.placeholder.makefile"
}
]
},
{
"begin": "^[ ]*(vpath)\\b",
"beginCaptures": {
"1": {
"name": "keyword.control.vpath.makefile"
}
},
"end": "^",
"patterns": [
{
"include": "#comment"
},
{
"include": "#variables"
},
{
"match": "%",
"name": "constant.other.placeholder.makefile"
}
]
},
{
"begin": "^(?:(override)\\s*)?(define)\\s*([^\\s]+)\\s*(=|\\?=|:=|\\+=)?(?=\\s)",
"captures": {
"1": {
"name": "keyword.control.override.makefile"
},
"2": {
"name": "keyword.control.define.makefile"
},
"3": {
"name": "variable.other.makefile"
},
"4": {
"name": "punctuation.separator.key-value.makefile"
}
},
"end": "^(endef)\\b",
"name": "meta.scope.conditional.makefile",
"patterns": [
{
"begin": "\\G(?!\\n)",
"end": "^",
"patterns": [
{
"include": "#comment"
}
]
},
{
"include": "#variables"
},
{
"include": "#comment"
}
]
},
{
"begin": "^[ ]*(export)\\b",
"beginCaptures": {
"1": {
"name": "keyword.control.$1.makefile"
}
},
"end": "^",
"patterns": [
{
"include": "#comment"
},
{
"include": "#variable-assignment"
},
{
"match": "[^\\s]+",
"name": "variable.other.makefile"
}
]
},
{
"begin": "^[ ]*(override|private)\\b",
"beginCaptures": {
"1": {
"name": "keyword.control.$1.makefile"
}
},
"end": "^",
"patterns": [
{
"include": "#comment"
},
{
"include": "#variable-assignment"
}
]
},
{
"begin": "^[ ]*(unexport|undefine)\\b",
"beginCaptures": {
"1": {
"name": "keyword.control.$1.makefile"
}
},
"end": "^",
"patterns": [
{
"include": "#comment"
},
{
"match": "[^\\s]+",
"name": "variable.other.makefile"
}
]
},
{
"begin": "^(ifdef|ifndef)\\s*([^\\s]+)(?=\\s)",
"captures": {
"1": {
"name": "keyword.control.$1.makefile"
},
"2": {
"name": "variable.other.makefile"
},
"3": {
"name": "punctuation.separator.key-value.makefile"
}
},
"end": "^(endif)\\b",
"name": "meta.scope.conditional.makefile",
"patterns": [
{
"begin": "\\G(?!\\n)",
"end": "^",
"patterns": [
{
"include": "#comment"
}
]
},
{
"include": "$self"
}
]
},
{
"begin": "^(ifeq|ifneq)(?=\\s)",
"captures": {
"1": {
"name": "keyword.control.$1.makefile"
}
},
"end": "^(endif)\\b",
"name": "meta.scope.conditional.makefile",
"patterns": [
{
"begin": "\\G",
"end": "^",
"name": "meta.scope.condition.makefile",
"patterns": [
{
"include": "#variables"
},
{
"include": "#comment"
}
]
},
{
"begin": "^else(?=\\s)",
"beginCaptures": {
"0": {
"name": "keyword.control.else.makefile"
}
},
"end": "^"
},
{
"include": "$self"
}
]
}
]
},
"interpolation": {
"begin": "(?=`)",
"end": "(?!\\G)",
"name": "meta.embedded.line.shell",
"patterns": [
{
"begin": "`",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.makefile"
}
},
"contentName": "source.shell",
"end": "(`)",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.makefile"
},
"1": {
"name": "source.shell"
}
},
"name": "string.interpolated.backtick.makefile",
"patterns": [
{
"include": "source.shell"
}
]
}
]
},
"recipe": {
"begin": "^(?!\\t)([^:]*)(:)(?!\\=)",
"beginCaptures": {
"1": {
"patterns": [
{
"captures": {
"1": {
"name": "support.function.target.$1.makefile"
}
},
"match": "^\\s*(\\.(PHONY|SUFFIXES|DEFAULT|PRECIOUS|INTERMEDIATE|SECONDARY|SECONDEXPANSION|DELETE_ON_ERROR|IGNORE|LOW_RESOLUTION_TIME|SILENT|EXPORT_ALL_VARIABLES|NOTPARALLEL|ONESHELL|POSIX))\\s*$"
},
{
"begin": "(?=\\S)",
"end": "(?=\\s|$)",
"name": "entity.name.function.target.makefile",
"patterns": [
{
"include": "#variables"
},
{
"match": "%",
"name": "constant.other.placeholder.makefile"
}
]
}
]
},
"2": {
"name": "punctuation.separator.key-value.makefile"
}
},
"end": "^(?!\\t)",
"name": "meta.scope.target.makefile",
"patterns": [
{
"begin": "\\G",
"end": "^",
"name": "meta.scope.prerequisites.makefile",
"patterns": [
{
"match": "\\\\\\n",
"name": "constant.character.escape.continuation.makefile"
},
{
"match": "%|\\*",
"name": "constant.other.placeholder.makefile"
},
{
"include": "#comment"
},
{
"include": "#variables"
}
]
},
{
"begin": "^\\t",
"name": "meta.scope.recipe.makefile",
"patterns": [
{
"captures": {
"0": {
"patterns": [
{
"match": "\\\\\\n",
"name": "constant.character.escape.continuation.makefile"
},
{
"include": "#variables"
},
{
"include": "source.shell"
}
]
}
},
"match": ".+\\n?"
}
],
"while": "^\\t"
}
]
},
"variable-assignment": {
"begin": "(^[ ]*|\\G\\s*)([^\\s]+)\\s*(=|\\?=|:=|\\+=)",
"beginCaptures": {
"2": {
"name": "variable.other.makefile"
},
"3": {
"name": "punctuation.separator.key-value.makefile"
}
},
"end": "\\n",
"patterns": [
{
"match": "\\\\\\n",
"name": "constant.character.escape.continuation.makefile"
},
{
"include": "#comment"
},
{
"include": "#variables"
},
{
"include": "#interpolation"
}
]
},
"variables": {
"patterns": [
{
"captures": {
"1": {
"name": "punctuation.definition.variable.makefile"
}
},
"match": "(\\$?\\$)[@%<?^+*]",
"name": "variable.language.makefile"
},
{
"begin": "\\$?\\$\\(",
"captures": {
"0": {
"name": "punctuation.definition.variable.makefile"
}
},
"end": "\\)",
"name": "string.interpolated.makefile",
"patterns": [
{
"include": "#variables"
},
{
"match": "\\G(MAKEFILES|VPATH|SHELL|MAKESHELL|MAKE|MAKELEVEL|MAKEFLAGS|MAKECMDGOALS|CURDIR|SUFFIXES|\\.LIBPATTERNS)(?=\\s*\\))",
"name": "variable.language.makefile"
},
{
"begin": "\\G(subst|patsubst|strip|findstring|filter(-out)?|sort|word(list)?|firstword|lastword|dir|notdir|suffix|basename|addsuffix|addprefix|join|wildcard|realpath|abspath|info|error|warning|shell|foreach|if|or|and|call|eval|value|file|guile)\\s",
"beginCaptures": {
"1": {
"name": "support.function.$1.makefile"
}
},
"end": "(?=\\))",
"name": "meta.scope.function-call.makefile",
"patterns": [
{
"include": "#variables"
},
{
"match": "%|\\*",
"name": "constant.other.placeholder.makefile"
}
]
},
{
"begin": "\\G(origin|flavor)\\s(?=[^\\s)]+\\s*\\))",
"contentName": "variable.other.makefile",
"end": "(?=\\))",
"name": "meta.scope.function-call.makefile",
"patterns": [
{
"include": "#variables"
}
]
},
{
"begin": "\\G(?!\\))",
"end": "(?=\\))",
"name": "variable.other.makefile",
"patterns": [
{
"include": "#variables"
}
]
}
]
}
]
}
},
"scopeName": "source.makefile",
"uuid": "FF1825E8-6B1C-11D9-B883-000D93589AF6",
"version": "https://github.com/textmate/make.tmbundle/commit/1a1827da81e20fdce56e2658451340c070ca44b7"
}

1432
lib/shiki-languages/data/grammars/Objective-C.tmLanguage

File diff suppressed because it is too large

490
lib/shiki-languages/data/grammars/Perl 6.tmLanguage

@ -0,0 +1,490 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>p6</string>
<string>pl6</string>
<string>pm6</string>
<string>nqp</string>
</array>
<key>firstLineMatch</key>
<string>(^#!.*\b(perl6|nqp)\b)|use\s+v6</string>
<key>keyEquivalent</key>
<string>^~P</string>
<key>name</key>
<string>Perl 6</string>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>^=begin</string>
<key>end</key>
<string>^=end</string>
<key>name</key>
<string>comment.block.perl</string>
</dict>
<dict>
<key>begin</key>
<string>(^[ \t]+)?(?=#)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.whitespace.comment.leading.perl</string>
</dict>
</dict>
<key>end</key>
<string>(?!\G)</string>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>#</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.perl</string>
</dict>
</dict>
<key>end</key>
<string>\n</string>
<key>name</key>
<string>comment.line.number-sign.perl</string>
</dict>
</array>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>storage.type.class.perl.6</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>entity.name.type.class.perl.6</string>
</dict>
</dict>
<key>match</key>
<string>(class|enum|grammar|knowhow|module|package|role|slang|subset)(\s+)(((?:::|')?(?:([a-zA-Z_\x{C0}-\x{FF}\$])([a-zA-Z0-9_\x{C0}-\x{FF}\\$]|[\-'][a-zA-Z0-9_\x{C0}-\x{FF}\$])*))+)</string>
<key>name</key>
<string>meta.class.perl.6</string>
</dict>
<dict>
<key>begin</key>
<string>(?&lt;=\s)'</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.perl</string>
</dict>
</dict>
<key>end</key>
<string>'</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.perl</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.single.perl</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\['\\]</string>
<key>name</key>
<string>constant.character.escape.perl</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>"</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.perl</string>
</dict>
</dict>
<key>end</key>
<string>"</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.perl</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.double.perl</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\[abtnfre"\\]</string>
<key>name</key>
<string>constant.character.escape.perl</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>q(q|to|heredoc)*\s*:?(q|to|heredoc)*\s*/(.+)/</string>
<key>end</key>
<string>\3</string>
<key>name</key>
<string>string.quoted.single.heredoc.perl</string>
</dict>
<dict>
<key>begin</key>
<string>(q|Q)(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*:?(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*{{</string>
<key>end</key>
<string>}}</string>
<key>name</key>
<string>string.quoted.double.heredoc.brace.perl</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#qq_brace_string_content</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(q|Q)(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*:?(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*\(\(</string>
<key>end</key>
<string>\)\)</string>
<key>name</key>
<string>string.quoted.double.heredoc.paren.perl</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#qq_paren_string_content</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(q|Q)(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*:?(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*\[\[</string>
<key>end</key>
<string>\]\]</string>
<key>name</key>
<string>string.quoted.double.heredoc.bracket.perl</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#qq_bracket_string_content</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(q|Q)(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*:?(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*{</string>
<key>end</key>
<string>}</string>
<key>name</key>
<string>string.quoted.single.heredoc.brace.perl</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#qq_brace_string_content</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(q|Q)(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*:?(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*/</string>
<key>end</key>
<string>/</string>
<key>name</key>
<string>string.quoted.single.heredoc.slash.perl</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#qq_slash_string_content</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(q|Q)(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*:?(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*\(</string>
<key>end</key>
<string>\)</string>
<key>name</key>
<string>string.quoted.single.heredoc.paren.perl</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#qq_paren_string_content</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(q|Q)(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*:?(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*\[</string>
<key>end</key>
<string>\]</string>
<key>name</key>
<string>string.quoted.single.heredoc.bracket.perl</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#qq_bracket_string_content</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(q|Q)(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*:?(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*'</string>
<key>end</key>
<string>'</string>
<key>name</key>
<string>string.quoted.single.heredoc.single.perl</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#qq_single_string_content</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(q|Q)(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*:?(x|exec|w|words|ww|quotewords|v|val|q|single|qq|double|s|scalar|a|array|h|hash|f|function|c|closure|b|blackslash|regexp|substr|trans|codes|p|path)*\s*"</string>
<key>end</key>
<string>"</string>
<key>name</key>
<string>string.quoted.single.heredoc.double.perl</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#qq_double_string_content</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\b\$\w+\b</string>
<key>name</key>
<string>variable.other.perl</string>
</dict>
<dict>
<key>match</key>
<string>\b(macro|sub|submethod|method|multi|proto|only|rule|token|regex|category)\b</string>
<key>name</key>
<string>storage.type.declare.routine.perl</string>
</dict>
<dict>
<key>match</key>
<string>\b(self)\b</string>
<key>name</key>
<string>variable.language.perl</string>
</dict>
<dict>
<key>match</key>
<string>\b(use|require)\b</string>
<key>name</key>
<string>keyword.other.include.perl</string>
</dict>
<dict>
<key>match</key>
<string>\b(if|else|elsif|unless)\b</string>
<key>name</key>
<string>keyword.control.conditional.perl</string>
</dict>
<dict>
<key>match</key>
<string>\b(let|my|our|state|temp|has|constant)\b</string>
<key>name</key>
<string>storage.type.variable.perl</string>
</dict>
<dict>
<key>match</key>
<string>\b(for|loop|repeat|while|until|gather|given)\b</string>
<key>name</key>
<string>keyword.control.repeat.perl</string>
</dict>
<dict>
<key>match</key>
<string>\b(take|do|when|next|last|redo|return|contend|maybe|defer|default|exit|make|continue|break|goto|leave|async|lift)\b</string>
<key>name</key>
<string>keyword.control.flowcontrol.perl</string>
</dict>
<dict>
<key>match</key>
<string>\b(is|as|but|trusts|of|returns|handles|where|augment|supersede)\b</string>
<key>name</key>
<string>storage.modifier.type.constraints.perl</string>
</dict>
<dict>
<key>match</key>
<string>\b(BEGIN|CHECK|INIT|START|FIRST|ENTER|LEAVE|KEEP|UNDO|NEXT|LAST|PRE|POST|END|CATCH|CONTROL|TEMP)\b</string>
<key>name</key>
<string>meta.function.perl</string>
</dict>
<dict>
<key>match</key>
<string>\b(die|fail|try|warn)\b</string>
<key>name</key>
<string>keyword.control.control-handlers.perl</string>
</dict>
<dict>
<key>match</key>
<string>\b(prec|irs|ofs|ors|export|deep|binary|unary|reparsed|rw|parsed|cached|readonly|defequiv|will|ref|copy|inline|tighter|looser|equiv|assoc|required)\b</string>
<key>name</key>
<string>storage.modifier.perl</string>
</dict>
<dict>
<key>match</key>
<string>\b(NaN|Inf)\b</string>
<key>name</key>
<string>constant.numeric.perl</string>
</dict>
<dict>
<key>match</key>
<string>\b(oo|fatal)\b</string>
<key>name</key>
<string>keyword.other.pragma.perl</string>
</dict>
<dict>
<key>match</key>
<string>\b(Object|Any|Junction|Whatever|Capture|MatchSignature|Proxy|Matcher|Package|Module|ClassGrammar|Scalar|Array|Hash|KeyHash|KeySet|KeyBagPair|List|Seq|Range|Set|Bag|Mapping|Void|UndefFailure|Exception|Code|Block|Routine|Sub|MacroMethod|Submethod|Regex|Str|str|Blob|Char|ByteCodepoint|Grapheme|StrPos|StrLen|Version|NumComplex|num|complex|Bit|bit|bool|True|FalseIncreasing|Decreasing|Ordered|Callable|AnyCharPositional|Associative|Ordering|KeyExtractorComparator|OrderingPair|IO|KitchenSink|RoleInt|int|int1|int2|int4|int8|int16|int32|int64Rat|rat|rat1|rat2|rat4|rat8|rat16|rat32|rat64Buf|buf|buf1|buf2|buf4|buf8|buf16|buf32|buf64UInt|uint|uint1|uint2|uint4|uint8|uint16|uint32uint64|Abstraction|utf8|utf16|utf32)\b</string>
<key>name</key>
<string>support.type.perl6</string>
</dict>
<dict>
<key>match</key>
<string>\b(div|xx|x|mod|also|leg|cmp|before|after|eq|ne|le|lt|not|gt|ge|eqv|ff|fff|and|andthen|or|xor|orelse|extra|lcm|gcd)\b</string>
<key>name</key>
<string>keyword.operator.perl</string>
</dict>
<dict>
<key>match</key>
<string>(\$|@|%|&amp;)(\*|:|!|\^|~|=|\?|(&lt;(?=.+&gt;)))?([a-zA-Z_\x{C0}-\x{FF}\$])([a-zA-Z0-9_\x{C0}-\x{FF}\$]|[\-'][a-zA-Z0-9_\x{C0}-\x{FF}\$])*</string>
<key>name</key>
<string>variable.other.identifier.perl.6</string>
</dict>
<dict>
<key>match</key>
<string>\b(eager|hyper|substr|index|rindex|grep|map|sort|join|lines|hints|chmod|split|reduce|min|max|reverse|truncate|zip|cat|roundrobin|classify|first|sum|keys|values|pairs|defined|delete|exists|elems|end|kv|any|all|one|wrap|shape|key|value|name|pop|push|shift|splice|unshift|floor|ceiling|abs|exp|log|log10|rand|sign|sqrt|sin|cos|tan|round|strand|roots|cis|unpolar|polar|atan2|pick|chop|p5chop|chomp|p5chomp|lc|lcfirst|uc|ucfirst|capitalize|normalize|pack|unpack|quotemeta|comb|samecase|sameaccent|chars|nfd|nfc|nfkd|nfkc|printf|sprintf|caller|evalfile|run|runinstead|nothing|want|bless|chr|ord|gmtime|time|eof|localtime|gethost|getpw|chroot|getlogin|getpeername|kill|fork|wait|perl|graphs|codes|bytes|clone|print|open|read|write|readline|say|seek|close|opendir|readdir|slurp|spurt|shell|run|pos|fmt|vec|link|unlink|symlink|uniq|pair|asin|atan|sec|cosec|cotan|asec|acosec|acotan|sinh|cosh|tanh|asinh|done|acos|acosh|atanh|sech|cosech|cotanh|sech|acosech|acotanh|asech|ok|nok|plan_ok|dies_ok|lives_ok|skip|todo|pass|flunk|force_todo|use_ok|isa_ok|diag|is_deeply|isnt|like|skip_rest|unlike|cmp_ok|eval_dies_ok|nok_error|eval_lives_ok|approx|is_approx|throws_ok|version_lt|plan|EVAL|succ|pred|times|nonce|once|signature|new|connect|operator|undef|undefine|sleep|from|to|infix|postfix|prefix|circumfix|postcircumfix|minmax|lazy|count|unwrap|getc|pi|e|context|void|quasi|body|each|contains|rewinddir|subst|can|isa|flush|arity|assuming|rewind|callwith|callsame|nextwith|nextsame|attr|eval_elsewhere|none|srand|trim|trim_start|trim_end|lastcall|WHAT|WHERE|HOW|WHICH|VAR|WHO|WHENCE|ACCEPTS|REJECTS|not|true|iterator|by|re|im|invert|flip|gist|flat|tree|is-prime|throws_like|trans)\b</string>
<key>name</key>
<string>support.function.perl</string>
</dict>
</array>
<key>repository</key>
<dict>
<key>qq_brace_string_content</key>
<dict>
<key>begin</key>
<string>{</string>
<key>end</key>
<string>}</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#qq_brace_string_content</string>
</dict>
</array>
</dict>
<key>qq_bracket_string_content</key>
<dict>
<key>begin</key>
<string>\[</string>
<key>end</key>
<string>\]</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#qq_bracket_string_content</string>
</dict>
</array>
</dict>
<key>qq_double_string_content</key>
<dict>
<key>begin</key>
<string>"</string>
<key>end</key>
<string>"</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#qq_double_string_content</string>
</dict>
</array>
</dict>
<key>qq_paren_string_content</key>
<dict>
<key>begin</key>
<string>\(</string>
<key>end</key>
<string>\)</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#qq_paren_string_content</string>
</dict>
</array>
</dict>
<key>qq_single_string_content</key>
<dict>
<key>begin</key>
<string>'</string>
<key>end</key>
<string>'</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#qq_single_string_content</string>
</dict>
</array>
</dict>
<key>qq_slash_string_content</key>
<dict>
<key>begin</key>
<string>\\/</string>
<key>end</key>
<string>\\/</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#qq_slash_string_content</string>
</dict>
</array>
</dict>
</dict>
<key>scopeName</key>
<string>source.perl.6</string>
<key>uuid</key>
<string>E685440C-0E20-4424-9693-864D5240A269</string>
</dict>
</plist>

3707
lib/shiki-languages/data/grammars/Perl.plist

File diff suppressed because it is too large

237
lib/shiki-languages/data/grammars/Platform.tmLanguage

File diff suppressed because one or more lines are too long

1186
lib/shiki-languages/data/grammars/PowershellSyntax.tmLanguage

File diff suppressed because it is too large

316
lib/shiki-languages/data/grammars/R.plist

@ -0,0 +1,316 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>R</string>
<string>r</string>
<string>s</string>
<string>S</string>
<string>Rprofile</string>
</array>
<key>keyEquivalent</key>
<string>^~R</string>
<key>name</key>
<string>R</string>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>comment.line.pragma.r</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>entity.name.pragma.name.r</string>
</dict>
</dict>
<key>match</key>
<string>^(#pragma[ \t]+mark)[ \t](.*)</string>
<key>name</key>
<string>comment.line.pragma-mark.r</string>
</dict>
<dict>
<key>begin</key>
<string>(^[ \t]+)?(?=#)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.whitespace.comment.leading.r</string>
</dict>
</dict>
<key>end</key>
<string>(?!\G)</string>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>#</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.r</string>
</dict>
</dict>
<key>end</key>
<string>\n</string>
<key>name</key>
<string>comment.line.number-sign.r</string>
</dict>
</array>
</dict>
<dict>
<key>match</key>
<string>\b(logical|numeric|character|complex|matrix|array|data\.frame|list|factor)(?=\s*\()</string>
<key>name</key>
<string>storage.type.r</string>
</dict>
<dict>
<key>match</key>
<string>\b(function|if|break|next|repeat|else|for|return|switch|while|in|invisible)\b</string>
<key>name</key>
<string>keyword.control.r</string>
</dict>
<dict>
<key>match</key>
<string>\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\.?[0-9]*)|(\.[0-9]+))((e|E)(\+|-)?[0-9]+)?)(i|L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\b</string>
<key>name</key>
<string>constant.numeric.r</string>
</dict>
<dict>
<key>match</key>
<string>\b(T|F|TRUE|FALSE|NULL|NA|Inf|NaN)\b</string>
<key>name</key>
<string>constant.language.r</string>
</dict>
<dict>
<key>match</key>
<string>\b(pi|letters|LETTERS|month\.abb|month\.name)\b</string>
<key>name</key>
<string>support.constant.misc.r</string>
</dict>
<dict>
<key>match</key>
<string>(\-|\+|\*|\/|%\/%|%%|%\*%|%in%|%o%|%x%|\^)</string>
<key>name</key>
<string>keyword.operator.arithmetic.r</string>
</dict>
<dict>
<key>match</key>
<string>(=|&lt;-|&lt;&lt;-|-&gt;|-&gt;&gt;)</string>
<key>name</key>
<string>keyword.operator.assignment.r</string>
</dict>
<dict>
<key>match</key>
<string>(==|!=|&lt;&gt;|&lt;|&gt;|&lt;=|&gt;=)</string>
<key>name</key>
<string>keyword.operator.comparison.r</string>
</dict>
<dict>
<key>match</key>
<string>(!|&amp;{1,2}|[|]{1,2})</string>
<key>name</key>
<string>keyword.operator.logical.r</string>
</dict>
<dict>
<key>match</key>
<string>(\.\.\.|\$|@|:|\~)</string>
<key>name</key>
<string>keyword.other.r</string>
</dict>
<dict>
<key>begin</key>
<string>"</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.r</string>
</dict>
</dict>
<key>end</key>
<string>"</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.r</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.double.r</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>constant.character.escape.r</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>'</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.r</string>
</dict>
</dict>
<key>end</key>
<string>'</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.r</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.single.r</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>constant.character.escape.r</string>
</dict>
</array>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>entity.name.function.r</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.operator.assignment.r</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>keyword.control.r</string>
</dict>
</dict>
<key>match</key>
<string>([[:alpha:].][[:alnum:]._]*)\s*(&lt;-)\s*(function)</string>
<key>name</key>
<string>meta.function.r</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>entity.name.tag.r</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>entity.name.type.r</string>
</dict>
</dict>
<key>match</key>
<string>(setMethod|setReplaceMethod|setGeneric|setGroupGeneric|setClass)\s*\(\s*([[:alpha:]\d]+\s*=\s*)?("|\x{27})([a-zA-Z._\[\$@][a-zA-Z0-9._\[]*?)\3.*</string>
<key>name</key>
<string>meta.method.declaration.r</string>
</dict>
<dict>
<key>match</key>
<string>([[:alpha:].][[:alnum:]._]*)\s*\(</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>variable.parameter.r</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.operator.assignment.r</string>
</dict>
</dict>
<key>match</key>
<string>([[:alpha:].][[:alnum:]._]*)\s*(=)(?=[^=])</string>
</dict>
<dict>
<key>match</key>
<string>\b([\d_][[:alnum:]._]+)\b</string>
<key>name</key>
<string>invalid.illegal.variable.other.r</string>
</dict>
<dict>
<key>match</key>
<string>\b([[:alnum:]_]+)(?=::)</string>
<key>name</key>
<string>entity.namespace.r</string>
</dict>
<dict>
<key>match</key>
<string>\b([[:alnum:]._]+)\b</string>
<key>name</key>
<string>variable.other.r</string>
</dict>
<dict>
<key>begin</key>
<string>\{</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.section.block.begin.r</string>
</dict>
</dict>
<key>end</key>
<string>\}</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.section.block.end.r</string>
</dict>
</dict>
<key>name</key>
<string>meta.block.r</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>source.r</string>
</dict>
</array>
</dict>
</array>
<key>scopeName</key>
<string>source.r</string>
<key>uuid</key>
<string>B2E6B78D-6E70-11D9-A369-000D93B3A10E</string>
</dict>
</plist>

237
lib/shiki-languages/data/grammars/Regular Expressions (JavaScript).tmLanguage

@ -0,0 +1,237 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array/>
<key>hideFromUser</key>
<true/>
<key>name</key>
<string>Regular Expressions (JavaScript)</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#regexp</string>
</dict>
</array>
<key>repository</key>
<dict>
<key>regex-character-class</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\[wWsSdD]|\.</string>
<key>name</key>
<string>constant.character.character-class.regexp</string>
</dict>
<dict>
<key>match</key>
<string>\\([0-7]{3}|x\h\h|u\h\h\h\h)</string>
<key>name</key>
<string>constant.character.numeric.regexp</string>
</dict>
<dict>
<key>match</key>
<string>\\c[A-Z]</string>
<key>name</key>
<string>constant.character.control.regexp</string>
</dict>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>constant.character.escape.backslash.regexp</string>
</dict>
</array>
</dict>
<key>regexp</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\[bB]|\^|\$</string>
<key>name</key>
<string>keyword.control.anchor.regexp</string>
</dict>
<dict>
<key>match</key>
<string>\\[1-9]\d*</string>
<key>name</key>
<string>keyword.other.back-reference.regexp</string>
</dict>
<dict>
<key>match</key>
<string>[?+*]|\{(\d+,\d+|\d+,|,\d+|\d+)\}\??</string>
<key>name</key>
<string>keyword.operator.quantifier.regexp</string>
</dict>
<dict>
<key>match</key>
<string>\|</string>
<key>name</key>
<string>keyword.operator.or.regexp</string>
</dict>
<dict>
<key>begin</key>
<string>(\()((\?=)|(\?!))</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.group.regexp</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>meta.assertion.look-ahead.regexp</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>meta.assertion.negative-look-ahead.regexp</string>
</dict>
</dict>
<key>end</key>
<string>(\))</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.group.regexp</string>
</dict>
</dict>
<key>name</key>
<string>meta.group.assertion.regexp</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#regexp</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>\((\?:)?</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.group.regexp</string>
</dict>
</dict>
<key>end</key>
<string>\)</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.group.regexp</string>
</dict>
</dict>
<key>name</key>
<string>meta.group.regexp</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#regexp</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(\[)(\^)?</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.character-class.regexp</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.operator.negation.regexp</string>
</dict>
</dict>
<key>end</key>
<string>(\])</string>
<key>endCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.character-class.regexp</string>
</dict>
</dict>
<key>name</key>
<string>constant.other.character-class.set.regexp</string>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>constant.character.numeric.regexp</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>constant.character.control.regexp</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>constant.character.escape.backslash.regexp</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>constant.character.numeric.regexp</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>constant.character.control.regexp</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>constant.character.escape.backslash.regexp</string>
</dict>
</dict>
<key>match</key>
<string>(?:.|(\\(?:[0-7]{3}|x\h\h|u\h\h\h\h))|(\\c[A-Z])|(\\.))\-(?:[^\]\\]|(\\(?:[0-7]{3}|x\h\h|u\h\h\h\h))|(\\c[A-Z])|(\\.))</string>
<key>name</key>
<string>constant.other.character-class.range.regexp</string>
</dict>
<dict>
<key>include</key>
<string>#regex-character-class</string>
</dict>
</array>
</dict>
<dict>
<key>include</key>
<string>#regex-character-class</string>
</dict>
</array>
</dict>
</dict>
<key>scopeName</key>
<string>source.js.regexp</string>
<key>uuid</key>
<string>AC8679DE-3AC7-4056-84F9-69A7ADC29DDD</string>
</dict>
</plist>

4092
lib/shiki-languages/data/grammars/Ruby.plist

File diff suppressed because it is too large

767
lib/shiki-languages/data/grammars/SQL.plist

@ -0,0 +1,767 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>sql</string>
<string>ddl</string>
<string>dml</string>
<string>dsql</string>
<string>psql</string>
</array>
<key>keyEquivalent</key>
<string>^~S</string>
<key>name</key>
<string>SQL</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#comments</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.create.sql</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.other.sql</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>entity.name.function.sql</string>
</dict>
</dict>
<key>match</key>
<string>(?i:^\s*(create(?:\s+or\s+replace)?)\s+(aggregate|conversion|database|domain|function|group|(unique\s+)?index|language|operator class|operator|rule|schema|sequence|table|tablespace|trigger|type|user|view)\s+)(['"`]?)(\w+)\4</string>
<key>name</key>
<string>meta.create.sql</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.create.sql</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.other.sql</string>
</dict>
</dict>
<key>match</key>
<string>(?i:^\s*(drop)\s+(aggregate|conversion|database|domain|function|group|index|language|operator class|operator|rule|schema|sequence|table|tablespace|trigger|type|user|view))</string>
<key>name</key>
<string>meta.drop.sql</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.create.sql</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.other.table.sql</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>entity.name.function.sql</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>keyword.other.cascade.sql</string>
</dict>
</dict>
<key>match</key>
<string>(?i:\s*(drop)\s+(table)\s+(\w+)(\s+cascade)?\b)</string>
<key>name</key>
<string>meta.drop.sql</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.create.sql</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>keyword.other.table.sql</string>
</dict>
</dict>
<key>match</key>
<string>(?i:^\s*(alter)\s+(aggregate|conversion|database|domain|function|group|index|language|operator class|operator|rule|schema|sequence|table|tablespace|trigger|type|user|view)\s+)</string>
<key>name</key>
<string>meta.alter.sql</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>storage.type.sql</string>
</dict>
<key>10</key>
<dict>
<key>name</key>
<string>constant.numeric.sql</string>
</dict>
<key>11</key>
<dict>
<key>name</key>
<string>storage.type.sql</string>
</dict>
<key>12</key>
<dict>
<key>name</key>
<string>storage.type.sql</string>
</dict>
<key>13</key>
<dict>
<key>name</key>
<string>storage.type.sql</string>
</dict>
<key>14</key>
<dict>
<key>name</key>
<string>constant.numeric.sql</string>
</dict>
<key>15</key>
<dict>
<key>name</key>
<string>storage.type.sql</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>storage.type.sql</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>constant.numeric.sql</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>storage.type.sql</string>
</dict>
<key>5</key>
<dict>
<key>name</key>
<string>constant.numeric.sql</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>storage.type.sql</string>
</dict>
<key>7</key>
<dict>
<key>name</key>
<string>constant.numeric.sql</string>
</dict>
<key>8</key>
<dict>
<key>name</key>
<string>constant.numeric.sql</string>
</dict>
<key>9</key>
<dict>
<key>name</key>
<string>storage.type.sql</string>
</dict>
</dict>
<key>match</key>
<string>(?xi)
# normal stuff, capture 1
\b(bigint|bigserial|bit|boolean|box|bytea|cidr|circle|date|double\sprecision|inet|int|integer|line|lseg|macaddr|money|oid|path|point|polygon|real|serial|smallint|sysdate|text)\b
# numeric suffix, capture 2 + 3i
|\b(bit\svarying|character\s(?:varying)?|tinyint|var\schar|float|interval)\((\d+)\)
# optional numeric suffix, capture 4 + 5i
|\b(char|number|varchar\d?)\b(?:\((\d+)\))?
# special case, capture 6 + 7i + 8i
|\b(numeric|decimal)\b(?:\((\d+),(\d+)\))?
# special case, captures 9, 10i, 11
|\b(times?)\b(?:\((\d+)\))?(\swith(?:out)?\stime\szone\b)?
# special case, captures 12, 13, 14i, 15
|\b(timestamp)(?:(s|tz))?\b(?:\((\d+)\))?(\s(with|without)\stime\szone\b)?
</string>
</dict>
<dict>
<key>match</key>
<string>(?i:\b((?:primary|foreign)\s+key|references|on\sdelete(\s+cascade)?|check|constraint)\b)</string>
<key>name</key>
<string>storage.modifier.sql</string>
</dict>
<dict>
<key>match</key>
<string>\b\d+\b</string>
<key>name</key>
<string>constant.numeric.sql</string>
</dict>
<dict>
<key>match</key>
<string>(?i:\b(select(\s+distinct)?|insert\s+(ignore\s+)?into|update|delete|from|declare|set|where|group\sby|or|like|and|union(\s+all)?|having|order\sby|limit|(inner|cross)\s+join|join|straight_join|(left|right)(\s+outer)?\s+join|natural(\s+(left|right)(\s+outer)?)?\s+join)\b)</string>
<key>name</key>
<string>keyword.other.DML.sql</string>
</dict>
<dict>
<key>match</key>
<string>(?i:\b(on|((is\s+)?not\s+)?null)\b)</string>
<key>name</key>
<string>keyword.other.DDL.create.II.sql</string>
</dict>
<dict>
<key>match</key>
<string>(?i:\b(values|go|use|into|exec|execute|openquery)\b)</string>
<key>name</key>
<string>keyword.other.DML.II.sql</string>
</dict>
<dict>
<key>match</key>
<string>(?i:\b(begin(\s+work)?|start\s+transaction|commit(\s+work)?|rollback(\s+work)?)\b)</string>
<key>name</key>
<string>keyword.other.LUW.sql</string>
</dict>
<dict>
<key>match</key>
<string>(?i:\b(grant(\swith\sgrant\soption)?|revoke)\b)</string>
<key>name</key>
<string>keyword.other.authorization.sql</string>
</dict>
<dict>
<key>match</key>
<string>(?i:\bin\b)</string>
<key>name</key>
<string>keyword.other.data-integrity.sql</string>
</dict>
<dict>
<key>match</key>
<string>(?i:^\s*(comment\s+on\s+(table|column|aggregate|constraint|database|domain|function|index|operator|rule|schema|sequence|trigger|type|view))\s+.*?\s+(is)\s+)</string>
<key>name</key>
<string>keyword.other.object-comments.sql</string>
</dict>
<dict>
<key>match</key>
<string>(?i)\bAS\b</string>
<key>name</key>
<string>keyword.other.alias.sql</string>
</dict>
<dict>
<key>match</key>
<string>(?i)\b(DESC|ASC)\b</string>
<key>name</key>
<string>keyword.other.order.sql</string>
</dict>
<dict>
<key>match</key>
<string>\*</string>
<key>name</key>
<string>keyword.operator.star.sql</string>
</dict>
<dict>
<key>match</key>
<string>[!&lt;&gt;]?=|&lt;&gt;|&lt;|&gt;</string>
<key>name</key>
<string>keyword.operator.comparison.sql</string>
</dict>
<dict>
<key>match</key>
<string>-|\+|/</string>
<key>name</key>
<string>keyword.operator.math.sql</string>
</dict>
<dict>
<key>match</key>
<string>\|\|</string>
<key>name</key>
<string>keyword.operator.concatenator.sql</string>
</dict>
<dict>
<key>comment</key>
<string>List of SQL99 built-in functions from http://www.oreilly.com/catalog/sqlnut/chapter/ch04.html</string>
<key>match</key>
<string>(?i)\b(CURRENT_(DATE|TIME(STAMP)?|USER)|(SESSION|SYSTEM)_USER)\b</string>
<key>name</key>
<string>support.function.scalar.sql</string>
</dict>
<dict>
<key>comment</key>
<string>List of SQL99 built-in functions from http://www.oreilly.com/catalog/sqlnut/chapter/ch04.html</string>
<key>match</key>
<string>(?i)\b(AVG|COUNT|MIN|MAX|SUM)(?=\s*\()</string>
<key>name</key>
<string>support.function.aggregate.sql</string>
</dict>
<dict>
<key>match</key>
<string>(?i)\b(CONCATENATE|CONVERT|LOWER|SUBSTRING|TRANSLATE|TRIM|UPPER)\b</string>
<key>name</key>
<string>support.function.string.sql</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>constant.other.database-name.sql</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>constant.other.table-name.sql</string>
</dict>
</dict>
<key>match</key>
<string>(\w+?)\.(\w+)</string>
</dict>
<dict>
<key>include</key>
<string>#strings</string>
</dict>
<dict>
<key>include</key>
<string>#regexps</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.section.scope.begin.sql</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.section.scope.end.sql</string>
</dict>
</dict>
<key>comment</key>
<string>Allow for special ↩ behavior</string>
<key>match</key>
<string>(\()(\))</string>
<key>name</key>
<string>meta.block.sql</string>
</dict>
</array>
<key>repository</key>
<dict>
<key>comments</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>(^[ \t]+)?(?=--)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.whitespace.comment.leading.sql</string>
</dict>
</dict>
<key>end</key>
<string>(?!\G)</string>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>--</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.sql</string>
</dict>
</dict>
<key>end</key>
<string>\n</string>
<key>name</key>
<string>comment.line.double-dash.sql</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(^[ \t]+)?(?=#)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.whitespace.comment.leading.sql</string>
</dict>
</dict>
<key>end</key>
<string>(?!\G)</string>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>#</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.sql</string>
</dict>
</dict>
<key>end</key>
<string>\n</string>
<key>name</key>
<string>comment.line.number-sign.sql</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>/\*</string>
<key>captures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.sql</string>
</dict>
</dict>
<key>end</key>
<string>\*/</string>
<key>name</key>
<string>comment.block.c</string>
</dict>
</array>
</dict>
<key>regexps</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>/(?=\S.*/)</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.sql</string>
</dict>
</dict>
<key>end</key>
<string>/</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.sql</string>
</dict>
</dict>
<key>name</key>
<string>string.regexp.sql</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#string_interpolation</string>
</dict>
<dict>
<key>match</key>
<string>\\/</string>
<key>name</key>
<string>constant.character.escape.slash.sql</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>%r\{</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.sql</string>
</dict>
</dict>
<key>comment</key>
<string>We should probably handle nested bracket pairs!?! -- Allan</string>
<key>end</key>
<string>\}</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.sql</string>
</dict>
</dict>
<key>name</key>
<string>string.regexp.modr.sql</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#string_interpolation</string>
</dict>
</array>
</dict>
</array>
</dict>
<key>string_escape</key>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>constant.character.escape.sql</string>
</dict>
<key>string_interpolation</key>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.sql</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.sql</string>
</dict>
</dict>
<key>match</key>
<string>(#\{)([^\}]*)(\})</string>
<key>name</key>
<string>string.interpolated.sql</string>
</dict>
<key>strings</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.sql</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.sql</string>
</dict>
</dict>
<key>comment</key>
<string>this is faster than the next begin/end rule since sub-pattern will match till end-of-line and SQL files tend to have very long lines.</string>
<key>match</key>
<string>(')[^'\\]*(')</string>
<key>name</key>
<string>string.quoted.single.sql</string>
</dict>
<dict>
<key>begin</key>
<string>'</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.sql</string>
</dict>
</dict>
<key>end</key>
<string>'</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.sql</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.single.sql</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#string_escape</string>
</dict>
</array>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.sql</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.sql</string>
</dict>
</dict>
<key>comment</key>
<string>this is faster than the next begin/end rule since sub-pattern will match till end-of-line and SQL files tend to have very long lines.</string>
<key>match</key>
<string>(`)[^`\\]*(`)</string>
<key>name</key>
<string>string.quoted.other.backtick.sql</string>
</dict>
<dict>
<key>begin</key>
<string>`</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.sql</string>
</dict>
</dict>
<key>end</key>
<string>`</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.sql</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.other.backtick.sql</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#string_escape</string>
</dict>
</array>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.sql</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.sql</string>
</dict>
</dict>
<key>comment</key>
<string>this is faster than the next begin/end rule since sub-pattern will match till end-of-line and SQL files tend to have very long lines.</string>
<key>match</key>
<string>(")[^"#]*(")</string>
<key>name</key>
<string>string.quoted.double.sql</string>
</dict>
<dict>
<key>begin</key>
<string>"</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.sql</string>
</dict>
</dict>
<key>end</key>
<string>"</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.sql</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.double.sql</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#string_interpolation</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>%\{</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.sql</string>
</dict>
</dict>
<key>end</key>
<string>\}</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.sql</string>
</dict>
</dict>
<key>name</key>
<string>string.other.quoted.brackets.sql</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#string_interpolation</string>
</dict>
</array>
</dict>
</array>
</dict>
</dict>
<key>scopeName</key>
<string>source.sql</string>
<key>uuid</key>
<string>C49120AC-6ECC-11D9-ACC8-000D93589AF6</string>
</dict>
</plist>

1231
lib/shiki-languages/data/grammars/Shell-Unix-Bash.tmLanguage.json

File diff suppressed because it is too large

3303
lib/shiki-languages/data/grammars/TypeScript.tmLanguage.json

File diff suppressed because one or more lines are too long

3574
lib/shiki-languages/data/grammars/TypeScriptReact.tmLanguage.json

File diff suppressed because one or more lines are too long

455
lib/shiki-languages/data/grammars/c++.json

@ -0,0 +1,455 @@
{
"scopeName": "source.cpp",
"fileTypes": [
"cc",
"cpp",
"cp",
"cxx",
"c++",
"cu",
"cuh",
"h",
"hh",
"hpp",
"hxx",
"h++",
"inl",
"ino",
"ipp",
"tcc",
"tpp"
],
"firstLineMatch": "(?i)-\\*-[^*]*(Mode:\\s*)?C\\+\\+(\\s*;.*?)?\\s*-\\*-",
"name": "C++",
"patterns": [
{
"include": "#special_block"
},
{
"include": "#strings"
},
{
"match": "\\b(friend|explicit|virtual|override|final|noexcept)\\b",
"name": "storage.modifier.cpp"
},
{
"match": "\\b(private:|protected:|public:)",
"name": "storage.modifier.cpp"
},
{
"match": "\\b(catch|operator|try|throw|using)\\b",
"name": "keyword.control.cpp"
},
{
"match": "\\bdelete\\b(\\s*\\[\\])?|\\bnew\\b(?!])",
"name": "keyword.control.cpp"
},
{
"match": "\\b(f|m)[A-Z]\\w*\\b",
"name": "variable.other.readwrite.member.cpp"
},
{
"match": "\\bthis\\b",
"name": "variable.language.this.cpp"
},
{
"match": "\\bnullptr\\b",
"name": "variable.language.cpp"
},
{
"match": "\\btemplate\\b\\s*",
"name": "storage.type.template.cpp"
},
{
"match": "\\b(const_cast|dynamic_cast|reinterpret_cast|static_cast)\\b\\s*",
"name": "keyword.operator.cast.cpp"
},
{
"match": "\\b(and|and_eq|bitand|bitor|compl|not|not_eq|or|or_eq|typeid|xor|xor_eq|alignof|alignas)\\b",
"name": "keyword.operator.cpp"
},
{
"match": "\\b(class|decltype|wchar_t|char16_t|char32_t)\\b",
"name": "storage.type.cpp"
},
{
"match": "\\b(constexpr|export|mutable|typename|thread_local)\\b",
"name": "storage.modifier.cpp"
},
{
"begin": "(?x)\n(?:\n ^ | # beginning of line\n (?:(?<!else|new|=)) # or word + space before name\n)\n((?:[A-Za-z_][A-Za-z0-9_]*::)*+~[A-Za-z_][A-Za-z0-9_]*) # actual name\n\\s*(\\() # opening bracket",
"beginCaptures": {
"1": {
"name": "entity.name.function.cpp"
},
"2": {
"name": "punctuation.definition.parameters.begin.c"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.definition.parameters.end.c"
}
},
"name": "meta.function.destructor.cpp",
"patterns": [
{
"include": "$base"
}
]
},
{
"begin": "(?x)\n(?:\n ^ | # beginning of line\n (?:(?<!else|new|=)) # or word + space before name\n)\n((?:[A-Za-z_][A-Za-z0-9_]*::)*+~[A-Za-z_][A-Za-z0-9_]*) # actual name\n\\s*(\\() # opening bracket",
"beginCaptures": {
"1": {
"name": "entity.name.function.cpp"
},
"2": {
"name": "punctuation.definition.parameters.begin.c"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.definition.parameters.end.c"
}
},
"name": "meta.function.destructor.prototype.cpp",
"patterns": [
{
"include": "$base"
}
]
},
{
"include": "source.c"
}
],
"repository": {
"angle_brackets": {
"begin": "<",
"end": ">",
"name": "meta.angle-brackets.cpp",
"patterns": [
{
"include": "#angle_brackets"
},
{
"include": "$base"
}
]
},
"block": {
"begin": "\\{",
"beginCaptures": {
"0": {
"name": "punctuation.section.block.begin.c"
}
},
"end": "\\}",
"endCaptures": {
"0": {
"name": "punctuation.section.block.end.c"
}
},
"name": "meta.block.cpp",
"patterns": [
{
"captures": {
"1": {
"name": "support.function.any-method.c"
},
"2": {
"name": "punctuation.definition.parameters.c"
}
},
"match": "(?x)\n(\n (?!while|for|do|if|else|switch|catch|enumerate|return|r?iterate)\n (?:\\b[A-Za-z_][A-Za-z0-9_]*+\\b|::)*+ # actual name\n)\n\\s*(\\() # opening bracket",
"name": "meta.function-call.c"
},
{
"include": "$base"
}
]
},
"constructor": {
"patterns": [
{
"begin": "(?x)\n(?:^\\s*) # beginning of line\n((?!while|for|do|if|else|switch|catch|enumerate|r?iterate)[A-Za-z_][A-Za-z0-9_:]*) # actual name\n\\s*(\\() # opening bracket",
"beginCaptures": {
"1": {
"name": "entity.name.function.cpp"
},
"2": {
"name": "punctuation.definition.parameters.begin.c"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.definition.parameters.end.c"
}
},
"name": "meta.function.constructor.cpp",
"patterns": [
{
"include": "$base"
}
]
},
{
"begin": "(?x)\n(:)\n(\n (?=\n \\s*[A-Za-z_][A-Za-z0-9_:]* # actual name\n \\s* (\\() # opening bracket\n )\n)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.parameters.c"
}
},
"end": "(?=\\{)",
"name": "meta.function.constructor.initializer-list.cpp",
"patterns": [
{
"include": "$base"
}
]
}
]
},
"special_block": {
"patterns": [
{
"begin": "\\b(using)\\b\\s*(namespace)\\b\\s*((?:[_A-Za-z][_A-Za-z0-9]*\\b(::)?)*)",
"beginCaptures": {
"1": {
"name": "keyword.control.cpp"
},
"2": {
"name": "storage.type.cpp"
},
"3": {
"name": "entity.name.type.cpp"
}
},
"end": "(;)",
"name": "meta.using-namespace-declaration.cpp"
},
{
"begin": "\\b(namespace)\\b\\s*([_A-Za-z][_A-Za-z0-9]*\\b)?+",
"beginCaptures": {
"1": {
"name": "storage.type.cpp"
},
"2": {
"name": "entity.name.type.cpp"
}
},
"captures": {
"1": {
"name": "keyword.control.namespace.$2"
}
},
"end": "(?<=\\})|(?=(;|,|\\(|\\)|>|\\[|\\]|=))",
"name": "meta.namespace-block.cpp",
"patterns": [
{
"begin": "\\{",
"beginCaptures": {
"0": {
"name": "punctuation.definition.scope.cpp"
}
},
"end": "\\}",
"endCaptures": {
"0": {
"name": "punctuation.definition.scope.cpp"
}
},
"patterns": [
{
"include": "#special_block"
},
{
"include": "#constructor"
},
{
"include": "$base"
}
]
},
{
"include": "$base"
}
]
},
{
"begin": "\\b(class|struct)\\b\\s*([_A-Za-z][_A-Za-z0-9]*\\b)?+(\\s*:\\s*(public|protected|private)\\s*([_A-Za-z][_A-Za-z0-9]*\\b)((\\s*,\\s*(public|protected|private)\\s*[_A-Za-z][_A-Za-z0-9]*\\b)*))?",
"beginCaptures": {
"1": {
"name": "storage.type.cpp"
},
"2": {
"name": "entity.name.type.cpp"
},
"4": {
"name": "storage.type.modifier.cpp"
},
"5": {
"name": "entity.name.type.inherited.cpp"
},
"6": {
"patterns": [
{
"match": "(public|protected|private)",
"name": "storage.type.modifier.cpp"
},
{
"match": "[_A-Za-z][_A-Za-z0-9]*",
"name": "entity.name.type.inherited.cpp"
}
]
}
},
"end": "(?<=\\})|(?=(;|\\(|\\)|>|\\[|\\]|=))",
"name": "meta.class-struct-block.cpp",
"patterns": [
{
"include": "#angle_brackets"
},
{
"begin": "\\{",
"beginCaptures": {
"0": {
"name": "punctuation.section.block.begin.cpp"
}
},
"end": "(\\})(\\s*\\n)?",
"endCaptures": {
"1": {
"name": "punctuation.section.block.end.cpp"
},
"2": {
"name": "invalid.illegal.you-forgot-semicolon.cpp"
}
},
"patterns": [
{
"include": "#special_block"
},
{
"include": "#constructor"
},
{
"include": "$base"
}
]
},
{
"include": "$base"
}
]
},
{
"begin": "\\b(extern)(?=\\s*\")",
"beginCaptures": {
"1": {
"name": "storage.modifier.cpp"
}
},
"end": "(?<=\\})|(?=\\w)|(?=\\s*#\\s*endif\\b)",
"name": "meta.extern-block.cpp",
"patterns": [
{
"begin": "\\{",
"beginCaptures": {
"0": {
"name": "punctuation.section.block.begin.c"
}
},
"end": "\\}|(?=\\s*#\\s*endif\\b)",
"endCaptures": {
"0": {
"name": "punctuation.section.block.end.c"
}
},
"patterns": [
{
"include": "#special_block"
},
{
"include": "$base"
}
]
},
{
"include": "$base"
}
]
}
]
},
"strings": {
"patterns": [
{
"begin": "(u|u8|U|L)?\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.cpp"
},
"1": {
"name": "meta.encoding.cpp"
}
},
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.cpp"
}
},
"name": "string.quoted.double.cpp",
"patterns": [
{
"match": "\\\\u\\h{4}|\\\\U\\h{8}",
"name": "constant.character.escape.cpp"
},
{
"match": "\\\\['\"?\\\\abfnrtv]",
"name": "constant.character.escape.cpp"
},
{
"match": "\\\\[0-7]{1,3}",
"name": "constant.character.escape.cpp"
},
{
"match": "\\\\x\\h+",
"name": "constant.character.escape.cpp"
}
]
},
{
"begin": "(u|u8|U|L)?R\"(?:([^ ()\\\\\\t]{0,16})|([^ ()\\\\\\t]*))\\(",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.cpp"
},
"1": {
"name": "meta.encoding.cpp"
},
"3": {
"name": "invalid.illegal.delimiter-too-long.cpp"
}
},
"end": "\\)\\2(\\3)\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.cpp"
},
"1": {
"name": "invalid.illegal.delimiter-too-long.cpp"
}
},
"name": "string.quoted.double.raw.cpp"
}
]
}
},
"version": "https://github.com/atom/language-c/commit/80db38512efabb3030d600a8d8f8b6d91abbc96b"
}

980
lib/shiki-languages/data/grammars/c.json

@ -0,0 +1,980 @@
{
"scopeName": "source.c",
"fileTypes": [
"c",
"h.in"
],
"firstLineMatch": "(?i)-\\*-[^*]*(Mode:\\s*)?C(\\s*;.*?)?\\s*-\\*-",
"name": "C",
"patterns": [
{
"include": "#preprocessor-rule-enabled"
},
{
"include": "#preprocessor-rule-disabled"
},
{
"include": "#preprocessor-rule-other"
},
{
"include": "#comments"
},
{
"match": "\\b(break|case|continue|default|do|else|for|goto|if|_Pragma|return|switch|while)\\b",
"name": "keyword.control.c"
},
{
"match": "\\b(asm|__asm__|auto|bool|_Bool|char|_Complex|double|enum|float|_Imaginary|int|long|short|signed|struct|typedef|union|unsigned|void)\\b",
"name": "storage.type.c"
},
{
"match": "\\b(const|extern|register|restrict|static|volatile|inline)\\b",
"name": "storage.modifier.c"
},
{
"match": "\\bk[A-Z]\\w*\\b",
"name": "constant.other.variable.mac-classic.c"
},
{
"match": "\\bg[A-Z]\\w*\\b",
"name": "variable.other.readwrite.global.mac-classic.c"
},
{
"match": "\\bs[A-Z]\\w*\\b",
"name": "variable.other.readwrite.static.mac-classic.c"
},
{
"match": "\\b(NULL|true|false|TRUE|FALSE)\\b",
"name": "constant.language.c"
},
{
"include": "#operators"
},
{
"include": "#numbers"
},
{
"include": "#strings"
},
{
"begin": "(?x)\n^\\s* ((\\#)\\s*define) \\s+ # define\n((?<id>[a-zA-Z_$][\\w$]*)) # macro name\n(?:\n (\\()\n (\n \\s* \\g<id> \\s* # first argument\n ((,) \\s* \\g<id> \\s*)* # additional arguments\n (?:\\.\\.\\.)? # varargs ellipsis?\n )\n (\\))\n)?",
"beginCaptures": {
"1": {
"name": "keyword.control.directive.define.c"
},
"2": {
"name": "punctuation.definition.directive.c"
},
"3": {
"name": "entity.name.function.preprocessor.c"
},
"5": {
"name": "punctuation.definition.parameters.begin.c"
},
"6": {
"name": "variable.parameter.preprocessor.c"
},
"8": {
"name": "punctuation.separator.parameters.c"
},
"9": {
"name": "punctuation.definition.parameters.end.c"
}
},
"end": "(?=(?://|/\\*))|(?<!\\\\)(?=\\n)",
"name": "meta.preprocessor.macro.c",
"patterns": [
{
"include": "$base"
}
]
},
{
"begin": "^\\s*((#)\\s*(error|warning))\\b",
"captures": {
"1": {
"name": "keyword.control.directive.diagnostic.$3.c"
},
"2": {
"name": "punctuation.definition.directive.c"
}
},
"end": "(?<!\\\\)(?=\\n)",
"name": "meta.preprocessor.diagnostic.c",
"patterns": [
{
"include": "#line_continuation_character"
}
]
},
{
"begin": "^\\s*((#)\\s*(include|import))\\b\\s*",
"beginCaptures": {
"1": {
"name": "keyword.control.directive.$3.c"
},
"2": {
"name": "punctuation.definition.directive.c"
}
},
"end": "(?=(?://|/\\*))|(?<!\\\\)(?=\\n)",
"name": "meta.preprocessor.include.c",
"patterns": [
{
"include": "#line_continuation_character"
},
{
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.c"
}
},
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.c"
}
},
"name": "string.quoted.double.include.c"
},
{
"begin": "<",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.c"
}
},
"end": ">",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.c"
}
},
"name": "string.quoted.other.lt-gt.include.c"
}
]
},
{
"include": "#pragma-mark"
},
{
"begin": "^\\s*((#)\\s*line)\\b",
"beginCaptures": {
"1": {
"name": "keyword.control.directive.line.c"
},
"2": {
"name": "punctuation.definition.directive.c"
}
},
"end": "(?=(?://|/\\*))|(?<!\\\\)(?=\\n)",
"name": "meta.preprocessor.c",
"patterns": [
{
"include": "#strings"
},
{
"include": "#numbers"
},
{
"include": "#line_continuation_character"
}
]
},
{
"begin": "^\\s*(?:((#)\\s*(?:elif|else|if|ifdef|ifndef))|((#)\\s*(pragma|undef)))\\b",
"beginCaptures": {
"1": {
"name": "keyword.control.directive.conditional.c"
},
"2": {
"name": "punctuation.definition.directive.c"
},
"3": {
"name": "keyword.control.directive.$5.c"
},
"4": {
"name": "punctuation.definition.directive.c"
}
},
"end": "(?=(?://|/\\*))|(?<!\\\\)(?=\\n)",
"name": "meta.preprocessor.c",
"patterns": [
{
"include": "#line_continuation_character"
}
]
},
{
"match": "\\b(u_char|u_short|u_int|u_long|ushort|uint|u_quad_t|quad_t|qaddr_t|caddr_t|daddr_t|dev_t|fixpt_t|blkcnt_t|blksize_t|gid_t|in_addr_t|in_port_t|ino_t|key_t|mode_t|nlink_t|id_t|pid_t|off_t|segsz_t|swblk_t|uid_t|id_t|clock_t|size_t|ssize_t|time_t|useconds_t|suseconds_t)\\b",
"name": "support.type.sys-types.c"
},
{
"match": "\\b(pthread_attr_t|pthread_cond_t|pthread_condattr_t|pthread_mutex_t|pthread_mutexattr_t|pthread_once_t|pthread_rwlock_t|pthread_rwlockattr_t|pthread_t|pthread_key_t)\\b",
"name": "support.type.pthread.c"
},
{
"match": "(?x) \\b\n(int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|int_least8_t\n|int_least16_t|int_least32_t|int_least64_t|uint_least8_t|uint_least16_t|uint_least32_t\n|uint_least64_t|int_fast8_t|int_fast16_t|int_fast32_t|int_fast64_t|uint_fast8_t\n|uint_fast16_t|uint_fast32_t|uint_fast64_t|intptr_t|uintptr_t|intmax_t|intmax_t\n|uintmax_t|uintmax_t)\n\\b",
"name": "support.type.stdint.c"
},
{
"match": "\\b(noErr|kNilOptions|kInvalidID|kVariableLengthArray)\\b",
"name": "support.constant.mac-classic.c"
},
{
"match": "(?x) \\b\n(AbsoluteTime|Boolean|Byte|ByteCount|ByteOffset|BytePtr|CompTimeValue|ConstLogicalAddress|ConstStrFileNameParam\n|ConstStringPtr|Duration|Fixed|FixedPtr|Float32|Float32Point|Float64|Float80|Float96|FourCharCode|Fract|FractPtr\n|Handle|ItemCount|LogicalAddress|OptionBits|OSErr|OSStatus|OSType|OSTypePtr|PhysicalAddress|ProcessSerialNumber\n|ProcessSerialNumberPtr|ProcHandle|Ptr|ResType|ResTypePtr|ShortFixed|ShortFixedPtr|SignedByte|SInt16|SInt32|SInt64\n|SInt8|Size|StrFileName|StringHandle|StringPtr|TimeBase|TimeRecord|TimeScale|TimeValue|TimeValue64|UInt16|UInt32\n|UInt64|UInt8|UniChar|UniCharCount|UniCharCountPtr|UniCharPtr|UnicodeScalarValue|UniversalProcHandle|UniversalProcPtr\n|UnsignedFixed|UnsignedFixedPtr|UnsignedWide|UTF16Char|UTF32Char|UTF8Char)\n\\b",
"name": "support.type.mac-classic.c"
},
{
"match": "\\b([A-Za-z0-9_]+_t)\\b",
"name": "support.type.posix-reserved.c"
},
{
"include": "#block"
},
{
"begin": "(?x)\n(?:\n ^ |\n (?:\n (?=\\s)(?<!else|new|return)(?<=\\w) # word + space before name\n |\n (?=\\s*[A-Za-z_])(?<!&&)(?<=[*&>]) # type modifier before name\n )\n)\n(\\s*)(?!(while|for|do|if|else|switch|catch|enumerate|return|sizeof|[cr]?iterate)\\s*\\()\n(\n (?:[A-Za-z_][A-Za-z0-9_]*+|::)++ # actual name\n |\n (?:(?<=operator)(?:[-*&<>=+!]+|\\(\\)|\\[\\]))\n)\n\\s*(?=\\()",
"beginCaptures": {
"1": {
"name": "punctuation.whitespace.function.leading.c"
},
"3": {
"name": "entity.name.function.c"
},
"4": {
"name": "punctuation.definition.parameters.c"
}
},
"end": "(?<=\\})|(?=#)|(;)",
"name": "meta.function.c",
"patterns": [
{
"include": "#comments"
},
{
"include": "#parens"
},
{
"match": "\\b(const)\\b",
"name": "storage.modifier.c"
},
{
"include": "#block"
}
]
},
{
"include": "#line_continuation_character"
}
],
"repository": {
"access": {
"captures": {
"2": {
"name": "punctuation.separator.dot-access.c"
},
"3": {
"name": "punctuation.separator.pointer-access.c"
},
"4": {
"name": "variable.other.member.c"
}
},
"match": "((\\.)|(->))([a-zA-Z_][a-zA-Z_0-9]*)\\b(?!\\s*\\()"
},
"block": {
"patterns": [
{
"begin": "\\{",
"beginCaptures": {
"0": {
"name": "punctuation.section.block.begin.c"
}
},
"end": "\\}|(?=\\s*#\\s*endif\\b)",
"endCaptures": {
"0": {
"name": "punctuation.section.block.end.c"
}
},
"name": "meta.block.c",
"patterns": [
{
"include": "#block_innards"
}
]
}
]
},
"block_innards": {
"patterns": [
{
"include": "#preprocessor-rule-enabled-block"
},
{
"include": "#preprocessor-rule-disabled-block"
},
{
"include": "#preprocessor-rule-other-block"
},
{
"include": "#sizeof"
},
{
"include": "#access"
},
{
"include": "#libc"
},
{
"include": "#c_function_call"
},
{
"captures": {
"1": {
"name": "variable.other.c"
},
"2": {
"name": "punctuation.definition.parameters.c"
}
},
"match": "(?x)\n(?:\n (?:\n (?=\\s)(?<!else|new|return)\n (?<=\\w) \\s+ # or word + space before name\n )\n)\n(\n (?:[A-Za-z_][A-Za-z0-9_]*+ | :: )++ # actual name\n |\n (?:(?<=operator) (?:[-*&<>=+!]+ | \\(\\) | \\[\\]))\n)\n\\s*(\\() # opening bracket",
"name": "meta.initialization.c"
},
{
"include": "#block"
},
{
"include": "$base"
}
]
},
"c_function_call": {
"captures": {
"1": {
"name": "punctuation.whitespace.function-call.leading.c"
},
"2": {
"name": "support.function.any-method.c"
},
"4": {
"name": "punctuation.definition.parameters.c"
}
},
"match": "(?x)\n(?:\n (?=\\s)\n (?:(?<=else|new|return) | (?<!\\w)) (\\s+)\n)?\n\n# Actual name\n(\n \\b\n (?!\n (while|for|do|if|else|switch|catch|enumerate|return|sizeof|r?iterate)\n \\s* \\(\n )\n (?:(?!NS)[A-Za-z_][A-Za-z0-9_]*+\\b | ::)++\n)\n\\s*(\\() # Opening bracket",
"name": "meta.function-call.c"
},
"comments": {
"patterns": [
{
"captures": {
"1": {
"name": "meta.toc-list.banner.block.c"
}
},
"match": "^/\\* =(\\s*.*?)\\s*= \\*/$\\n?",
"name": "comment.block.c"
},
{
"begin": "/\\*",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.begin.c"
}
},
"end": "\\*/",
"endCaptures": {
"0": {
"name": "punctuation.definition.comment.end.c"
}
},
"name": "comment.block.c"
},
{
"match": "\\*/.*\\n",
"name": "invalid.illegal.stray-comment-end.c"
},
{
"captures": {
"1": {
"name": "meta.toc-list.banner.line.c"
}
},
"match": "^// =(\\s*.*?)\\s*=\\s*$\\n?",
"name": "comment.line.banner.cpp"
},
{
"begin": "(^[ \\t]+)?(?=//)",
"beginCaptures": {
"1": {
"name": "punctuation.whitespace.comment.leading.cpp"
}
},
"end": "(?!\\G)",
"patterns": [
{
"begin": "//",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.cpp"
}
},
"end": "\\n",
"name": "comment.line.double-slash.cpp",
"patterns": [
{
"include": "#line_continuation_character"
}
]
}
]
}
]
},
"disabled": {
"begin": "^\\s*#\\s*if(n?def)?\\b.*$",
"end": "^\\s*#\\s*endif\\b",
"patterns": [
{
"include": "#disabled"
},
{
"include": "#pragma-mark"
}
]
},
"libc": {
"captures": {
"1": {
"name": "punctuation.whitespace.support.function.leading.c"
},
"2": {
"name": "support.function.C99.c"
}
},
"match": "(?x) (\\s*) \\b\n(_Exit|(?:nearbyint|nextafter|nexttoward|netoward|nan)[fl]?|a(?:cos|sin)h?[fl]?|abort|abs|asctime|assert\n|atan(?:[h2]?[fl]?)?|atexit|ato[ifl]|atoll|bsearch|btowc|cabs[fl]?|cacos|cacos[fl]|cacosh[fl]?\n|calloc|carg[fl]?|casinh?[fl]?|catanh?[fl]?|cbrt[fl]?|ccosh?[fl]?|ceil[fl]?|cexp[fl]?|cimag[fl]?\n|clearerr|clock|clog[fl]?|conj[fl]?|copysign[fl]?|cosh?[fl]?|cpow[fl]?|cproj[fl]?|creal[fl]?\n|csinh?[fl]?|csqrt[fl]?|ctanh?[fl]?|ctime|difftime|div|erfc?[fl]?|exit|fabs[fl]?\n|exp(?:2[fl]?|[fl]|m1[fl]?)?|fclose|fdim[fl]?|fe[gs]et(?:env|exceptflag|round)|feclearexcept\n|feholdexcept|feof|feraiseexcept|ferror|fetestexcept|feupdateenv|fflush|fgetpos|fgetw?[sc]\n|floor[fl]?|fmax?[fl]?|fmin[fl]?|fmod[fl]?|fopen|fpclassify|fprintf|fputw?[sc]|fread|free|freopen\n|frexp[fl]?|fscanf|fseek|fsetpos|ftell|fwide|fwprintf|fwrite|fwscanf|genv|get[sc]|getchar|gmtime\n|gwc|gwchar|hypot[fl]?|ilogb[fl]?|imaxabs|imaxdiv|isalnum|isalpha|isblank|iscntrl|isdigit|isfinite\n|isgraph|isgreater|isgreaterequal|isinf|isless(?:equal|greater)?|isw?lower|isnan|isnormal|isw?print\n|isw?punct|isw?space|isunordered|isw?upper|iswalnum|iswalpha|iswblank|iswcntrl|iswctype|iswdigit|iswgraph\n|isw?xdigit|labs|ldexp[fl]?|ldiv|lgamma[fl]?|llabs|lldiv|llrint[fl]?|llround[fl]?|localeconv|localtime\n|log[2b]?[fl]?|log1[p0][fl]?|longjmp|lrint[fl]?|lround[fl]?|malloc|mbr?len|mbr?towc|mbsinit|mbsrtowcs\n|mbstowcs|memchr|memcmp|memcpy|memmove|memset|mktime|modf[fl]?|perror|pow[fl]?|printf|puts|putw?c(?:har)?\n|qsort|raise|rand|remainder[fl]?|realloc|remove|remquo[fl]?|rename|rewind|rint[fl]?|round[fl]?|scalbl?n[fl]?\n|scanf|setbuf|setjmp|setlocale|setvbuf|signal|signbit|sinh?[fl]?|snprintf|sprintf|sqrt[fl]?|srand|sscanf\n|strcat|strchr|strcmp|strcoll|strcpy|strcspn|strerror|strftime|strlen|strncat|strncmp|strncpy|strpbrk\n|strrchr|strspn|strstr|strto[kdf]|strtoimax|strtol[dl]?|strtoull?|strtoumax|strxfrm|swprintf|swscanf\n|system|tan|tan[fl]|tanh[fl]?|tgamma[fl]?|time|tmpfile|tmpnam|tolower|toupper|trunc[fl]?|ungetw?c|va_arg\n|va_copy|va_end|va_start|vfw?printf|vfw?scanf|vprintf|vscanf|vsnprintf|vsprintf|vsscanf|vswprintf|vswscanf\n|vwprintf|vwscanf|wcrtomb|wcscat|wcschr|wcscmp|wcscoll|wcscpy|wcscspn|wcsftime|wcslen|wcsncat|wcsncmp|wcsncpy\n|wcspbrk|wcsrchr|wcsrtombs|wcsspn|wcsstr|wcsto[dkf]|wcstoimax|wcstol[dl]?|wcstombs|wcstoull?|wcstoumax|wcsxfrm\n|wctom?b|wmem(?:set|chr|cpy|cmp|move)|wprintf|wscanf)\\b"
},
"line_continuation_character": {
"patterns": [
{
"match": "(\\\\)\\s*\\n",
"captures": {
"1": {
"name": "constant.character.escape.line-continuation.c"
}
}
}
]
},
"numbers": {
"patterns": [
{
"match": "\\b((0(x|X)[0-9a-fA-F]*)|(0(b|B)[01]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)(L|l|UL|ul|u|U|F|f|ll|LL|ull|ULL)?\\b",
"name": "constant.numeric.c"
}
]
},
"parens": {
"begin": "\\(",
"beginCaptures": {
"0": {
"name": "punctuation.section.parens.begin.c"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.section.parens.end.c"
}
},
"name": "meta.parens.c",
"patterns": [
{
"include": "$base"
}
]
},
"pragma-mark": {
"captures": {
"1": {
"name": "meta.preprocessor.c"
},
"2": {
"name": "keyword.control.directive.pragma.pragma-mark.c"
},
"3": {
"name": "punctuation.definition.directive.c"
},
"4": {
"name": "meta.toc-list.pragma-mark.c"
}
},
"match": "^\\s*(((#)\\s*pragma\\s+mark)\\s+(.*))",
"name": "meta.section"
},
"preprocessor-rule-disabled": {
"begin": "^\\s*(((#)if)\\s+(0)\\b).*",
"beginCaptures": {
"1": {
"name": "meta.preprocessor.c"
},
"2": {
"name": "keyword.control.directive.conditional.c"
},
"3": {
"name": "punctuation.definition.directive.c"
},
"4": {
"name": "constant.numeric.preprocessor.c"
}
},
"end": "^\\s*(((#)\\s*endif)\\b)",
"endCaptures": {
"1": {
"name": "meta.preprocessor.c"
},
"2": {
"name": "keyword.control.directive.conditional.c"
},
"3": {
"name": "punctuation.definition.directive.c"
}
},
"patterns": [
{
"begin": "^\\s*(((#)\\s*else)\\b)",
"beginCaptures": {
"1": {
"name": "meta.preprocessor.c"
},
"2": {
"name": "keyword.control.directive.conditional.c"
},
"3": {
"name": "punctuation.definition.directive.c"
}
},
"end": "(?=^\\s*#\\s*endif\\b)",
"patterns": [
{
"include": "$base"
}
]
},
{
"begin": "\\G",
"end": "(?=^\\s*#\\s*(else|endif)\\b)",
"contentName": "comment.block.preprocessor.if-branch",
"patterns": [
{
"include": "#disabled"
},
{
"include": "#pragma-mark"
}
]
}
]
},
"preprocessor-rule-disabled-block": {
"begin": "^\\s*(((#)if)\\s+(0)\\b).*",
"beginCaptures": {
"1": {
"name": "meta.preprocessor.c"
},
"2": {
"name": "keyword.control.directive.conditional.c"
},
"3": {
"name": "punctuation.definition.directive.c"
},
"4": {
"name": "constant.numeric.preprocessor.c"
}
},
"end": "^\\s*(((#)\\s*endif)\\b)",
"endCaptures": {
"1": {
"name": "meta.preprocessor.c"
},
"2": {
"name": "keyword.control.directive.conditional.c"
},
"3": {
"name": "punctuation.definition.directive.c"
}
},
"patterns": [
{
"begin": "^\\s*(((#)\\s*else\\b))",
"beginCaptures": {
"1": {
"name": "meta.preprocessor.c"
},
"2": {
"name": "keyword.control.directive.conditional.c"
},
"3": {
"name": "punctuation.definition.directive.c"
}
},
"end": "(?=^\\s*#\\s*endif\\b)",
"patterns": [
{
"include": "#block_innards"
}
]
},
{
"begin": "\\G",
"end": "(?=^\\s*#\\s*(else|endif)\\b)",
"contentName": "comment.block.preprocessor.if-branch.in-block",
"patterns": [
{
"include": "#disabled"
},
{
"include": "#pragma-mark"
}
]
}
]
},
"preprocessor-rule-enabled": {
"begin": "^\\s*(((#)if)\\s+(0*1)\\b)",
"beginCaptures": {
"1": {
"name": "meta.preprocessor.c"
},
"2": {
"name": "keyword.control.directive.conditional.c"
},
"3": {
"name": "punctuation.definition.directive.c"
},
"4": {
"name": "constant.numeric.preprocessor.c"
}
},
"end": "^\\s*(((#)\\s*endif)\\b)",
"endCaptures": {
"1": {
"name": "meta.preprocessor.c"
},
"2": {
"name": "keyword.control.directive.conditional.c"
},
"3": {
"name": "punctuation.definition.directive.c"
}
},
"patterns": [
{
"begin": "^\\s*(((#)\\s*else)\\b).*",
"beginCaptures": {
"1": {
"name": "meta.preprocessor.c"
},
"2": {
"name": "keyword.control.directive.conditional.c"
},
"3": {
"name": "punctuation.definition.directive.c"
}
},
"contentName": "comment.block.preprocessor.else-branch",
"end": "(?=^\\s*#\\s*endif\\b)",
"patterns": [
{
"include": "#disabled"
},
{
"include": "#pragma-mark"
}
]
},
{
"begin": "\\G",
"end": "(?=^\\s*#\\s*(else|endif)\\b)",
"patterns": [
{
"include": "$base"
}
]
}
]
},
"preprocessor-rule-enabled-block": {
"begin": "^\\s*(((#)if)\\s+(0*1)\\b)",
"beginCaptures": {
"1": {
"name": "meta.preprocessor.c"
},
"2": {
"name": "keyword.control.directive.conditional.c"
},
"3": {
"name": "punctuation.definition.directive.c"
},
"4": {
"name": "constant.numeric.preprocessor.c"
}
},
"end": "^\\s*(((#)\\s*endif)\\b)",
"endCaptures": {
"1": {
"name": "meta.preprocessor.c"
},
"2": {
"name": "keyword.control.directive.conditional.c"
},
"3": {
"name": "punctuation.definition.directive.c"
}
},
"patterns": [
{
"begin": "^\\s*(((#)\\s*else)\\b).*",
"beginCaptures": {
"1": {
"name": "meta.preprocessor.c"
},
"2": {
"name": "keyword.control.directive.conditional.c"
},
"3": {
"name": "punctuation.definition.directive.c"
}
},
"contentName": "comment.block.preprocessor.else-branch.in-block",
"end": "(?=^\\s*#\\s*endif\\b)",
"patterns": [
{
"include": "#disabled"
},
{
"include": "#pragma-mark"
}
]
},
{
"begin": "\\G",
"end": "(?=^\\s*#\\s*(else|endif)\\b)",
"patterns": [
{
"include": "#block_innards"
}
]
}
]
},
"preprocessor-rule-other": {
"begin": "^\\s*(((#)\\s*if(n?def)?)\\b.*?(?:(?=(?://|/\\*))|$))",
"beginCaptures": {
"1": {
"name": "meta.preprocessor.c"
},
"2": {
"name": "keyword.control.directive.conditional.c"
},
"3": {
"name": "punctuation.definition.directive.c"
}
},
"end": "^\\s*(((#)\\s*(endif))\\b)",
"endCaptures": {
"1": {
"name": "meta.preprocessor.c"
},
"2": {
"name": "keyword.control.directive.conditional.c"
},
"3": {
"name": "punctuation.definition.directive.c"
}
},
"patterns": [
{
"include": "$base"
}
]
},
"preprocessor-rule-other-block": {
"begin": "^\\s*(((#)\\s*if(n?def)?)\\b.*?(?:(?=(?://|/\\*))|$))",
"beginCaptures": {
"1": {
"name": "meta.preprocessor.c"
},
"2": {
"name": "keyword.control.directive.conditional.c"
},
"3": {
"name": "punctuation.definition.directive.c"
}
},
"end": "^\\s*(((#)\\s*endif)\\b)",
"endCaptures": {
"1": {
"name": "meta.preprocessor.c"
},
"2": {
"name": "keyword.control.directive.conditional.c"
},
"3": {
"name": "punctuation.definition.directive.c"
}
},
"patterns": [
{
"include": "#block_innards"
}
]
},
"operators": {
"patterns": [
{
"match": "(?<![\\w$])(sizeof)(?![\\w$])",
"name": "keyword.operator.sizeof.c"
},
{
"match": "--",
"name": "keyword.operator.decrement.c"
},
{
"match": "\\+\\+",
"name": "keyword.operator.increment.c"
},
{
"match": "%=|\\+=|-=|\\*=|(?<!\\()/=",
"name": "keyword.operator.assignment.compound.c"
},
{
"match": "&=|\\^=|<<=|>>=|\\|=",
"name": "keyword.operator.assignment.compound.bitwise.c"
},
{
"match": "<<|>>",
"name": "keyword.operator.bitwise.shift.c"
},
{
"match": "!=|<=|>=|==|<|>",
"name": "keyword.operator.comparison.c"
},
{
"match": "&&|!|\\|\\|",
"name": "keyword.operator.logical.c"
},
{
"match": "&|\\||\\^|~",
"name": "keyword.operator.c"
},
{
"match": "=",
"name": "keyword.operator.assignment.c"
},
{
"match": "%|\\*|/|-|\\+",
"name": "keyword.operator.c"
},
{
"begin": "\\?",
"beginCaptures": {
"0": {
"name": "keyword.operator.ternary.c"
}
},
"end": ":",
"endCaptures": {
"0": {
"name": "keyword.operator.ternary.c"
}
},
"patterns": [
{
"include": "$self"
}
]
}
]
},
"strings": {
"patterns": [
{
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.c"
}
},
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.c"
}
},
"name": "string.quoted.double.c",
"patterns": [
{
"include": "#string_escaped_char"
},
{
"include": "#string_placeholder"
},
{
"include": "#line_continuation_character"
}
]
},
{
"begin": "'",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.c"
}
},
"end": "'",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.c"
}
},
"name": "string.quoted.single.c",
"patterns": [
{
"include": "#string_escaped_char"
},
{
"include": "#line_continuation_character"
}
]
}
]
},
"string_escaped_char": {
"patterns": [
{
"match": "(?x)\\\\ (\n\\\\ |\n[abefnprtv'\"?] |\n[0-3]\\d{,2} |\n[4-7]\\d? |\nx[a-fA-F0-9]{,2} |\nu[a-fA-F0-9]{,4} |\nU[a-fA-F0-9]{,8} )",
"name": "constant.character.escape.c"
},
{
"match": "\\\\.",
"name": "invalid.illegal.unknown-escape.c"
}
]
},
"string_placeholder": {
"patterns": [
{
"match": "(?x) %\n(\\d+\\$)? # field (argument #)\n[#0\\- +']* # flags\n[,;:_]? # separator character (AltiVec)\n((-?\\d+)|\\*(-?\\d+\\$)?)? # minimum field width\n(\\.((-?\\d+)|\\*(-?\\d+\\$)?)?)? # precision\n(hh|h|ll|l|j|t|z|q|L|vh|vl|v|hv|hl)? # length modifier\n[diouxXDOUeEfFgGaACcSspn%] # conversion type",
"name": "constant.other.placeholder.c"
},
{
"match": "%",
"name": "invalid.illegal.placeholder.c"
}
]
}
},
"version": "https://github.com/atom/language-c/commit/2a5fafe1d86f690b5ab2c877cea2fc6a598e001a"
}

668
lib/shiki-languages/data/grammars/coffeescript.json

@ -0,0 +1,668 @@
{
"comment": "CoffeeScript",
"fileTypes": [
"coffee",
"Cakefile",
"coffee.erb",
"cake",
"cjsx",
"cson",
"iced"
],
"injections": {
"string.regexp.block.coffee": {
"patterns": [
{
"include": "#interpolated_coffee"
},
{
"include": "#embedded_comment"
}
]
}
},
"keyEquivalent": "^~C",
"name": "CoffeeScript",
"patterns": [
{
"captures": {
"1": {
"name": "punctuation.definition.parameters.begin.coffee"
},
"2": {
"patterns": [
{
"captures": {
"1": {
"name": "variable.parameter.function.coffee"
},
"2": {
"name": "punctuation.separator.key-value.coffee"
},
"3": {
"name": "string.quoted.double.coffee"
},
"4": {
"name": "punctuation.definition.string.begin.coffee"
},
"5": {
"name": "punctuation.definition.string.end.coffee"
},
"6": {
"name": "string.quoted.single.coffee"
},
"7": {
"name": "punctuation.definition.string.begin.coffee"
},
"8": {
"name": "punctuation.definition.string.end.coffee"
}
},
"match": "(?x)\n\t\t\t\t\t\t\t\t([^()\\s,]+)\n\t\t\t\t\t\t\t\t\\s+(=)\\s+\n\t\t\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\t\t((\")[^\"]*(\"))\n\t\t\t\t\t\t\t\t | ((')[^']*('))\n\t\t\t\t\t\t\t\t)"
},
{
"match": "[^()\\s,]+",
"name": "variable.parameter.function.coffee"
},
{
"match": ",",
"name": "punctuation.separator.arguments.coffee"
}
]
},
"3": {
"name": "punctuation.definition.parameters.begin.coffee"
},
"4": {
"name": "storage.type.function.coffee"
}
},
"comment": "match stuff like: a -> … ",
"match": "(\\()([^()]*?)(\\))\\s*([=-]>)",
"name": "meta.inline.function.coffee"
},
{
"captures": {
"1": {
"name": "keyword.operator.new.coffee"
},
"4": {
"name": "storage.type.class.coffee"
},
"6": {
"name": "entity.name.type.instance.coffee"
},
"7": {
"name": "entity.name.type.instance.coffee"
}
},
"match": "(new)\\s+(((class)(\\s+(\\w+(?:\\.\\w*)*))?)|(\\w+(?:\\.\\w*)*))",
"name": "meta.class.instance.constructor"
},
{
"begin": "'''",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.coffee"
}
},
"end": "'''",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.coffee"
}
},
"name": "string.unquoted.heredoc.coffee"
},
{
"begin": "\"\"\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.coffee"
}
},
"end": "\"\"\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.coffee"
}
},
"name": "string.quoted.double.heredoc.coffee",
"patterns": [
{
"match": "\\\\.",
"name": "constant.character.escape.coffee"
},
{
"include": "#interpolated_coffee"
}
]
},
{
"begin": "(?=`)",
"end": "(?<=`)",
"name": "meta.embedded.line.coffee",
"patterns": [
{
"begin": "`",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.coffee"
}
},
"contentName": "source.js",
"end": "(`)",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.coffee"
},
"1": {
"name": "source.js"
}
},
"name": "string.other.embedded.javascript.coffee",
"patterns": [
{
"include": "source.js"
}
]
}
]
},
{
"begin": "(?<!#)###(?!#)",
"captures": {
"0": {
"name": "punctuation.definition.comment.coffee"
}
},
"end": "###(?:[ \\t]*\\n)",
"name": "comment.block.coffee",
"patterns": [
{
"match": "(?<=^|\\s)@\\w*(?=\\s)",
"name": "storage.type.annotation.coffeescript"
}
]
},
{
"begin": "(^[ \\t]+)?(?=#)",
"beginCaptures": {
"1": {
"name": "punctuation.whitespace.comment.leading.coffee"
}
},
"end": "(?!\\G)",
"patterns": [
{
"begin": "#",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.coffee"
}
},
"end": "\\n",
"name": "comment.line.number-sign.coffee"
}
]
},
{
"begin": "/{3}",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.coffee"
}
},
"end": "(/{3})[imgy]{0,4}",
"endCaptures": {
"1": {
"name": "punctuation.definition.string.end.coffee"
}
},
"name": "string.regexp.block.coffee",
"patterns": [
{
"include": "source.js.regexp"
}
]
},
{
"begin": "/(?![\\s=/*+{}?])",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.coffee"
}
},
"end": "(/)[igmy]{0,4}(?![a-zA-Z0-9])",
"endCaptures": {
"1": {
"name": "punctuation.definition.string.end.coffee"
}
},
"name": "string.regexp.coffee",
"patterns": [
{
"include": "source.js.regexp"
}
]
},
{
"match": "(?x)\n\t\t\t\t\\b\n\t\t\t\t(?<![\\.\\$])\n\t\t\t\t(\n\t\t\t\t\tbreak\n\t\t\t\t | by\n\t\t\t\t | catch\n\t\t\t\t | continue\n\t\t\t\t | else\n\t\t\t\t | finally\n\t\t\t\t | for\n\t\t\t\t | in\n\t\t\t\t | of\n\t\t\t\t | if\n\t\t\t\t | return\n\t\t\t\t | switch\n\t\t\t\t | then\n\t\t\t\t | throw\n\t\t\t\t | try\n\t\t\t\t | unless\n\t\t\t\t | when\n\t\t\t\t | while\n\t\t\t\t | until\n\t\t\t\t | loop\n\t\t\t\t | do\n\t\t\t\t | (?<=for)\\s+own\n\t\t\t\t)\n\t\t\t\t(?!\\s*:)\n\t\t\t\t\\b\n\t\t\t",
"name": "keyword.control.coffee"
},
{
"match": "(?x)\n (and|or|<<|>>>?|(?<!\\()\\/|[=!<>*%+\\-&^])?=(?!>)\n | [!%^*\\/~?:]\n | \\-?\\-(?!>)\n | \\+\\+?\n | <>\n | <\n | >\n | &&?\n | \\.\\.\\.?\n | \\|\\|?\n | \\b(?<![\\.\\$])(instanceof|new|delete|typeof|and|or|is|isnt|not|super)(?!\\s*:)\\b\n\t\t\t",
"name": "keyword.operator.coffee"
},
{
"match": "(?x)\n\t\t\t\t\\b\n\t\t\t\t(?<![\\.\\$])\n\t\t\t\t(\n\t\t\t\t\t case\n | default\n | function\n | var\n | void\n | with\n | const\n | let\n | enum\n | export\n | import\n | native\n | __hasProp\n | __extends\n | __slice\n | __bind\n | __indexOf\n | implements\n | interface\n | package\n | private\n | protected\n | public\n | static\n | yield\n )\n\t\t\t\t(?!\\s*:)\n\t\t\t\t\\b\n\t\t\t",
"name": "keyword.other.reserved.coffee"
},
{
"captures": {
"1": {
"name": "variable.other.assignment.coffee"
},
"4": {
"name": "punctuation.separator.key-value"
},
"5": {
"name": "keyword.operator.coffee"
}
},
"match": "(?x)\n\t\t\t\t(?:\n\t\t\t\t\t([a-zA-Z\\$_](\\w|\\$|\\.)*)\n\t\t\t\t\t\\s*\n\t\t\t\t\t(?!\\::)\n\t\t\t\t\t((:)|((?:or|and|[-+/&%*?])?=)(?![>=]))\n\t\t\t\t\t(?!\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t\\s*\\(.*\\)\n\t\t\t\t\t\t)?\n\t\t\t\t\t\t\\s*\n\t\t\t\t\t\t([=-]>)\n\t\t\t\t\t)\n\t\t\t\t)"
},
{
"begin": "(?<=\\s|^)(\\{)(?=.+?\\}\\s+[:=])",
"beginCaptures": {
"0": {
"name": "keyword.operator.coffee"
}
},
"end": "(\\}\\s*[:=])",
"endCaptures": {
"0": {
"name": "keyword.operator.coffee"
}
},
"name": "meta.variable.assignment.destructured.object.coffee",
"patterns": [
{
"include": "#variable_name"
},
{
"include": "#instance_variable"
},
{
"include": "#single_quoted_string"
},
{
"include": "#double_quoted_string"
},
{
"include": "#numeric"
}
]
},
{
"begin": "(?<=\\s|^)(\\[)(?=.+?\\]\\s+[:=])",
"beginCaptures": {
"0": {
"name": "keyword.operator.coffee"
}
},
"end": "(\\]\\s*[:=])",
"endCaptures": {
"0": {
"name": "keyword.operator.coffee"
}
},
"name": "meta.variable.assignment.destructured.array.coffee",
"patterns": [
{
"include": "#variable_name"
},
{
"include": "#instance_variable"
},
{
"include": "#single_quoted_string"
},
{
"include": "#double_quoted_string"
},
{
"include": "#numeric"
}
]
},
{
"captures": {
"1": {
"name": "entity.name.function.coffee"
},
"4": {
"name": "punctuation.definition.parameters.begin.coffee"
},
"5": {
"patterns": [
{
"captures": {
"1": {
"name": "variable.parameter.function.coffee"
},
"2": {
"name": "punctuation.separator.key-value.coffee"
},
"3": {
"name": "string.quoted.double.coffee"
},
"4": {
"name": "punctuation.definition.string.begin.coffee"
},
"5": {
"name": "punctuation.definition.string.end.coffee"
},
"6": {
"name": "string.quoted.single.coffee"
},
"7": {
"name": "punctuation.definition.string.begin.coffee"
},
"8": {
"name": "punctuation.definition.string.end.coffee"
}
},
"match": "(?x)\n\t\t\t\t\t\t\t\t([^()\\s,]+)\n\t\t\t\t\t\t\t\t\\s+(=)\\s+\n\t\t\t\t\t\t\t\t(?:\n\t\t\t\t\t\t\t\t\t((\")[^\"]*(\"))\n\t\t\t\t\t\t\t\t | ((')[^']*('))\n\t\t\t\t\t\t\t\t)"
},
{
"match": "[^()\\s,]+",
"name": "variable.parameter.function.coffee"
},
{
"match": ",",
"name": "punctuation.separator.arguments.coffee"
}
]
},
"6": {
"name": "punctuation.definition.parameters.begin.coffee"
},
"7": {
"name": "storage.type.function.coffee"
}
},
"match": "(?x)\n\t\t\t\t(?<=^|\\s)\n\t\t\t\t(?=@?[a-zA-Z\\$_])\n\t\t\t\t(\n\t\t\t\t\t@?[a-zA-Z\\$_](\\w|\\$|:|\\.)*\n\t\t\t\t\t\\s*\n\t\t\t\t\t(?=\n\t\t\t\t\t\t[:=]\n\t\t\t\t\t\t(\\s*(\\()(.*)(\\)))?\n\t\t\t\t\t\t\\s*\n\t\t\t\t\t\t([=-]>)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t",
"name": "meta.function.coffee"
},
{
"match": "(?x)\n\t\t\t\t\\b\n\t\t\t\t(?<!\\.|::)\n\t\t\t\t(true|on|yes)\n\t\t\t\t(?!\\s*[:=][^=])\n\t\t\t\t\\b",
"name": "constant.language.boolean.true.coffee"
},
{
"match": "(?x)\n\t\t\t\t\\b\n\t\t\t\t(?<!\\.|::)\n\t\t\t\t(false|off|no)\n\t\t\t\t(?!\\s*[:=][^=])\n\t\t\t\t\\b",
"name": "constant.language.boolean.false.coffee"
},
{
"match": "@?\\b(?!class|subclass|extends|decodeURI(Component)?|encodeURI(Component)?|eval|parse(Float|Int)|require)\\w+(?=\\s+(?!(of|in|then|is|isnt|and|or|for|else|when|not|if)\\s)(?=(@?\\w+|\\->|\\-\\d|\\[|\\{|\"|'))|(?=\\())",
"name": "entity.name.function.coffee"
},
{
"match": "[=-]>",
"name": "storage.type.function.coffee"
},
{
"match": "(?x)\n\t\t\t\t\\b\n\t\t\t\t(?<!\\.|::)\n\t\t\t\tnull\n\t\t\t\t(?!\\s*[:=][^=])\n\t\t\t\t\\b",
"name": "constant.language.null.coffee"
},
{
"match": "(?x)\n\t\t\t\t\\b\n\t\t\t\t(?<!\\.|::)\n\t\t\t\t(extends)\n\t\t\t\t(?!\\s*[:=][^=])\n\t\t\t\t\\b",
"name": "variable.language.coffee"
},
{
"match": "\\b(?<!\\.)this(?!\\s*[:=])\\b",
"name": "variable.language.this.coffee"
},
{
"captures": {
"1": {
"name": "storage.type.class.coffee"
},
"2": {
"name": "keyword.control.inheritance.coffee"
},
"3": {
"name": "entity.other.inherited-class.coffee"
}
},
"match": "(?x)\n\t\t\t\t\t(?<=\\s|^|\\[|\\()\n (class\\b)\n\t\t\t\t\t(?:\n\t\t\t\t\t\t\\s+(extends)\\s+\n\t\t\t\t\t\t(@?[a-zA-Z\\$\\._][\\w\\.]*)\n\t\t\t\t\t)",
"name": "meta.class.coffee"
},
{
"captures": {
"1": {
"name": "storage.type.class.coffee"
},
"2": {
"name": "entity.name.type.class.coffee"
},
"3": {
"name": "keyword.control.inheritance.coffee"
},
"4": {
"name": "entity.other.inherited-class.coffee"
}
},
"match": "(?x)\n\t\t\t (?<=\\s|^|\\[|\\()\n\t\t\t\t\t(class\\b)\n\t\t\t\t\t\\s+\n\t\t\t\t\t(@?[a-zA-Z\\$_][\\w\\.]*)?\n\t\t\t\t\t(?:\n\t\t\t\t\t\t\\s+(extends)\\s+\n\t\t\t\t\t\t(@?[a-zA-Z\\$\\._][\\w\\.]*)\n\t\t\t\t\t)?",
"name": "meta.class.coffee"
},
{
"match": "\\b(debugger|\\\\)\\b",
"name": "keyword.other.coffee"
},
{
"match": "(?x)\n\t\t\t\t\\b(\n\t\t\t\t\tArray\n\t\t\t\t | ArrayBuffer\n\t\t\t\t | Blob\n\t\t\t\t | Boolean\n\t\t\t\t | Date\n\t\t\t\t | document\n\t\t\t\t | Function\n\t\t\t\t | Int(8|16|32|64)Array\n\t\t\t\t | Math\n\t\t\t\t | Map\n\t\t\t\t | Number\n\t\t\t\t | Object\n\t\t\t\t | Proxy\n\t\t\t\t | RegExp\n\t\t\t\t | Set\n\t\t\t\t | String\n\t\t\t\t | WeakMap\n\t\t\t\t | window\n\t\t\t\t | Uint(8|16|32|64)Array\n\t\t\t\t | XMLHttpRequest\n\t\t\t\t)\\b",
"name": "support.class.coffee"
},
{
"match": "\\b(console)\\b",
"name": "entity.name.type.object.coffee"
},
{
"match": "((?<=console\\.)(debug|warn|info|log|error|time|timeEnd|assert))\\b",
"name": "support.function.console.coffee"
},
{
"match": "(?x)\n\t\t\t\t\\b(\n\t\t\t\t\tdecodeURI(Component)?\n\t\t\t\t | encodeURI(Component)?\n\t\t\t\t | eval\n\t\t\t\t | parse(Float|Int)\n\t\t\t\t | require\n\t\t\t\t)\\b",
"name": "support.function.coffee"
},
{
"match": "(?x)\n\t\t\t\t(\n\t\t\t\t\t(?<=\\.)\n\t\t\t\t\t(\n\t\t\t\t\t\tapply\n\t\t\t\t\t | call\n\t\t\t\t\t | concat\n\t\t\t\t\t | every\n\t\t\t\t\t | filter\n\t\t\t\t\t | forEach\n\t\t\t\t\t | from\n\t\t\t\t\t | hasOwnProperty\n\t\t\t\t\t | indexOf\n\t\t\t\t\t | isPrototypeOf\n\t\t\t\t\t | join\n\t\t\t\t\t | lastIndexOf\n\t\t\t\t\t | map\n\t\t\t\t\t | of\n\t\t\t\t\t | pop\n\t\t\t\t\t | propertyIsEnumerable\n\t\t\t\t\t | push\n\t\t\t\t\t | reduce(Right)?\n\t\t\t\t\t | reverse\n\t\t\t\t\t | shift\n\t\t\t\t\t | slice\n\t\t\t\t\t | some\n\t\t\t\t\t | sort\n\t\t\t\t\t | splice\n\t\t\t\t\t | to(Locale)?String\n\t\t\t\t\t | unshift\n\t\t\t\t\t | valueOf\n\t\t\t\t\t)\n\t\t\t\t)\\b",
"name": "support.function.method.array.coffee"
},
{
"match": "((?<=Array\\.)(isArray))\\b",
"name": "support.function.static.array.coffee"
},
{
"match": "(?x)\n\t\t\t\t(\n\t\t\t\t\t(?<=Object\\.)\n\t\t\t\t\t(\n\t\t\t\t\t\tcreate\n\t\t\t\t\t | definePropert(ies|y)\n\t\t\t\t\t | freeze\n\t\t\t\t\t | getOwnProperty(Descriptors?|Names)\n\t\t\t\t\t | getProperty(Descriptor|Names)\n\t\t\t\t\t | getPrototypeOf\n\t\t\t\t\t | is(Extensible|Frozen|Sealed)?\n\t\t\t\t\t | isnt\n\t\t\t\t\t | keys\n\t\t\t\t\t | preventExtensions\n\t\t\t\t\t | seal\n\t\t\t\t\t)\n\t\t\t\t)\\b",
"name": "support.function.static.object.coffee"
},
{
"match": "(?x)\n\t\t\t\t(\n\t\t\t\t\t(?<=Math\\.)\n\t\t\t\t\t(\n\t\t\t\t\t\tabs\n\t\t\t\t\t | acos\n\t\t\t\t\t | acosh\n\t\t\t\t\t | asin\n\t\t\t\t\t | asinh\n\t\t\t\t\t | atan\n\t\t\t\t\t | atan2\n\t\t\t\t\t | atanh\n\t\t\t\t\t | ceil\n\t\t\t\t\t | cos\n\t\t\t\t\t | cosh\n\t\t\t\t\t | exp\n\t\t\t\t\t | expm1\n\t\t\t\t\t | floor\n\t\t\t\t\t | hypot\n\t\t\t\t\t | log\n\t\t\t\t\t | log10\n\t\t\t\t\t | log1p\n\t\t\t\t\t | log2\n\t\t\t\t\t | max\n\t\t\t\t\t | min\n\t\t\t\t\t | pow\n\t\t\t\t\t | random\n\t\t\t\t\t | round\n\t\t\t\t\t | sign\n\t\t\t\t\t | sin\n\t\t\t\t\t | sinh\n\t\t\t\t\t | sqrt\n\t\t\t\t\t | tan\n\t\t\t\t\t | tanh\n\t\t\t\t\t | trunc\n\t\t\t\t\t)\n\t\t\t\t)\\b",
"name": "support.function.static.math.coffee"
},
{
"match": "(?x)\n\t\t\t\t(\n\t\t\t\t\t(?<=Number\\.)\n\t\t\t\t\t(\n\t\t\t\t\t\tis(Finite|Integer|NaN)\n\t\t\t\t\t | toInteger\n\t\t\t\t\t)\n\t\t\t\t)\\b",
"name": "support.function.static.number.coffee"
},
{
"match": "\\b(Infinity|NaN|undefined)\\b",
"name": "constant.language.coffee"
},
{
"match": "\\;",
"name": "punctuation.terminator.statement.coffee"
},
{
"match": ",",
"name": "meta.delimiter.object.comma.coffee"
},
{
"match": "\\.",
"name": "meta.delimiter.method.period.coffee"
},
{
"match": "\\{|\\}",
"name": "meta.brace.curly.coffee"
},
{
"match": "\\(|\\)",
"name": "meta.brace.round.coffee"
},
{
"match": "\\[|\\]\\s*",
"name": "meta.brace.square.coffee"
},
{
"include": "#instance_variable"
},
{
"include": "#single_quoted_string"
},
{
"include": "#double_quoted_string"
},
{
"include": "#numeric"
}
],
"repository": {
"double_quoted_string": {
"patterns": [
{
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.coffee"
}
},
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.coffee"
}
},
"name": "string.quoted.double.coffee",
"patterns": [
{
"match": "(?x)\n\t\t\t\t\t\t\t\t\\\\(\n\t\t\t\t\t\t\t\t\tx\\h{2}\n\t\t\t\t\t\t\t\t | [0-2][0-7]{0,2}\n\t\t\t\t\t\t\t\t | 3[0-6][0-7]\n\t\t\t\t\t\t\t\t | 37[0-7]?\n\t\t\t\t\t\t\t\t | [4-7][0-7]?\n\t\t\t\t\t\t\t\t | .\n\t\t\t\t\t\t\t\t)",
"name": "constant.character.escape.coffee"
},
{
"include": "#interpolated_coffee"
}
]
}
]
},
"embedded_comment": {
"patterns": [
{
"captures": {
"1": {
"name": "punctuation.definition.comment.coffee"
}
},
"match": "(?<!\\\\)(#).*$\\n?",
"name": "comment.line.number-sign.coffee"
}
]
},
"instance_variable": {
"patterns": [
{
"captures": {
"1": {
"name": "punctuation.definition.variable.coffee"
}
},
"match": "(@)([a-zA-Z_\\$]\\w*)?",
"name": "variable.other.readwrite.instance.coffee"
}
]
},
"interpolated_coffee": {
"patterns": [
{
"begin": "#\\{",
"beginCaptures": {
"0": {
"name": "punctuation.section.embedded.begin.coffee"
}
},
"contentName": "source.coffee",
"end": "(\\})",
"endCaptures": {
"0": {
"name": "punctuation.section.embedded.end.coffee"
},
"1": {
"name": "source.coffee"
}
},
"name": "meta.embedded.line.coffee",
"patterns": [
{
"include": "$self"
}
]
}
]
},
"numeric": {
"patterns": [
{
"match": "(?x)\n\t\t\t\t\t\t(?<!\\$)\\b\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\t(0([box])[0-9a-fA-F]+)\n\t\t\t\t\t\t | ([0-9]+(\\.[0-9]+)?(e[+\\-]?[0-9]+)?)\n\t\t\t\t\t\t)\\b",
"name": "constant.numeric.coffee"
}
]
},
"single_quoted_string": {
"patterns": [
{
"begin": "'",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.coffee"
}
},
"end": "'",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.coffee"
}
},
"name": "string.quoted.single.coffee",
"patterns": [
{
"match": "(?x)\n\t\t\t\t\t\t\t\t\\\\(\n\t\t\t\t\t\t\t\t\tx\\h{2}\n\t\t\t\t\t\t\t\t | [0-2][0-7]{0,2}\n\t\t\t\t\t\t\t\t | 3[0-6][0-7]?\n\t\t\t\t\t\t\t\t | 37[0-7]?\n\t\t\t\t\t\t\t\t | [4-7][0-7]?\n\t\t\t\t\t\t\t\t | .\n\t\t\t\t\t\t\t\t)",
"name": "constant.character.escape.coffee"
}
]
}
]
},
"variable_name": {
"patterns": [
{
"match": "([a-zA-Z\\$_]\\w*(\\.\\w+)*)",
"name": "variable.other.assignment.coffee"
}
]
}
},
"scopeName": "source.coffee",
"uuid": "5B520980-A7D5-4E10-8582-1A4C889A8DE5",
"version": "https://github.com/textmate/coffee-script.tmbundle/commit/da28450cf18a73595e298535c93c8370ae06994c"
}

4333
lib/shiki-languages/data/grammars/csharp.tmLanguage.json

File diff suppressed because it is too large

153
lib/shiki-languages/data/grammars/cshtml.json

@ -0,0 +1,153 @@
{
"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"
}

1184
lib/shiki-languages/data/grammars/css.plist

File diff suppressed because one or more lines are too long

268
lib/shiki-languages/data/grammars/diff.tmLanguage

@ -0,0 +1,268 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>patch</string>
<string>diff</string>
<string>rej</string>
</array>
<key>firstLineMatch</key>
<string>(?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}$
)</string>
<key>keyEquivalent</key>
<string>^~D</string>
<key>name</key>
<string>Diff</string>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.separator.diff</string>
</dict>
</dict>
<key>match</key>
<string>^((\*{15})|(={67})|(-{3}))$\n?</string>
<key>name</key>
<string>meta.separator.diff</string>
</dict>
<dict>
<key>match</key>
<string>^\d+(,\d+)*(a|d|c)\d+(,\d+)*$\n?</string>
<key>name</key>
<string>meta.diff.range.normal</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.range.diff</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>meta.toc-list.line-number.diff</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.range.diff</string>
</dict>
</dict>
<key>match</key>
<string>^(@@)\s*(.+?)\s*(@@)($\n?)?</string>
<key>name</key>
<string>meta.diff.range.unified</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.range.diff</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>punctuation.definition.range.diff</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>punctuation.definition.range.diff</string>
</dict>
<key>7</key>
<dict>
<key>name</key>
<string>punctuation.definition.range.diff</string>
</dict>
</dict>
<key>match</key>
<string>^(((\-{3}) .+ (\-{4}))|((\*{3}) .+ (\*{4})))$\n?</string>
<key>name</key>
<string>meta.diff.range.context</string>
</dict>
<dict>
<key>match</key>
<string>^diff --git a/.*$\n?</string>
<key>name</key>
<string>meta.diff.header.git</string>
</dict>
<dict>
<key>match</key>
<string>^diff (-|\S+\s+\S+).*$\n?</string>
<key>name</key>
<string>meta.diff.header.command</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>4</key>
<dict>
<key>name</key>
<string>punctuation.definition.from-file.diff</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>punctuation.definition.from-file.diff</string>
</dict>
<key>7</key>
<dict>
<key>name</key>
<string>punctuation.definition.from-file.diff</string>
</dict>
</dict>
<key>match</key>
<string>(^(((-{3}) .+)|((\*{3}) .+))$\n?|^(={4}) .+(?= - ))</string>
<key>name</key>
<string>meta.diff.header.from-file</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.definition.to-file.diff</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.to-file.diff</string>
</dict>
<key>4</key>
<dict>
<key>name</key>
<string>punctuation.definition.to-file.diff</string>
</dict>
</dict>
<key>match</key>
<string>(^(\+{3}) .+$\n?| (-) .* (={4})$\n?)</string>
<key>name</key>
<string>meta.diff.header.to-file</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.inserted.diff</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>punctuation.definition.inserted.diff</string>
</dict>
</dict>
<key>match</key>
<string>^(((&gt;)( .*)?)|((\+).*))$\n?</string>
<key>name</key>
<string>markup.inserted.diff</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.inserted.diff</string>
</dict>
</dict>
<key>match</key>
<string>^(!).*$\n?</string>
<key>name</key>
<string>markup.changed.diff</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.inserted.diff</string>
</dict>
<key>6</key>
<dict>
<key>name</key>
<string>punctuation.definition.inserted.diff</string>
</dict>
</dict>
<key>match</key>
<string>^(((&lt;)( .*)?)|((-).*))$\n?</string>
<key>name</key>
<string>markup.deleted.diff</string>
</dict>
<dict>
<key>begin</key>
<string>^(#)</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.diff</string>
</dict>
</dict>
<key>comment</key>
<string>Git produces unified diffs with embedded comments"</string>
<key>end</key>
<string>\n</string>
<key>name</key>
<string>comment.line.number-sign.diff</string>
</dict>
<dict>
<key>match</key>
<string>^index [0-9a-f]{7,40}\.\.[0-9a-f]{7,40}.*$\n?</string>
<key>name</key>
<string>meta.diff.index.git</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.separator.key-value.diff</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>meta.toc-list.file-name.diff</string>
</dict>
</dict>
<key>match</key>
<string>^Index(:) (.+)$\n?</string>
<key>name</key>
<string>meta.diff.index</string>
</dict>
<dict>
<key>match</key>
<string>^Only in .*: .*$\n?</string>
<key>name</key>
<string>meta.diff.only-in</string>
</dict>
</array>
<key>scopeName</key>
<string>source.diff</string>
<key>uuid</key>
<string>7E848FF4-708E-11D9-97B4-0011242E4184</string>
</dict>
</plist>

533
lib/shiki-languages/data/grammars/fsharp.json

@ -0,0 +1,533 @@
{
"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": "\\\\"
}
]
}
}
}

221
lib/shiki-languages/data/grammars/git-commit.tmLanguage

@ -0,0 +1,221 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>COMMIT_EDITMSG</string>
<string>MERGE_MSG</string>
</array>
<key>foldingStartMarker</key>
<string>^\+\+\+</string>
<key>foldingStopMarker</key>
<string>^---</string>
<key>name</key>
<string>Git Commit Message</string>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>\A(?!# Please enter the commit message)</string>
<key>end</key>
<string>^(?=# Please enter the commit message)</string>
<key>name</key>
<string>meta.scope.message.git-commit</string>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>\A(?=#)</string>
<key>end</key>
<string>^(?!#)</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#comment</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>^(?!# Please enter the commit message)</string>
<key>end</key>
<string>^(?=# Please enter the commit message)</string>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>\G</string>
<key>end</key>
<string>^(?!\G)</string>
<key>name</key>
<string>meta.scope.subject.git-commit</string>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.$2.git-commit</string>
</dict>
</dict>
<key>match</key>
<string>\G((fixup|squash)!)\s*</string>
</dict>
<dict>
<key>match</key>
<string>.{66,}$</string>
<key>name</key>
<string>invalid.illegal.line-too-long.git-commit</string>
</dict>
<dict>
<key>match</key>
<string>.{51,}$</string>
<key>name</key>
<string>invalid.deprecated.line-too-long.git-commit</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>^(?!# Please enter the commit message)</string>
<key>end</key>
<string>^(?=# Please enter the commit message)</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#comment</string>
</dict>
</array>
</dict>
</array>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>^(?=# Please enter the commit message)</string>
<key>end</key>
<string>\z</string>
<key>name</key>
<string>meta.scope.metadata.git-commit</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>#metadata</string>
</dict>
</array>
</dict>
</array>
<key>repository</key>
<dict>
<key>comment</key>
<dict>
<key>begin</key>
<string>^(#)</string>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.git-commit</string>
</dict>
</dict>
<key>end</key>
<string>\n</string>
<key>name</key>
<string>comment.line.number-sign.git-commit</string>
</dict>
<key>metadata</key>
<dict>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>(?=^# Changes to be committed:)</string>
<key>end</key>
<string>(?!\G)((?=^# \w)|(?!^#))</string>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>(^[ \t]+)?(?=#)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.whitespace.comment.leading.git-commit</string>
</dict>
</dict>
<key>contentName</key>
<string>comment.line.number-sign.git-commit</string>
<key>end</key>
<string>(?!\G)^</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\G#</string>
<key>name</key>
<string>punctuation.definition.comment.git-commit</string>
</dict>
<dict>
<key>match</key>
<string>((modified|renamed):.*)$\n?</string>
<key>name</key>
<string>markup.changed.git-commit</string>
</dict>
<dict>
<key>match</key>
<string>(new file:.*)$\n?</string>
<key>name</key>
<string>markup.inserted.git-commit</string>
</dict>
<dict>
<key>match</key>
<string>(deleted:.*)$\n?</string>
<key>name</key>
<string>markup.deleted.git-commit</string>
</dict>
</array>
</dict>
</array>
</dict>
<dict>
<key>include</key>
<string>#comment</string>
</dict>
<dict>
<key>begin</key>
<string>(?=diff\ \-\-git)</string>
<key>comment</key>
<string>diff presented at the end of the commit message when using commit -v.</string>
<key>contentName</key>
<string>source.diff</string>
<key>end</key>
<string>\z</string>
<key>name</key>
<string>meta.embedded.diff.git-commit</string>
<key>patterns</key>
<array>
<dict>
<key>include</key>
<string>source.diff</string>
</dict>
</array>
</dict>
</array>
</dict>
</dict>
<key>scopeName</key>
<string>text.git-commit</string>
<key>uuid</key>
<string>BFE83C06-8508-44BE-A975-95A57BF619A7</string>
</dict>
</plist>

57
lib/shiki-languages/data/grammars/git-rebase.tmLanguage

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>git-rebase-todo</string>
</array>
<key>name</key>
<string>Git Rebase Message</string>
<key>patterns</key>
<array>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.git-rebase</string>
</dict>
</dict>
<key>match</key>
<string>^\s*(#).*$\n?</string>
<key>name</key>
<string>comment.line.number-sign.git-rebase</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>support.function.git-rebase</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>constant.sha.git-rebase</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>meta.commit-message.git-rebase</string>
</dict>
</dict>
<key>match</key>
<string>^\s*(pick|p|reword|r|edit|e|squash|s|fixup|f|d|drop|x|exec)\s+([0-9a-f]+)\s+(.*)$</string>
<key>name</key>
<string>meta.commit-command.git-rebase</string>
</dict>
</array>
<key>scopeName</key>
<string>text.git-rebase</string>
<key>uuid</key>
<string>7F1CC209-5F6D-486A-8180-09FA282381A1</string>
</dict>
</plist>

611
lib/shiki-languages/data/grammars/go.json

@ -0,0 +1,611 @@
{
"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": "(?<!var )\\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"
}
]
}
}
},
{
"comment": "Single line variable declarations/assignments",
"match": "(?<=var)\\s+(.*)$",
"captures": {
"1": {
"patterns": [
{
"include": "#variables"
}
]
}
}
},
{
"comment": "Multiline variable declarations/assignments",
"begin": "(\\bvar\\b)\\s+(\\()",
"beginCaptures": {
"1": {
"name": "keyword.var.go"
},
"2": {
"name": "punctuation.other.bracket.round.go"
}
},
"end": "\\)",
"endCaptures": {
"0": {
"name": "punctuation.other.bracket.round.go"
}
},
"patterns": [
{
"include": "#variables"
},
{
"include": "$self"
}
]
},
{
"comment": "Terminators",
"match": ";",
"name": "punctuation.terminator.go"
},
{
"include": "#brackets"
},
{
"include": "#delimiters"
},
{
"include": "#keywords"
},
{
"include": "#operators"
},
{
"include": "#runes"
},
{
"include": "#storage_types"
}
],
"repository": {
"brackets": {
"patterns": [
{
"match": "\\{|\\}",
"name": "punctuation.other.bracket.curly.go"
},
{
"match": "\\(|\\)",
"name": "punctuation.other.bracket.round.go"
},
{
"match": "\\[|\\]",
"name": "punctuation.other.bracket.square.go"
}
]
},
"delimiters": {
"patterns": [
{
"match": ",",
"name": "punctuation.other.comma.go"
},
{
"match": "\\.(?!\\.\\.)",
"name": "punctuation.other.period.go"
},
{
"match": ":(?!=)",
"name": "punctuation.other.colon.go"
}
]
},
"keywords": {
"patterns": [
{
"comment": "Flow control keywords",
"match": "\\b(break|case|continue|default|defer|else|fallthrough|for|go|goto|if|range|return|select|switch)\\b",
"name": "keyword.control.go"
},
{
"match": "\\bchan\\b",
"name": "keyword.channel.go"
},
{
"match": "\\bconst\\b",
"name": "keyword.const.go"
},
{
"match": "\\bfunc\\b",
"name": "keyword.function.go"
},
{
"match": "\\binterface\\b",
"name": "keyword.interface.go"
},
{
"match": "\\bimport\\b",
"name": "keyword.import.go"
},
{
"match": "\\bmap\\b",
"name": "keyword.map.go"
},
{
"match": "\\bpackage\\b",
"name": "keyword.package.go"
},
{
"match": "\\bstruct\\b",
"name": "keyword.struct.go"
},
{
"match": "\\btype\\b",
"name": "keyword.type.go"
},
{
"match": "\\bvar\\b",
"name": "keyword.var.go"
}
]
},
"operators": {
"comment": "Note that the order here is very important!",
"patterns": [
{
"match": "(\\*|&)(?=\\w)",
"name": "keyword.operator.address.go"
},
{
"match": "<\\-",
"name": "keyword.operator.channel.go"
},
{
"match": "\\-\\-",
"name": "keyword.operator.decrement.go"
},
{
"match": "\\+\\+",
"name": "keyword.operator.increment.go"
},
{
"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"
}

553
lib/shiki-languages/data/grammars/html.json

@ -0,0 +1,553 @@
{
"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:\\-]++)(?=[^>]*></\\2>)",
"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": "<!--",
"captures": {
"0": {
"name": "punctuation.definition.comment.html"
}
},
"end": "--\\s*>",
"name": "comment.block.html",
"patterns": [
{
"match": "--",
"name": "invalid.illegal.bad-comments-or-CDATA.html"
},
{
"include": "#embedded-code"
}
]
},
{
"begin": "<!",
"captures": {
"0": {
"name": "punctuation.definition.tag.html"
}
},
"end": ">",
"name": "meta.tag.sgml.html",
"patterns": [
{
"begin": "(?i:DOCTYPE)",
"captures": {
"1": {
"name": "entity.name.tag.doctype.html"
}
},
"end": "(?=>)",
"name": "meta.tag.sgml.doctype.html",
"patterns": [
{
"match": "\"[^\">]*\"",
"name": "string.quoted.double.doctype.identifiers-and-DTDs.html"
}
]
},
{
"begin": "\\[CDATA\\[",
"end": "]](?=>)",
"name": "constant.other.inline-data.html"
},
{
"match": "(\\s*)(?!--|>)\\S(\\s*)",
"name": "invalid.illegal.bad-comments-or-CDATA.html"
}
]
},
{
"include": "#embedded-code"
},
{
"begin": "(?:^\\s+)?(<)((?i:style))\\b(?![^>]*/>)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
"2": {
"name": "entity.name.tag.style.html"
},
"3": {
"name": "punctuation.definition.tag.html"
}
},
"end": "(</)((?i:style))(>)(?:\\s*\\n)?",
"contentName": "source.css.embedded.html",
"patterns": [
{
"include": "#tag-stuff"
},
{
"begin": "(>)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.html"
}
},
"end": "(?=</(?i:style))",
"patterns": [
{
"include": "#embedded-code"
},
{
"include": "source.css"
}
]
}
]
},
{
"begin": "(?:^\\s+)?(<)((?i:script))\\b(?![^>]*/>)(?![^>]*(?i:type.?=.?text/((?!javascript).*)))",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.html"
},
"2": {
"name": "entity.name.tag.script.html"
}
},
"end": "(?<=</(script|SCRIPT))(>)(?:\\s*\\n)?",
"endCaptures": {
"2": {
"name": "punctuation.definition.tag.html"
}
},
"contentName": "source.js.embedded.html",
"patterns": [
{
"include": "#tag-stuff"
},
{
"begin": "(?<!</(?:script|SCRIPT))(>)",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
"2": {
"name": "entity.name.tag.script.html"
}
},
"end": "(</)((?i:script))",
"patterns": [
{
"captures": {
"1": {
"name": "punctuation.definition.comment.js"
}
},
"match": "(//).*?((?=</script)|$\\n?)",
"name": "comment.line.double-slash.js"
},
{
"begin": "/\\*",
"captures": {
"0": {
"name": "punctuation.definition.comment.js"
}
},
"end": "\\*/|(?=</script)",
"name": "comment.block.js"
},
{
"include": "source.js"
}
]
}
]
},
{
"begin": "(</?)((?i:body|head|html)(?=\\s|\\\\|>))",
"captures": {
"1": {
"name": "punctuation.definition.tag.html"
},
"2": {
"name": "entity.name.tag.structure.any.html"
}
},
"end": "(>)",
"name": "meta.tag.structure.any.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
{
"begin": "(</?)((?i:address|blockquote|dd|div|section|article|aside|header|footer|nav|menu|dl|dt|fieldset|form|frame|frameset|h1|h2|h3|h4|h5|h6|iframe|noframes|object|ol|p|ul|applet|center|dir|hr|pre)(?=\\s|\\\\|>))",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.block.any.html"
}
},
"end": "(>)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"name": "meta.tag.block.any.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
{
"begin": "(</?)((?i:a|abbr|acronym|area|b|base|basefont|bdo|big|br|button|caption|cite|code|col|colgroup|del|dfn|em|font|head|html|i|img|input|ins|isindex|kbd|label|legend|li|link|map|meta|noscript|optgroup|option|param|q|s|samp|script|select|small|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|title|tr|tt|u|var)(?=\\s|\\\\|>))",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.inline.any.html"
}
},
"end": "((?: ?/)?>)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"name": "meta.tag.inline.any.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
{
"begin": "(</?)([a-zA-Z0-9:\\-]+)",
"beginCaptures": {
"1": {
"name": "punctuation.definition.tag.begin.html"
},
"2": {
"name": "entity.name.tag.other.html"
}
},
"end": "(>)",
"endCaptures": {
"1": {
"name": "punctuation.definition.tag.end.html"
}
},
"name": "meta.tag.other.html",
"patterns": [
{
"include": "#tag-stuff"
}
]
},
{
"include": "#entities"
},
{
"match": "<>",
"name": "invalid.illegal.incomplete.html"
}
],
"repository": {
"embedded-code": {
"patterns": [
{
"include": "#smarty"
},
{
"include": "#python"
}
]
},
"entities": {
"patterns": [
{
"captures": {
"1": {
"name": "punctuation.definition.entity.html"
},
"3": {
"name": "punctuation.definition.entity.html"
}
},
"match": "(&)([a-zA-Z0-9]+|#[0-9]+|#[xX][0-9a-fA-F]+)(;)",
"name": "constant.character.entity.html"
},
{
"match": "&",
"name": "invalid.illegal.bad-ampersand.html"
}
]
},
"python": {
"begin": "(?:^\\s*)<\\?python(?!.*\\?>)",
"end": "\\?>(?:\\s*$\\n)?",
"contentName": "source.python.embedded.html",
"patterns": [
{
"include": "source.python"
}
]
},
"smarty": {
"patterns": [
{
"begin": "(\\{(literal)\\})",
"captures": {
"1": {
"name": "source.smarty.embedded.html"
},
"2": {
"name": "support.function.built-in.smarty"
}
},
"end": "(\\{/(literal)\\})"
},
{
"begin": "{{|{",
"disabled": 1,
"end": "}}|}",
"contentName": "source.smarty.embedded.html",
"patterns": [
{
"include": "source.smarty"
}
]
}
]
},
"string-double-quoted": {
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.html"
}
},
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.html"
}
},
"name": "string.quoted.double.html",
"patterns": [
{
"include": "#embedded-code"
},
{
"include": "#entities"
}
]
},
"string-single-quoted": {
"begin": "'",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.html"
}
},
"end": "'",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.html"
}
},
"name": "string.quoted.single.html",
"patterns": [
{
"include": "#embedded-code"
},
{
"include": "#entities"
}
]
},
"tag-generic-attribute": {
"match": "(?<=[^=])\\b([a-zA-Z0-9:-]+)",
"name": "entity.other.attribute-name.html"
},
"tag-id-attribute": {
"begin": "\\b(id)\\b\\s*(=)",
"captures": {
"1": {
"name": "entity.other.attribute-name.id.html"
},
"2": {
"name": "punctuation.separator.key-value.html"
}
},
"end": "(?!\\G)(?<='|\"|[^\\s<>/])",
"name": "meta.attribute-with-value.id.html",
"patterns": [
{
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.html"
}
},
"contentName": "meta.toc-list.id.html",
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.html"
}
},
"name": "string.quoted.double.html",
"patterns": [
{
"include": "#embedded-code"
},
{
"include": "#entities"
}
]
},
{
"begin": "'",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.html"
}
},
"contentName": "meta.toc-list.id.html",
"end": "'",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.html"
}
},
"name": "string.quoted.single.html",
"patterns": [
{
"include": "#embedded-code"
},
{
"include": "#entities"
}
]
},
{
"captures": {
"0": {
"name": "meta.toc-list.id.html"
}
},
"match": "(?<==)(?:[^\\s<>/'\"]|/(?!>))+",
"name": "string.unquoted.html"
}
]
},
"tag-stuff": {
"patterns": [
{
"include": "#tag-id-attribute"
},
{
"include": "#tag-generic-attribute"
},
{
"include": "#string-double-quoted"
},
{
"include": "#string-single-quoted"
},
{
"include": "#embedded-code"
},
{
"include": "#unquoted-attribute"
}
]
},
"unquoted-attribute": {
"match": "(?<==)(?:[^\\s<>/'\"]|/(?!>))+",
"name": "string.unquoted.html"
}
},
"scopeName": "text.html.basic",
"uuid": "17994EC8-6B1D-11D9-AC3A-000D93589AF6",
"version": "https://github.com/textmate/html.tmbundle/commit/9f812c89f4990a98391701caa77824c94860538f"
}

1030
lib/shiki-languages/data/grammars/java.json

File diff suppressed because it is too large

619
lib/shiki-languages/data/grammars/less.tmLanguage.json

File diff suppressed because one or more lines are too long

192
lib/shiki-languages/data/grammars/lua.json

@ -0,0 +1,192 @@
{
"comment": "Lua Syntax: version 0.8",
"fileTypes": [
"lua"
],
"firstLineMatch": "\\A#!.*?\\blua\\b",
"keyEquivalent": "^~L",
"name": "Lua",
"patterns": [
{
"captures": {
"1": {
"name": "keyword.control.lua"
},
"2": {
"name": "entity.name.function.scope.lua"
},
"3": {
"name": "entity.name.function.lua"
},
"4": {
"name": "punctuation.definition.parameters.begin.lua"
},
"5": {
"name": "variable.parameter.function.lua"
},
"6": {
"name": "punctuation.definition.parameters.end.lua"
}
},
"match": "\\b(function)(?:\\s+([a-zA-Z_.:]+[.:])?([a-zA-Z_]\\w*)\\s*)?(\\()([^)]*)(\\))",
"name": "meta.function.lua"
},
{
"match": "(?<![\\d.])\\s0x[a-fA-F\\d]+|\\b\\d+(\\.\\d+)?([eE]-?\\d+)?|\\.\\d+([eE]-?\\d+)?",
"name": "constant.numeric.lua"
},
{
"begin": "'",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.lua"
}
},
"end": "'",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.lua"
}
},
"name": "string.quoted.single.lua",
"patterns": [
{
"match": "\\\\.",
"name": "constant.character.escape.lua"
}
]
},
{
"begin": "\"",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.lua"
}
},
"end": "\"",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.lua"
}
},
"name": "string.quoted.double.lua",
"patterns": [
{
"match": "\\\\.",
"name": "constant.character.escape.lua"
}
]
},
{
"begin": "(?<=\\.cdef)\\s*(\\[(=*)\\[)",
"beginCaptures": {
"0": {
"name": "string.quoted.other.multiline.lua"
},
"1": {
"name": "punctuation.definition.string.begin.lua"
}
},
"contentName": "meta.embedded.lua",
"end": "(\\]\\2\\])",
"endCaptures": {
"0": {
"name": "string.quoted.other.multiline.lua"
},
"1": {
"name": "punctuation.definition.string.end.lua"
}
},
"patterns": [
{
"include": "source.c"
}
]
},
{
"begin": "(?<!--)\\[(=*)\\[",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.lua"
}
},
"end": "\\]\\1\\]",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.lua"
}
},
"name": "string.quoted.other.multiline.lua"
},
{
"begin": "--\\[(=*)\\[",
"captures": {
"0": {
"name": "punctuation.definition.comment.lua"
}
},
"end": "\\]\\1\\]",
"name": "comment.block.lua"
},
{
"begin": "(^[ \\t]+)?(?=--(?!\\[\\[))",
"beginCaptures": {
"1": {
"name": "punctuation.whitespace.comment.leading.lua"
}
},
"end": "(?!\\G)",
"patterns": [
{
"begin": "--",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.lua"
}
},
"end": "\\n",
"name": "comment.line.double-dash.lua"
}
]
},
{
"match": "\\b(break|do|else|for|if|elseif|return|then|repeat|while|until|end|function|local|in)\\b",
"name": "keyword.control.lua"
},
{
"match": "(?<![^.]\\.|:)\\b(false|nil|true|_G|_VERSION|math\\.(pi|huge))\\b|(?<![.])\\.{3}(?!\\.)",
"name": "constant.language.lua"
},
{
"match": "(?<![^.]\\.|:)\\b(self)\\b",
"name": "variable.language.self.lua"
},
{
"match": "(?<![^.]\\.|:)\\b(assert|collectgarbage|dofile|error|getfenv|getmetatable|ipairs|loadfile|loadstring|module|next|pairs|pcall|print|rawequal|rawget|rawset|require|select|setfenv|setmetatable|tonumber|tostring|type|unpack|xpcall)\\b(?=\\s*(?:[({\"']|\\[\\[))",
"name": "support.function.lua"
},
{
"match": "(?<![^.]\\.|:)\\b(coroutine\\.(create|resume|running|status|wrap|yield)|string\\.(byte|char|dump|find|format|gmatch|gsub|len|lower|match|rep|reverse|sub|upper)|table\\.(concat|insert|maxn|remove|sort)|math\\.(abs|acos|asin|atan2?|ceil|cosh?|deg|exp|floor|fmod|frexp|ldexp|log|log10|max|min|modf|pow|rad|random|randomseed|sinh?|sqrt|tanh?)|io\\.(close|flush|input|lines|open|output|popen|read|tmpfile|type|write)|os\\.(clock|date|difftime|execute|exit|getenv|remove|rename|setlocale|time|tmpname)|package\\.(cpath|loaded|loadlib|path|preload|seeall)|debug\\.(debug|[gs]etfenv|[gs]ethook|getinfo|[gs]etlocal|[gs]etmetatable|getregistry|[gs]etupvalue|traceback))\\b(?=\\s*(?:[({\"']|\\[\\[))",
"name": "support.function.library.lua"
},
{
"match": "\\b(and|or|not)\\b",
"name": "keyword.operator.lua"
},
{
"match": "\\b([A-Za-z_]\\w*)\\b(?=\\s*(?:[({\"']|\\[\\[))",
"name": "support.function.any-method.lua"
},
{
"match": "(?<=[^.]\\.|:)\\b([A-Za-z_]\\w*)",
"name": "variable.other.lua"
},
{
"match": "\\+|-|%|#|\\*|\\/|\\^|==?|~=|<=?|>=?|(?<!\\.)\\.{2}(?!\\.)",
"name": "keyword.operator.lua"
}
],
"scopeName": "source.lua",
"uuid": "93E017CC-6F27-11D9-90EB-000D93589AF7",
"version": "https://github.com/textmate/lua.tmbundle/commit/609fe340f40b31f4189dabbb38f885b58cf0dd26"
}

1889
lib/shiki-languages/data/grammars/markdown.tmLanguage

File diff suppressed because it is too large

2638
lib/shiki-languages/data/grammars/php.json

File diff suppressed because one or more lines are too long

181
lib/shiki-languages/data/grammars/properties.plist

@ -0,0 +1,181 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>ini</string>
<string>conf</string>
</array>
<key>keyEquivalent</key>
<string>^~I</string>
<key>name</key>
<string>Ini</string>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>(^[ \t]+)?(?=#)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.whitespace.comment.leading.ini</string>
</dict>
</dict>
<key>end</key>
<string>(?!\G)</string>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>#</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.ini</string>
</dict>
</dict>
<key>end</key>
<string>\n</string>
<key>name</key>
<string>comment.line.number-sign.ini</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>(^[ \t]+)?(?=;)</string>
<key>beginCaptures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.whitespace.comment.leading.ini</string>
</dict>
</dict>
<key>end</key>
<string>(?!\G)</string>
<key>patterns</key>
<array>
<dict>
<key>begin</key>
<string>;</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.comment.ini</string>
</dict>
</dict>
<key>end</key>
<string>\n</string>
<key>name</key>
<string>comment.line.semicolon.ini</string>
</dict>
</array>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>keyword.other.definition.ini</string>
</dict>
<key>2</key>
<dict>
<key>name</key>
<string>punctuation.separator.key-value.ini</string>
</dict>
</dict>
<key>match</key>
<string>\b([a-zA-Z0-9_.-]+)\b\s*(=)</string>
</dict>
<dict>
<key>captures</key>
<dict>
<key>1</key>
<dict>
<key>name</key>
<string>punctuation.definition.entity.ini</string>
</dict>
<key>3</key>
<dict>
<key>name</key>
<string>punctuation.definition.entity.ini</string>
</dict>
</dict>
<key>match</key>
<string>^(\[)(.*?)(\])</string>
<key>name</key>
<string>entity.name.section.group-title.ini</string>
</dict>
<dict>
<key>begin</key>
<string>'</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.ini</string>
</dict>
</dict>
<key>end</key>
<string>'</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.ini</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.single.ini</string>
<key>patterns</key>
<array>
<dict>
<key>match</key>
<string>\\.</string>
<key>name</key>
<string>constant.character.escape.ini</string>
</dict>
</array>
</dict>
<dict>
<key>begin</key>
<string>"</string>
<key>beginCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.begin.ini</string>
</dict>
</dict>
<key>end</key>
<string>"</string>
<key>endCaptures</key>
<dict>
<key>0</key>
<dict>
<key>name</key>
<string>punctuation.definition.string.end.ini</string>
</dict>
</dict>
<key>name</key>
<string>string.quoted.double.ini</string>
</dict>
</array>
<key>scopeName</key>
<string>source.properties</string>
<key>uuid</key>
<string>77DC23B6-8A90-11D9-BAA4-000A9584EC8C</string>
</dict>
</plist>

595
lib/shiki-languages/data/grammars/rust.json

@ -0,0 +1,595 @@
{
"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"
}
]
}
]
}

1672
lib/shiki-languages/data/grammars/scss.json

File diff suppressed because one or more lines are too long

133
lib/shiki-languages/data/grammars/shaderlab.json

@ -0,0 +1,133 @@
{
"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) | (?<!\\w)) (\\s+))?\n\t\t\t(\\b \n\t\t\t\t(?!(while|for|do|if|else|switch|catch|enumerate|return|sizeof|[cr]?iterate)\\s*\\()(?:(?!NS)[A-Za-z_][A-Za-z0-9_]*+\\b | :: )++\t\t\t\t # actual name\n\t\t\t)\n\t\t\t \\s*(\\()",
"captures": {
"1": {
"name": "punctuation.whitespace.function-call.leading.shaderlab"
},
"2": {
"name": "support.function.any-method.shaderlab"
},
"3": {
"name": "punctuation.definition.parameters.shaderlab"
}
},
"name": "meta.function-call.shaderlab"
}
]
},
"cg": {
"patterns": [
{
"match": "^\\s*#\\s*(define|defined|elif|else|if|ifdef|ifndef|line|pragma|undef)\\b",
"name": "keyword.control.shaderlab"
},
{
"match": "\\.([rgba]{1,4}|[xyzw]{1,4})\\b",
"name": "keyword.operator.shaderlab"
},
{
"match": "\\b(const|extern|in|inline|inout|static|out|uniform|varying|profile name)\\b",
"name": "storage.modifier.shaderlab"
},
{
"match": "\\b(void|struct|typedef|signed|unsigned|double([1-4])*(x[1-4])*|float([1-4])*(x[1-4])*|half([1-4])*(x[1-4])*|fixed([1-4])*(x[1-4])*|long([1-4])*(x[1-4])*|int([1-4])*(x[1-4])*|short([1-4])*(x[1-4])*|char([1-4])*(x[1-4])*|bool([1-4])*(x[1-4])*|sampler([1-3]D|RECT|CUBE)*)\\b",
"name": "storage.type.shaderlab"
}
]
}
}
}

257
lib/shiki-languages/data/grammars/swift.json

@ -0,0 +1,257 @@
{
"scopeName": "source.swift",
"fileTypes": [
"swift"
],
"name": "Swift",
"firstLineMatch": "^#!\\s*/.*\\bswift",
"patterns": [
{
"name": "keyword.declaration.swift",
"match": "\\b(class|deinit|enum|extension|import|init|inout|internal|let|operator|private|protocol|public|static|struct|subscript|typealias|var)\\b"
},
{
"name": "keyword.statement.swift",
"match": "\\b(break|case|continue|default|defer|do|else|fallthrough|for|guard|if|in|repeat|return|switch|where|while)\\b"
},
{
"name": "keyword.expressions-and-types.swift",
"match": "\\b(as|catch|dynamicType|false|is|nil|rethrows|super|self|Self|throw|throws|true|try|__COLUMN__|__FILE__|__FUNCTION__|__LINE__)\\b"
},
{
"name": "keyword.patterns.swift",
"match": "\\b(_)\\b"
},
{
"name": "keyword.primitive-datatypes.swift",
"match": "\\b(Int|UInt|String|Bool|Character|Optional|Float|Double)\\b"
},
{
"name": "keyword.reserved.swift",
"match": "\\b(associativity|convenience|dynamic|didSet|final|get|infix|lazy|left|mutating|none|nonmutating|optional|override|postfix|precedence|prefix|Protocol|required|right|set|Type|unowned|weak|willSet)\\b"
},
{
"include": "#comment"
},
{
"include": "#literal"
},
{
"include": "#function"
},
{
"include": "#operator"
},
{
"include": "#attribute"
}
],
"repository": {
"comment": {
"patterns": [
{
"name": "comment.block.swift",
"begin": "/\\*",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.begin.swift"
}
},
"end": "\\*/",
"endCaptures": {
"0": {
"name": "punctuation.definition.comment.end.swift"
}
},
"patterns": [
{
"include": "#comment"
}
]
},
{
"begin": "(^[ \\t]+)?(?=//)",
"beginCaptures": {
"1": {
"name": "punctuation.whitespace.comment.leading.swift"
}
},
"end": "(?!\\G)",
"patterns": [
{
"name": "comment.line.double-slash.swift",
"begin": "//",
"beginCaptures": {
"0": {
"name": "punctuation.definition.comment.swift"
}
},
"end": "\\n",
"patterns": [
{
"name": "punctuation.separator.continuation.swift",
"match": "(?>\\\\\\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) (?<identifier> \\g<identifier-head> \\g<identifier-characters>? | ` \\g<identifier-head> \\g<identifier-characters>? ` ){0} (?<identifier-head> [ 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} (?<identifier-character> \\d | [ \\u0300-\\u036F \\u1DC0-\\u1DFF \\u20D0-\\u20FF \\uFE20-\\uFE2F ] | \\g<identifier-head> ){0} (?<identifier-characters> \\g<identifier-character> \\g<identifier-characters>? ){0} (?<implicit-parameter-name> (?<!\\g<identifier-head>) \\$ \\d+ (?!\\g<identifier-head>) (?# FIXME) ){0} \\g<identifier> | \\g<implicit-parameter-name>",
"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 ###) (?<integer-literal> \\g<binary-literal> | \\g<octal-literal> | \\g<hexadecimal-literal> | \\g<decimal-literal> ){0} (?### BINARY ###) (?<binary-literal> 0b \\g<binary-digit> \\g<binary-literal-characters>? ){0} (?<binary-digit> [0-1] ){0} (?<binary-literal-character> \\g<binary-digit> | _ ){0} (?<binary-literal-characters> \\g<binary-literal-character> \\g<binary-literal-characters>? ){0} (?### OCTAL ###) (?<octal-literal> 0o \\g<octal-digit> \\g<octal-literal-characters>? ){0} (?<octal-digit> [0-7] ){0} (?<octal-literal-character> \\g<octal-digit> | _ ){0} (?<octal-literal-characters> \\g<octal-literal-character> \\g<octal-literal-characters>? ){0} (?### DECIMAL ###) (?<decimal-literal> \\g<decimal-digit> \\g<decimal-literal-characters>? ){0} (?<decimal-digit> \\d ){0} (?<decimal-literal-character> \\g<decimal-digit> | _ ){0} (?<decimal-literal-characters> \\g<decimal-literal-character> \\g<decimal-literal-characters>? ){0} (?### HEXADECIMAL ###) (?<hexadecimal-literal> 0x \\g<hexadecimal-digit> \\g<hexadecimal-literal-characters>? ){0} (?<hexadecimal-digit> \\h ){0} (?<hexadecimal-literal-character> \\g<hexadecimal-digit> | _ ){0} (?<hexadecimal-literal-characters> \\g<hexadecimal-literal-character> \\g<hexadecimal-literal-characters>? ){0} (?### FLOATING POINT ###) (?<floating-point-literal> \\g<decimal-literal> \\g<decimal-fraction>? \\g<decimal-exponent>? | \\g<hexadecimal-literal> \\g<hexadecimal-fraction>? \\g<hexadecimal-exponent> ){0} (?<decimal-fraction> \\. \\g<decimal-literal> ){0} (?<decimal-exponent> \\g<floating-point-e> \\g<sign>? \\g<decimal-literal> ){0} (?<hexadecimal-fraction> \\. \\g<hexadecimal-literal>? ){0} (?<hexadecimal-exponent> \\g<floating-point-p> \\g<sign>? \\g<hexadecimal-literal> ){0} (?<floating-point-e> [eE] ){0} (?<floating-point-p> [pP] ){0} (?<sign> [+-] ){0} (?!0[box]) \\g<floating-point-literal> | \\g<integer-literal>"
},
"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": " "
}
}
}

426
lib/shiki-languages/data/grammars/xml.json

@ -0,0 +1,426 @@
{
"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": "(<!)(DOCTYPE)\\s+([:a-zA-Z_][:a-zA-Z0-9_.-]*)",
"captures": {
"1": {
"name": "punctuation.definition.tag.xml"
},
"2": {
"name": "keyword.other.doctype.xml"
},
"3": {
"name": "variable.language.documentroot.xml"
}
},
"end": "\\s*(>)",
"name": "meta.tag.sgml.doctype.xml",
"patterns": [
{
"include": "#internalSubset"
}
]
},
{
"include": "#comments"
},
{
"begin": "(<)((?:([-_a-zA-Z0-9]+)(:))?([-_a-zA-Z0-9:]+))(?=(\\s[^>]*)?></\\2>)",
"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": "(>)(</)((?:([-_a-zA-Z0-9]+)(:))?([-_a-zA-Z0-9:]+))(>)",
"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": "(</?)(?:([-\\w\\.]+)((:)))?([-\\w\\.:]+)",
"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",
"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": "<!\\[CDATA\\[",
"beginCaptures": {
"0": {
"name": "punctuation.definition.string.begin.xml"
}
},
"end": "]]>",
"endCaptures": {
"0": {
"name": "punctuation.definition.string.end.xml"
}
},
"name": "string.unquoted.cdata.xml"
}
],
"repository": {
"EntityDecl": {
"begin": "(<!)(ENTITY)\\s+(%\\s+)?([:a-zA-Z_][:a-zA-Z0-9_.-]*)(\\s+(?:SYSTEM|PUBLIC)\\s+)?",
"captures": {
"1": {
"name": "punctuation.definition.tag.xml"
},
"2": {
"name": "keyword.other.entity.xml"
},
"3": {
"name": "punctuation.definition.entity.xml"
},
"4": {
"name": "variable.language.entity.xml"
},
"5": {
"name": "keyword.other.entitytype.xml"
}
},
"end": "(>)",
"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"
}

93
lib/shiki-languages/data/grammars/xsl.json

@ -0,0 +1,93 @@
{
"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"
}

629
lib/shiki-languages/data/grammars/yaml.json

@ -0,0 +1,629 @@
{
"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"
}

2
lib/shiki-languages/dist/index.d.ts

@ -0,0 +1,2 @@
export * from './lang';
export * from './types';

6
lib/shiki-languages/dist/index.js

@ -0,0 +1,6 @@
"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"));

14
lib/shiki-languages/dist/lang.d.ts

@ -0,0 +1,14 @@
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[];

480
lib/shiki-languages/dist/lang.js

@ -0,0 +1,480 @@
"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);
});

12
lib/shiki-languages/dist/types.d.ts

@ -0,0 +1,12 @@
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;

2
lib/shiki-languages/dist/types.js

@ -0,0 +1,2 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });

22
lib/shiki-languages/package.json

@ -0,0 +1,22 @@
{
"name": "shiki-languages-clarity",
"version": "0.1.7",
"description": "Languages for shiki",
"keywords": [
"shiki",
"languages",
"grammar",
"TextMate"
],
"author": "Pine Wu <octref@gmail.com>",
"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"
}
}

35
next.config.js

@ -1,5 +1,3 @@
const { includeMarkdown } = require('@hashicorp/remark-plugins');
const withMdxEnhanced = require('next-mdx-enhanced');
const withBundleAnalyzer = require('@next/bundle-analyzer')({
enabled: process.env.ANALYZE === 'true',
@ -9,7 +7,10 @@ const strip = require('strip-markdown');
const path = require('path');
const remarkPlugins = [
[includeMarkdown, { resolveFrom: path.join(__dirname, 'src/common/_includes') }],
[
require('@hashicorp/remark-plugins'),
{ resolveFrom: path.join(__dirname, 'src/common/_includes') },
],
require('remark-squeeze-paragraphs'),
require('./src/lib/remark-paragraph-alerts'),
require('remark-external-links'),
@ -44,16 +45,7 @@ const getHeadings = mdxContent => {
};
};
module.exports = withBundleAnalyzer(
withMdxEnhanced({
layoutPath: 'src/components/layouts',
defaultLayout: true,
fileExtensions: ['mdx', 'md'],
remarkPlugins,
extendFrontMatter: {
process: getHeadings,
},
})({
module.exports = withBundleAnalyzer({
experimental: {
modern: true,
polyfillsOptimization: true,
@ -61,6 +53,20 @@ module.exports = withBundleAnalyzer(
},
pageExtensions: ['ts', 'tsx', 'md', 'mdx'],
webpack: (config, options) => {
config.module.rules.push({
test: /.mdx?$/, // load both .md and .mdx files
use: [
options.defaultLoaders.babel,
{
loader: '@mdx-js/loader',
options: {
remarkPlugins,
},
},
path.join(__dirname, './src/lib/md-loader'),
],
});
if (!options.isServer) {
config.node['fs'] = 'empty';
}
@ -94,5 +100,4 @@ module.exports = withBundleAnalyzer(
return config;
},
})
);
});

10
package.json

@ -24,13 +24,17 @@
"fathom-client": "^3.0.0",
"front-matter": "^4.0.2",
"fs-extra": "^9.0.1",
"gatsby-remark-shiki": "^0.1.2",
"github-slugger": "^1.3.0",
"gray-matter": "^4.0.2",
"html-react-parser": "^0.13.0",
"jsx-to-string": "^1.4.0",
"lodash.debounce": "^4.0.8",
"mdi-react": "7.3.0",
"next": "^9.4.5-canary.34",
"next": "^9.4.5-canary.38",
"next-google-fonts": "^1.1.0",
"next-mdx-enhanced": "^3.0.0",
"next-mdx-remote": "^0.6.0",
"next-optimized-images": "^2.6.1",
"nookies": "^2.3.2",
"nprogress": "^0.2.0",
@ -59,6 +63,7 @@
"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",
@ -97,7 +102,8 @@
"typecheck:watch": "npm run typecheck -- --watch"
},
"resolutions": {
"preact": "^10.4.4"
"preact": "^10.4.4",
"shiki-languages": "file:./lib/shiki-languages"
},
"prettier": "@blockstack/prettier-config"
}

2
src/common/_data/clarityRef.json

File diff suppressed because one or more lines are too long

2
src/common/constants.ts

@ -1,3 +1,5 @@
export const SIDEBAR_WIDTH = 280;
export const TOC_WIDTH = 280;
export const CONTENT_MAX_WIDTH = 1104;
export const SHIKI_THEME = 'Material-Theme-Default';

2
src/common/hooks/use-active-heading.tsx

@ -12,7 +12,7 @@ interface ActiveHeadingReturn {
export const useActiveHeading = (_slug: string): ActiveHeadingReturn => {
const router = useRouter();
const { asPath } = router;
const asPath = router && router.asPath;
const { activeSlug, slugInView, doChangeActiveSlug, doChangeSlugInView } = useAppState();
const urlHash = asPath?.includes('#') && asPath.split('#')[1];
const location = typeof window !== 'undefined' && window.location.href;

17
src/common/mdx.ts

@ -0,0 +1,17 @@
export const remarkPlugins = (defaultLang: string) => [
[
require('../lib/remark-shiki'),
{ theme: 'Material-Theme-Default', defaultLang: defaultLang },
],
require('remark-slug'),
];
const replaceTicks = value => {
const _value = value.trim();
if (_value.startsWith('`') && !_value.endsWith('`')) {
return _value.replace('`', '');
}
return _value;
};
export const wrapValueInTicks = value => '`' + value.replace('`', '').replace('`', '') + '`';

41
src/common/shiki-clarity.ts

@ -0,0 +1,41 @@
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,
},
};
};

120
src/components/clarity-ref.tsx

@ -1,52 +1,76 @@
import React from 'react';
import clarityRefData from '@common/_data/clarityRef.json';
import MDX from '@mdx-js/runtime';
import { MDXComponents } from '@components/mdx/mdx-components';
import { slugify } from '@common/utils';
export const ClarityKeywordReference = () =>
clarityRefData.keywords.map((entry, key) => {
return (
<React.Fragment key={key}>
<MDXComponents.h3 id={slugify(entry.name)}>{entry.name}</MDXComponents.h3>
<MDXComponents.p>
<MDXComponents.inlineCode>{entry.output_type}</MDXComponents.inlineCode>
</MDXComponents.p>
<MDXComponents.p>
<MDX components={MDXComponents}>{entry.description}</MDX>
</MDXComponents.p>
<MDXComponents.h4 id={slugify(entry.name) + '-example'}>Example</MDXComponents.h4>
<MDXComponents.pre>
{/* @ts-ignore*/}
<MDXComponents.code children={entry.example.toString()} />
</MDXComponents.pre>
</React.Fragment>
);
import renderToString from 'next-mdx-remote/render-to-string';
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 convertKeywordsToMdx = entry => {
return `
### ${entry.name}
${wrapValueInTicks(entry.output_type)}
${entry.description}
#### Example
${wrapInClarityCodes(entry.example)}
`;
};
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)}
`;
};
const makeMdxDocument = (data, converter) => {
let mdx = ``;
data.forEach(entry => {
mdx += converter(entry);
});
export const ClarityFunctionReference = () =>
clarityRefData.functions.map((entry, key) => {
return (
<React.Fragment key={key}>
<MDXComponents.h3 id={slugify(entry.name)}>{entry.name}</MDXComponents.h3>
<MDXComponents.p>
<MDXComponents.inlineCode>{entry.signature}</MDXComponents.inlineCode>
</MDXComponents.p>
<MDXComponents.p>
<strong>INPUT:</strong>{' '}
<MDXComponents.inlineCode>{entry.input_type}</MDXComponents.inlineCode>
</MDXComponents.p>
<MDXComponents.p>
<strong>OUTPUT:</strong>{' '}
<MDXComponents.inlineCode>{entry.output_type}</MDXComponents.inlineCode>
</MDXComponents.p>
<MDXComponents.p>
<MDX components={MDXComponents}>{entry.description}</MDX>
</MDXComponents.p>
<MDXComponents.h4 id={slugify(entry.name) + '-example'}>Example</MDXComponents.h4>
<MDXComponents.pre>
{/* @ts-ignore*/}
<MDXComponents.code children={entry.example.toString()} />
</MDXComponents.pre>
</React.Fragment>
);
return mdx;
};
// getStaticProps
export async function convertClarityRefToMdx() {
const functionsMdx = makeMdxDocument(clarityRefData.functions, convertFunctionsToMdx);
const keywordsMdx = makeMdxDocument(clarityRefData.keywords, convertKeywordsToMdx);
const functions = await renderToString(functionsMdx, MDXComponents, {
remarkPlugins: remarkPlugins('clarity'),
});
const keywords = await renderToString(keywordsMdx, MDXComponents, {
remarkPlugins: remarkPlugins('clarity'),
});
return {
props: {
reference: {
functions,
keywords,
},
},
};
}
export const ClarityKeywordReference = ({ reference }) =>
hydrate(reference.keywords, MDXComponents);
export const ClarityFunctionReference = ({ reference }) =>
hydrate(reference.functions, MDXComponents);

99
src/components/cli-reference.tsx

@ -1,45 +1,66 @@
import React from 'react';
import { cliReferenceData } from '@common/_data/cliRef';
import { Text } from '@components/typography';
import MDX from '@mdx-js/runtime';
import { MDXComponents } from '@components/mdx/mdx-components';
import GithubSlugger from 'github-slugger';
const Item = React.memo(({ entry, index }: any) => {
const slugger = new GithubSlugger();
return (
<React.Fragment key={index}>
<MDXComponents.h2 id={slugger.slug(entry.command)}>{entry.command}</MDXComponents.h2>
<MDXComponents.p>
<Text fontWeight="bold">Group</Text>: {entry.group}
</MDXComponents.p>
<MDX components={MDXComponents}>{entry.usage}</MDX>
<MDXComponents.h3 id={slugger.slug(entry.command + ' Arguments')}>Arguments</MDXComponents.h3>
<MDXComponents.table>
<tr>
<MDXComponents.th>Name</MDXComponents.th>
<MDXComponents.th>Type</MDXComponents.th>
<MDXComponents.th>Value</MDXComponents.th>
<MDXComponents.th>Format</MDXComponents.th>
</tr>
{entry.args.map((arg, argKey) => (
<tr key={argKey}>
<MDXComponents.td>{arg.name}</MDXComponents.td>
<MDXComponents.td>{arg.type}</MDXComponents.td>
<MDXComponents.td>{arg.value}</MDXComponents.td>
<MDXComponents.td>
<MDXComponents.inlineCode>{arg.format}</MDXComponents.inlineCode>
</MDXComponents.td>
</tr>
))}
</MDXComponents.table>
</React.Fragment>
);
import renderToString from 'next-mdx-remote/render-to-string';
import hydrate from 'next-mdx-remote/hydrate';
import { remarkPlugins, wrapValueInTicks } from '@common/mdx';
const wrapInCode = value => value && '<inlineCode>' + value + '</inlineCode>';
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 convertEntryToMarkdown = entry => {
return `
## ${entry.command}
**Group:**: ${entry.group}
${entry.usage}
### Arguments
| Name | Type | Value | Format |
| ------------ | ----------- | ------- | ------- |
${entry.args.map(makeMdxTableRow)}
`;
};
const makeMdxDocument = data => {
let mdx = ``;
data.forEach(entry => {
mdx += convertEntryToMarkdown(entry);
});
return mdx;
};
export const CLIReferenceTable = () =>
cliReferenceData.map((entry, key) => {
return <Item entry={entry} index={key} />;
export async function convertCliRefToMdx() {
const mdx = makeMdxDocument(cliReferenceData);
const reference = await renderToString(mdx, MDXComponents, {
remarkPlugins: remarkPlugins('bash'),
});
return { props: { reference } };
}
export const CLIReferenceTable = ({ reference }) => hydrate(reference, MDXComponents);

2
src/components/content-wrapper.tsx

@ -4,7 +4,7 @@ import { Flex, FlexProps, space } from '@blockstack/ui';
const ContentWrapper: React.FC<FlexProps> = props => (
<Flex
flexShrink={0}
px={space('base')}
px={space(['none', 'none', 'base', 'base'])}
pt={space(['base', 'base', 'extra-loose'])}
mt={space('extra-loose')}
pb={[4, 4, 6]}

82
src/components/home/code-examples.tsx

@ -1,82 +0,0 @@
import React from 'react';
import { Box, Flex, space, color, themeColor } from '@blockstack/ui';
import { border } from '@common/utils';
import { SimpleCodeBlock } from '@components/code-block/components';
import { ExampleComponent, exampleCode, gaiaHubUsage, appItem } from '@components/example';
import { InlineCode } from '@components/mdx';
export const CodeExamples = () => {
const [tab, setTab] = React.useState<'example' | 'gaiaHubUsage' | 'appItem'>('example');
const getExampleCode = () => {
switch (tab) {
case 'example':
return exampleCode;
case 'gaiaHubUsage':
return gaiaHubUsage;
case 'appItem':
return appItem;
}
};
const handleSetTab = (value: 'example' | 'gaiaHubUsage' | 'appItem') => {
console.log(value);
setTab(value);
};
const tabs: { label: string; slug: 'example' | 'gaiaHubUsage' | 'appItem' }[] = [
{ label: `<ExampleComponent />`, slug: 'example' },
{ label: `<GaiaHubUsage />`, slug: 'gaiaHubUsage' },
{ label: `<AppItem />`, slug: 'appItem' },
];
return (
<Flex flexDirection={['column', 'column', 'row', 'row']} justifyContent="space-between">
<Box
bg="white"
border={border()}
p={space('base')}
borderRadius="lg"
boxShadow="mid"
width={['100%', '100%', 'calc(100% - 352px)', 'calc(100% - 352px)']}
order={[3, 3, 1, 1]}
>
<Flex flexWrap="wrap">
{tabs.map((_tab, key) => {
return (
<Box
mr={space('base')}
mb={space('base')}
_hover={{
cursor: 'pointer',
borderColor: themeColor('ink.400'),
}}
onClick={() => handleSetTab(_tab.slug)}
>
<InlineCode
borderColor={(_tab.slug === tab && themeColor('blue.400')) || 'inherit'}
color={_tab.slug === tab && color('accent')}
>
{_tab.label}
</InlineCode>
</Box>
);
})}
</Flex>
<SimpleCodeBlock
showLineNumbers
flexGrow={1}
language="jsx"
editorCode={getExampleCode()}
/>
</Box>
<Box
display={['none', 'none', 'block', 'block']}
order={[1, 1, 2, 2]}
width="320px"
overflow="hidden"
flexShrink={0}
>
<ExampleComponent />
</Box>
</Flex>
);
};

21
src/components/layouts/default-layout.tsx

@ -0,0 +1,21 @@
import React from 'react';
import { Contents } from '@components/layouts/docs-layout';
import Head from 'next/head';
export const Layout = ({ meta, ...props }) => {
const {
title,
description = 'The Blockstack design system, built with React and styled-system.',
headings,
} = meta;
return (
<>
<Head>
<title>{title || (headings?.length && headings[0].content)} | Blockstack Docs</title>
<meta name="description" content={description} />
</Head>
<Contents headings={headings}>{props.children}</Contents>
</>
);
};
export default Layout;

28
src/components/layouts/docs-layout.tsx

@ -1,5 +1,5 @@
import React from 'react';
import { Flex, color, space } from '@blockstack/ui';
import { Flex, color, space, themeColor } from '@blockstack/ui';
import { SideNav } from '../side-nav';
import { Header } from '../header';
import { Main } from '../main';
@ -102,6 +102,31 @@ 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'),
},
@ -225,7 +250,6 @@ export const Contents = ({ headings, children }) => (
: '100%'
}
mx="unset"
px="unset"
pt="unset"
pr={space('base-tight')}
css={css(styleOverwrites)}

35
src/components/mdx/mdx-components.tsx

@ -1,7 +1,6 @@
import React from 'react';
import { Box, space, BoxProps, color, themeColor } from '@blockstack/ui';
import css from '@styled-system/css';
import dynamic from 'next/dynamic';
import {
Heading,
Pre,
@ -13,8 +12,7 @@ import {
} from '@components/mdx/components';
import { Text } from '@components/typography';
import { border } from '@common/utils';
const CodeBlock = dynamic(() => import('../code-block'));
import { useRouter } from 'next/router';
const BaseHeading: React.FC<BoxProps> = React.memo(props => (
<Heading width="100%" mt={space('base-loose')} {...props} />
@ -105,9 +103,32 @@ export const BlockQuote: React.FC<BoxProps> = ({ children, className, ...rest })
);
};
export const Img: React.FC<BoxProps & { loading?: string; src?: string; alt?: string }> = props => (
<Box loading="lazy" display="block" mx="auto" as="img" {...props} />
);
const imgix = 'https://docs-stacks.imgix.net/';
const params = '?auto=compress,format';
const useImgix = (src: string) => {
let _src = src;
const router = useRouter();
if (!src.startsWith('http')) {
const path = src.startsWith('/') ? '' : router.pathname.split('/')[1] + '/';
_src = `${imgix + path + src + params}`;
}
return _src;
};
export const Img: React.FC<BoxProps & { loading?: string; src?: string; alt?: string }> = ({
src: _src,
...rest
}) => {
const src = useImgix(_src);
const props = {
src,
...rest,
};
return <Box loading="lazy" display="block" mx="auto" as="img" {...props} />;
};
const Code: React.FC<BoxProps> = props => <Box as="code" {...props} />;
export const MDXComponents = {
h1: H1,
@ -117,7 +138,7 @@ export const MDXComponents = {
h5: H5,
h6: H6,
inlineCode: InlineCode,
code: CodeBlock,
code: Code,
pre: Pre,
br: Br,
hr: Hr,

20
src/lib/md-loader.js

@ -0,0 +1,20 @@
const fm = require('gray-matter');
// makes mdx in next.js suck less by injecting necessary exports so that
// the docs are still readable on github
// (Shamelessly stolen from Expo.io docs)
// @see https://github.com/expo/expo/blob/master/docs/common/md-loader.js
module.exports = async function (src) {
const callback = this.async();
const { content, data } = fm(src);
const layout = data.layout || 'Docs';
const code =
`import { Layout } from '@components/Layouts/default-layout';
export const meta = ${JSON.stringify(data)};
export default ({ children, ...props }) => (
<Layout meta={meta} {...props}>{children}</Layout>
);
` + content;
return callback(null, content);
};

37
src/lib/remark-shiki.js

@ -0,0 +1,37 @@
const shiki = require('shiki');
const visit = require('unist-util-visit');
module.exports = function shikiPlugin(options) {
return async function transformer(tree) {
const theme = (options && options.theme) || 'zeit';
let shikiTheme;
try {
shikiTheme = shiki.getTheme(theme);
} catch (_) {
try {
shikiTheme = shiki.loadTheme(theme);
} catch (_) {
throw new Error(`Unable to load theme: ${theme}`);
}
}
const highlighter = await shiki.getHighlighter({
theme: shikiTheme,
});
visit(tree, 'code', (node, _, parent) => {
node.type = 'html';
node.children = undefined;
if (!node.lang && !options.defaultLang) {
node.value = `<pre class="shiki-unknown"><code>${node.value}</code></pre>`;
return;
}
node.value = highlighter.codeToHtml(
node.value,
(node.lang && node.lang.toLowerCase()) || options.defaultLang
);
});
};
};

2
src/pages/core/atlas/howitworks.md

@ -162,7 +162,7 @@ but the 1st chunk is missing.
Developers can query a node's inventory vector as follows:
```python
```py
>>> import blockstack
>>> result = blockstack.lib.client.get_zonefile_inventory("https://node.blockstack.org:6263", 0, 524288)
>>> print len(result['inv'])

6
src/pages/core/atlas/howtouse.md

@ -31,7 +31,7 @@ A client can look up a chunk with the `get_zonefiles()` method. If successful,
the returned payload will be a `dict` with a `zonefiles` key that maps the chunk
hashes to their respective data.
```python
```py
>>> import blockstack
>>> data = blockstack.lib.client.get_zonefiles('https://node.blockstack.org:6263', ['1b89a685f4c4ea245ce9433d0b29166c22175ab4'])
>>> print data['zonefiles']['1b89a685f4c4ea245ce9433d0b29166c22175ab4']
@ -64,7 +64,7 @@ Browser](https://github.com/blockstack/blockstack-browser) for doing this.
Once the name operation is confirmed, you can announce the data to the
Atlas network. You can do so with the Python client as follows:
```python
```py
>>> import blockstack
>>> import base64
>>> data = "..." # this is the chunk data you will announce
@ -100,7 +100,7 @@ peer graph, and replicate the chunk to each of them as well.
For example, this code will replicate the chunk to not only
`https://node.blockstack.org:6263`, but also to its immediate neighbors.
```python
```py
>>> import blockstack
>>> import base64
>>> data = "..." # this is the chunk you will replicate widely

7
src/pages/core/cmdLineRef.md

@ -2,10 +2,13 @@
title: Blockstack CLI Reference
---
import { CLIReferenceTable } from '@components/cli-reference'
import { convertCliRefToMdx, CLIReferenceTable } from '@components/cli-reference'
export const getStaticProps = convertCliRefToMdx
# Blockstack CLI reference
The command line is intended for developers only. Developers can use the command
line to test and debug Blockstack applications in ways that the Blockstack
Browser does not yet support. Using the command line, developers can:
@ -66,4 +69,4 @@ If you run into `EACCES` permissions errors, try the following:
To see the usage and options for the command in general, enter `blockstack-cli` without any subcommands. To see a list of subcommands enter `blockstack-cli help`. Enter `blockstack-cli SUBCOMMAND_NAME help` to see a subcommand with its usage. The following are the available subcommands:
<CLIReferenceTable />
<CLIReferenceTable reference={props.reference} />

4
src/pages/core/naming/did.md

@ -50,7 +50,7 @@ do.
Developers can programmatically resolve DIDs via the Python API:
```Python
```python
>>> import blockstack
>>> blockstack.lib.client.resolve_DID('did:stack:v0:16EMaNw3pkn3v6f2BgnSSs53zAKH4Q8YJg-1', hostport='https://node.blockstack.org:6263')
{'public_key': '020fadbbcea0ff3b05f03195b41cd991d7a0af8bd38559943aec99cbdaf0b22cc8'}
@ -87,7 +87,7 @@ second is encoded with version byte 63).
You can see this play out in practice with the following code snippit:
```python
```py
>>> import blockstack
>>> blockstack.lib.client.get_name_record('jude.statism.id', hostport='https://node.blockstack.org:6263')['address']
u'16EMaNw3pkn3v6f2BgnSSs53zAKH4Q8YJg'

10
src/pages/core/smart/clarityRef.md

@ -1,8 +1,10 @@
---
description: 'Clarity: Language Reference'
description: 'See a detailed list of all keywords and functions for the Clarity language.'
---
import { ClarityKeywordReference, ClarityFunctionReference } from '@components/clarity-ref'
import { ClarityKeywordReference, ClarityFunctionReference, convertClarityRefToMdx } from '@components/clarity-ref'
export const getStaticProps = convertClarityRefToMdx
# Clarity Language Reference
@ -134,8 +136,8 @@ The following limitations are imposed on contract calls:
## Keyword reference
<ClarityKeywordReference />
<ClarityKeywordReference reference={props.reference} />
## Function reference
<ClarityFunctionReference />
<ClarityFunctionReference reference={props.reference} />

6
src/pages/core/smart/tutorial-counter.md

@ -95,7 +95,7 @@ Let's get familiar with the tests to understand what the new smart contract shou
2. With the editor of your choice, open `contracts/counter.clar` and add the following lines of code:
```cl
```clarity
(define-data-var counter int 0)
(define-public (get-counter)
@ -122,7 +122,7 @@ Let's get familiar with the tests to understand what the new smart contract shou
4. Add the following lines to the bottom of the `counter.clar` file and take a few seconds to review them:
```cl
```clarity
(define-public (increment)
(begin
(var-set counter (+ (var-get counter) 1))
@ -154,7 +154,7 @@ Let's get familiar with the tests to understand what the new smart contract shou
Here is how the final smart contract file should look like. Note that you can find the `decrement` function in here - in case you want to compare with your own implementation:
```cl
```clarity
(define-data-var counter int 0)
(define-public (get-counter)

96
src/pages/develop/radiks-setup.md

@ -1,37 +1,45 @@
---
title: Integrate Radiks
description: Learn how to setup Radiks with your application.
---
# Set-up Radiks for your DApp
Using Radiks with your application requires a Radiks server and a client application constructed to use the server. In this article, you learn how to install, setup, and run a pre-packaged Radiks server that connects to MongoDB. You also learn how to establish your DApp application as a client for that server.
Using Radiks with your application requires a Radiks server and a client application constructed to use the server.
In this article, you learn how to install, setup, and run a pre-packaged Radiks server that connects to MongoDB.
You also learn how to establish your DApp application as a client for that server.
## Task 1. Set up your Radiks server
## Task 1: Set up your Radiks server
Radiks-server is a `node.js` application that uses [MongoDB](https://www.mongodb.com/) as an underlying database.
### Install and configure MongoDB
In the future, Radiks-server will support various different databases, but right now, only MongoDB 3.6 or higher is supported. MongoDB 3.6 and higher contains fixes required for naming patterns in keys.
In the future, Radiks-server will support various different databases, but right now, only MongoDB 3.6 or higher is
supported. MongoDB 3.6 and higher contains fixes required for naming patterns in keys.
-> The steps assume you want to install and run the MongoDB software locally on your workstation for testing and development. If you are deploying for a production application, you will install MongoDB on your application server or on a server connected to it.
-> The steps assume you want to install and run the MongoDB software locally on your workstation for testing and
development. If you are deploying for a production application, you will install MongoDB on your application
server or on a server connected to it.
1. <a href="https://docs.mongodb.com/manual/administration/install-community/" target="_blank">Download and install MongoDB 3.6 or higher</a> on your workstation.
#### Step 1: [Download and install MongoDB 3.6 or higher](https://docs.mongodb.com/manual/administration/install-community/) on your workstation.
You can also install MongoDB using your favorite package manager; for example, Homebrew is recommended for macOS. If you are testing on a local workstation, you can use a `docker` image instead of installing locally.
You can also install MongoDB using your favorite package manager; for example, Homebrew is recommended for macOS.
If you are testing on a local workstation, you can use a `docker` image instead of installing locally.
2. Start the MongoDB service and verify it is running.
#### Step 2: Start the MongoDB service and verify it is running.
3. On your MongoDB instance, create a database for your application data.
#### Step 3: On your MongoDB instance, create a database for your application data.
You can use the <a href="https://docs.mongodb.com/manual/mongo/" target="_blank">Mongo shell</a> to do this, or you can <a href="https://www.mongodb.com/download-center/compass" target="_blank">install the MongoDB Compass</a> software to explore and work with MongoDB data.
You can use the [Mongo shell](https://docs.mongodb.com/manual/mongo/) to do this, or you can [install the MongoDB Compass software](https://www.mongodb.com/download-center/compass) to explore and work with MongoDB data.
4. Create a username/password combination with `root` privileges on your new database.
#### Step 4: Create a username/password combination with `root` privileges on your new database.
### Install and start the Radiks server
The easiest way to run `radiks-server` is to use the pre-packaged `node.js` server.
1. Install the `radiks-server` on a workstation or server.
#### Step 1: Install the `radiks-server` on a workstation or server.
```bash
npm install -g radiks-server
@ -43,23 +51,28 @@ The easiest way to run `radiks-server` is to use the pre-packaged `node.js` serv
yarn global add radiks-server
```
The default port for Mongodb is `27017`; your instance may be configured differently. By default, Radiks-server will use `'mongodb://localhost:27017/radiks-server'` as the `MongoDB_URI` value. This is suitable for local testing, but in production, you'll want to change the hostname and possibly the database name.
The default port for Mongodb is `27017`; your instance may be configured differently. By default,
Radiks-server will use `'mongodb://localhost:27017/radiks-server'` as the `MongoDB_URI` value.
This is suitable for local testing, but in production, you'll want to change the hostname and possibly
the database name.
2. Start the `radiks-server` in the command line to confirm your installation.
#### Step 2: Start the `radiks-server` in the command line to confirm your installation.
```bash
$ radiks-server
(node:37750) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
(node:37750) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option `useUnifiedTopology: true` to the MongoClient constructor.
radiks-server is ready on http://localhost:1260
```
The `radiks-server` defaults to running on port `1260`. To change the default port, specify the `PORT` environment variable in your environment.
3. By default, the server is running at `http://localhost:1260`
-> By default, the server is running at `http://localhost:1260`
4. Stop the `radiks` server process after you confirm it runs, and your installation was a success.
#### Step 3: Stop the `radiks` server
## Task 2. Set up your application
Once you confirm it runs and your installation was a success, exit the `radiks-server` process.
## Task 2: Set up your application
You must set up your application to use Radiks. This requires installing the `radiks` client package and then configuring your application to connect to your Radiks server.
@ -70,30 +83,25 @@ If you are using `blockstack.js` version 18 or earlier, you must use the Radiks
1. Change directory to the root of you application code.
2. Install the `radiks` client package.
<table class="uk-table uk-table-small">
<thead>
<tr>
<td><strong>Use npm</strong></td>
<td><strong>Use yarn</strong></td>
</tr>
</thead>
<tbody>
<tr>
<td><code class="highlighter-rouge">npm install --save radiks</code></td>
<td><code class="highlighter-rouge">yarn add radiks</code></td>
</tr>
</tbody>
</table>
```bash
npm install radiks
```
Or, if you prefer `yarn`:
```bash
yarn add radiks
```
### Configure the MongoDB for your application
1. Start the mongo shell application.
#### Step 1: Start the mongo shell application.
```bash
$ mongo
MongoDB shell version v4.2.0
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("8d43cf80-490d-4cac-8bd6-40eec5c128de") }
Implicit session: session `{ "id" : UUID("8d43cf80-490d-4cac-8bd6-40eec5c128de") }`
MongoDB server version: 4.2.0
....
@ -102,7 +110,7 @@ If you are using `blockstack.js` version 18 or earlier, you must use the Radiks
>
```
2. Create a new database for your application.
#### Step 2: Create a new database for your application.
```bash
> show dbs
@ -116,17 +124,17 @@ If you are using `blockstack.js` version 18 or earlier, you must use the Radiks
config 0.000GB
local 0.000GB
> db.createUser({user: "admin", pwd:"foobar1",roles: ["readWrite","dbAdmin"]});
Successfully added user: { "user" : "admin", "roles" : [ "readWrite", "dbAdmin" ] }
Successfully added user: `{ "user" : "admin", "roles" : [ "readWrite", "dbAdmin" ] }`
```
3. Add a user with administrative rights to the database.
#### Step 3: Add a user with administrative rights to the database.
```bash
> db.createUser({user: "admin", pwd:"foobar1",roles: ["readWrite","dbAdmin"]});
Successfully added user: { "user" : "admin", "roles" : [ "readWrite", "dbAdmin" ] }
Successfully added user: `{ "user" : "admin", "roles" : [ "readWrite", "dbAdmin" ] }`
```
4. Create an `MONGODB_URI` environment variable on the same machine where you are running the `radiks-server`.
#### Step 4: Create an `MONGODB_URI` environment variable on the same machine where you are running the `radiks-server`.
Use the `mongodb://username:password@host:port/db_name` format for your variable. For example, to set this variable in a `bash` shell:
@ -134,9 +142,9 @@ If you are using `blockstack.js` version 18 or earlier, you must use the Radiks
export MONGODB_URI="mongodb://admin:foobar1@localhost:27017/test1"
```
## Task 3. Add startup code and build your application
## Task 3: Add startup code and build your application
To set up radiks.js, you only need to configure the URL that your Radiks-server instance is running on. If you're using the pre-built Radiks server, this will be `http://localhost:1260`. If you're in production or are using a custom Radiks server, you'll need to specify the exact URL where it's available.
To set up `radiks`, you only need to configure the URL that your Radiks-server instance is running on. If you're using the pre-built Radiks server, this will be `http://localhost:1260`. If you're in production or are using a custom Radiks server, you'll need to specify the exact URL where it's available.
Radiks also is compatible with version 19 of blockstack.js, which requires you to configure a `UserSession` object to handle all user-data-related methods. You'll need to define this and pass it to your Radiks configuration so that Radiks can know how to fetch information about the current logged in user.
@ -144,9 +152,9 @@ Radiks also is compatible with version 19 of blockstack.js, which requires you t
To configure your application as a `radiks` client, do the following:
1. Start your application so that a `UserSession` allows the app to both write and publish data:
#### Step 1: Start your application so that a `UserSession` allows the app to both write and publish data:
```js
```jsx
import { UserSession, AppConfig } from 'blockstack';
import { configure } from 'radiks';
@ -160,11 +168,11 @@ To configure your application as a `radiks` client, do the following:
});
```
2. Add authentication to your application
#### Step 2: Add authentication to your application
After your user logs in with Blockstack, you'll have some code to save the user's data in your applications `localStorage`. You'll want to use the same `UserSession` you configured with Radiks, which can be fetched from the `getConfig` method.
```js
```jsx
import { User, getConfig } from 'radiks';
const handleSignIn = () => {

607
yarn.lock

File diff suppressed because it is too large
Loading…
Cancel
Save