shiki 1.1.7 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle-full.d.mts +3 -2
- package/dist/bundle-full.mjs +3 -4
- package/dist/bundle-web.d.mts +4 -3
- package/dist/bundle-web.mjs +6 -4
- package/dist/chunks/wasm-dynamic.mjs +5 -0
- package/dist/index.d.mts +1 -2
- package/dist/index.mjs +1 -1
- package/dist/langs/astro.mjs +1 -1
- package/dist/langs/bicep.mjs +1 -1
- package/dist/langs/crystal.mjs +1 -1
- package/dist/langs/dart.mjs +1 -1
- package/dist/langs/gleam.d.mts +1 -0
- package/dist/langs/gleam.mjs +6 -0
- package/dist/langs/glimmer-js.mjs +1 -1
- package/dist/langs/glimmer-ts.mjs +1 -1
- package/dist/langs/go.mjs +1 -1
- package/dist/langs/hcl.mjs +1 -1
- package/dist/langs/jl.d.mts +1 -0
- package/dist/langs/jl.mjs +9 -0
- package/dist/langs/julia.mjs +1 -1
- package/dist/langs/markdown.mjs +1 -1
- package/dist/langs/mojo.mjs +3 -3
- package/dist/langs/move.mjs +1 -1
- package/dist/langs/nginx.mjs +1 -1
- package/dist/langs/nushell.mjs +1 -1
- package/dist/langs/shellscript.mjs +1 -1
- package/dist/langs/terraform.mjs +1 -1
- package/dist/langs/vue-directives.mjs +1 -1
- package/dist/langs/zig.mjs +1 -1
- package/dist/langs.d.mts +1 -1
- package/dist/langs.mjs +8 -0
- package/dist/themes/andromeeda.mjs +1 -0
- package/dist/themes/catppuccin-frappe.mjs +9 -7
- package/dist/themes/catppuccin-latte.mjs +9 -7
- package/dist/themes/catppuccin-macchiato.mjs +9 -7
- package/dist/themes/catppuccin-mocha.mjs +9 -7
- package/dist/themes/github-dark-default.d.mts +1 -0
- package/dist/themes/github-dark-default.mjs +654 -0
- package/dist/themes/github-light-default.d.mts +1 -0
- package/dist/themes/github-light-default.mjs +639 -0
- package/dist/themes/houston.d.mts +1 -0
- package/dist/themes/houston.mjs +1888 -0
- package/dist/themes/one-dark-pro.mjs +6 -3
- package/dist/themes/vitesse-black.mjs +7 -7
- package/dist/themes/vitesse-dark.mjs +7 -7
- package/dist/themes/vitesse-light.mjs +7 -7
- package/dist/themes.d.mts +1 -1
- package/dist/themes.mjs +18 -0
- package/dist/types/{index.d.d.mts → wasm-dynamic.d.mts} +5 -1
- package/package.json +5 -4
package/dist/bundle-full.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { R as Root } from './types/
|
|
1
|
+
import { R as Root } from './types/wasm-dynamic.mjs';
|
|
2
|
+
export { g as getWasmInlined } from './types/wasm-dynamic.mjs';
|
|
2
3
|
import * as _shikijs_core from '@shikijs/core';
|
|
3
4
|
import { HighlighterGeneric } from '@shikijs/core';
|
|
4
5
|
export * from '@shikijs/core';
|
|
@@ -6,7 +7,7 @@ import { BundledLanguage } from './langs.mjs';
|
|
|
6
7
|
export { bundledLanguages, bundledLanguagesAlias, bundledLanguagesBase, bundledLanguagesInfo } from './langs.mjs';
|
|
7
8
|
import { BundledTheme } from './themes.mjs';
|
|
8
9
|
export { bundledThemes, bundledThemesInfo } from './themes.mjs';
|
|
9
|
-
|
|
10
|
+
import '@shikijs/core/types';
|
|
10
11
|
|
|
11
12
|
type Highlighter = HighlighterGeneric<BundledLanguage, BundledTheme>;
|
|
12
13
|
/**
|
package/dist/bundle-full.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import getWasm from 'shiki/wasm';
|
|
2
|
-
export { default as getWasmInlined } from 'shiki/wasm';
|
|
3
1
|
import { bundledLanguages } from './langs.mjs';
|
|
4
2
|
export { bundledLanguagesAlias, bundledLanguagesBase, bundledLanguagesInfo } from './langs.mjs';
|
|
3
|
+
import { g as getWasmInlined } from './chunks/wasm-dynamic.mjs';
|
|
5
4
|
import { bundledThemes } from './themes.mjs';
|
|
6
5
|
export { bundledThemesInfo } from './themes.mjs';
|
|
7
6
|
import { createdBundledHighlighter, createSingletonShorthands } from '@shikijs/core';
|
|
@@ -10,7 +9,7 @@ export * from '@shikijs/core';
|
|
|
10
9
|
const getHighlighter = /* @__PURE__ */ createdBundledHighlighter(
|
|
11
10
|
bundledLanguages,
|
|
12
11
|
bundledThemes,
|
|
13
|
-
|
|
12
|
+
getWasmInlined
|
|
14
13
|
);
|
|
15
14
|
const {
|
|
16
15
|
codeToHtml,
|
|
@@ -23,4 +22,4 @@ const {
|
|
|
23
22
|
getHighlighter
|
|
24
23
|
);
|
|
25
24
|
|
|
26
|
-
export { bundledLanguages, bundledThemes, codeToHast, codeToHtml, codeToTokens, codeToTokensBase, codeToTokensWithThemes, getHighlighter, getSingletonHighlighter };
|
|
25
|
+
export { bundledLanguages, bundledThemes, codeToHast, codeToHtml, codeToTokens, codeToTokensBase, codeToTokensWithThemes, getHighlighter, getSingletonHighlighter, getWasmInlined };
|
package/dist/bundle-web.d.mts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { R as Root } from './types/
|
|
1
|
+
import { R as Root } from './types/wasm-dynamic.mjs';
|
|
2
|
+
export { g as getWasmInlined } from './types/wasm-dynamic.mjs';
|
|
2
3
|
import * as _shikijs_core from '@shikijs/core';
|
|
3
4
|
import { BundledLanguageInfo, DynamicImportLanguageRegistration, HighlighterGeneric } from '@shikijs/core';
|
|
4
5
|
export * from '@shikijs/core';
|
|
5
6
|
import { BundledTheme } from './themes.mjs';
|
|
6
7
|
export { bundledThemes, bundledThemesInfo } from './themes.mjs';
|
|
7
|
-
|
|
8
|
+
import '@shikijs/core/types';
|
|
8
9
|
|
|
9
10
|
declare const bundledLanguagesInfo: BundledLanguageInfo[];
|
|
10
11
|
declare const bundledLanguagesBase: {
|
|
@@ -13,7 +14,7 @@ declare const bundledLanguagesBase: {
|
|
|
13
14
|
declare const bundledLanguagesAlias: {
|
|
14
15
|
[k: string]: DynamicImportLanguageRegistration;
|
|
15
16
|
};
|
|
16
|
-
type BundledLanguage = 'angular-html' | 'angular-ts' | 'astro' | 'bash' | 'blade' | 'c' | 'c++' | 'coffee' | 'coffeescript' | 'cpp' | 'css' | 'glsl' | 'gql' | 'graphql' | 'haml' | 'handlebars' | 'hbs' | 'html' | 'html-derivative' | 'http' | 'imba' | 'jade' | 'java' | 'javascript' | 'jinja' | 'jison' | 'js' | 'json' | 'json5' | 'jsonc' | 'jsonl' | 'jsx' | 'julia' | 'less' | 'lua' | 'markdown' | 'marko' | 'md' | 'mdc' | 'mdx' | 'php' | 'postcss' | 'pug' | 'py' | 'python' | 'r' | 'rb' | 'ruby' | 'sass' | 'scss' | 'sh' | 'shell' | 'shellscript' | 'sql' | 'styl' | 'stylus' | 'svelte' | 'toml' | 'ts' | 'tsx' | 'typescript' | 'vue' | 'vue-html' | 'wasm' | 'wgsl' | 'xml' | 'yaml' | 'yml' | 'zsh';
|
|
17
|
+
type BundledLanguage = 'angular-html' | 'angular-ts' | 'astro' | 'bash' | 'blade' | 'c' | 'c++' | 'coffee' | 'coffeescript' | 'cpp' | 'css' | 'glsl' | 'gql' | 'graphql' | 'haml' | 'handlebars' | 'hbs' | 'html' | 'html-derivative' | 'http' | 'imba' | 'jade' | 'java' | 'javascript' | 'jinja' | 'jison' | 'jl' | 'js' | 'json' | 'json5' | 'jsonc' | 'jsonl' | 'jsx' | 'julia' | 'less' | 'lua' | 'markdown' | 'marko' | 'md' | 'mdc' | 'mdx' | 'php' | 'postcss' | 'pug' | 'py' | 'python' | 'r' | 'rb' | 'ruby' | 'sass' | 'scss' | 'sh' | 'shell' | 'shellscript' | 'sql' | 'styl' | 'stylus' | 'svelte' | 'toml' | 'ts' | 'tsx' | 'typescript' | 'vue' | 'vue-html' | 'wasm' | 'wgsl' | 'xml' | 'yaml' | 'yml' | 'zsh';
|
|
17
18
|
declare const bundledLanguages: Record<BundledLanguage, DynamicImportLanguageRegistration>;
|
|
18
19
|
|
|
19
20
|
type Highlighter = HighlighterGeneric<BundledLanguage, BundledTheme>;
|
package/dist/bundle-web.mjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { default as getWasmInlined } from 'shiki/wasm';
|
|
1
|
+
import { g as getWasmInlined } from './chunks/wasm-dynamic.mjs';
|
|
3
2
|
import { createdBundledHighlighter, createSingletonShorthands } from '@shikijs/core';
|
|
4
3
|
export * from '@shikijs/core';
|
|
5
4
|
import { bundledThemes } from './themes.mjs';
|
|
@@ -149,6 +148,9 @@ const bundledLanguagesInfo = [
|
|
|
149
148
|
{
|
|
150
149
|
"id": "julia",
|
|
151
150
|
"name": "Julia",
|
|
151
|
+
"aliases": [
|
|
152
|
+
"jl"
|
|
153
|
+
],
|
|
152
154
|
"import": () => import('./langs/julia.mjs')
|
|
153
155
|
},
|
|
154
156
|
{
|
|
@@ -324,7 +326,7 @@ const bundledLanguages = {
|
|
|
324
326
|
const getHighlighter = /* @__PURE__ */ createdBundledHighlighter(
|
|
325
327
|
bundledLanguages,
|
|
326
328
|
bundledThemes,
|
|
327
|
-
|
|
329
|
+
getWasmInlined
|
|
328
330
|
);
|
|
329
331
|
const {
|
|
330
332
|
codeToHtml,
|
|
@@ -337,4 +339,4 @@ const {
|
|
|
337
339
|
getHighlighter
|
|
338
340
|
);
|
|
339
341
|
|
|
340
|
-
export { bundledLanguages, bundledLanguagesAlias, bundledLanguagesBase, bundledLanguagesInfo, bundledThemes, codeToHast, codeToHtml, codeToTokens, codeToTokensBase, codeToTokensWithThemes, getHighlighter, getSingletonHighlighter };
|
|
342
|
+
export { bundledLanguages, bundledLanguagesAlias, bundledLanguagesBase, bundledLanguagesInfo, bundledThemes, codeToHast, codeToHtml, codeToTokens, codeToTokensBase, codeToTokensWithThemes, getHighlighter, getSingletonHighlighter, getWasmInlined };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
export { Highlighter, codeToHast, codeToHtml, codeToTokens, codeToTokensBase, codeToTokensWithThemes, getHighlighter, getSingletonHighlighter } from './bundle-full.mjs';
|
|
2
2
|
export { BuiltinLanguage, BuiltinTheme } from './types.mjs';
|
|
3
3
|
export { CssVariablesThemeOptions, createCssVariablesTheme } from './theme-css-variables.mjs';
|
|
4
|
-
export { default as getWasmInlined } from 'shiki/wasm';
|
|
5
4
|
export * from '@shikijs/core';
|
|
6
5
|
export { BundledTheme, bundledThemes, bundledThemesInfo } from './themes.mjs';
|
|
7
6
|
export { BundledLanguage, bundledLanguages, bundledLanguagesAlias, bundledLanguagesBase, bundledLanguagesInfo } from './langs.mjs';
|
|
8
|
-
|
|
7
|
+
export { g as getWasmInlined } from './types/wasm-dynamic.mjs';
|
|
9
8
|
import '@shikijs/core/types';
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { codeToHast, codeToHtml, codeToTokens, codeToTokensBase, codeToTokensWithThemes, getHighlighter, getSingletonHighlighter } from './bundle-full.mjs';
|
|
2
2
|
export { createCssVariablesTheme } from './theme-css-variables.mjs';
|
|
3
|
-
export { default as getWasmInlined } from 'shiki/wasm';
|
|
4
3
|
export * from '@shikijs/core';
|
|
5
4
|
export { bundledThemes, bundledThemesInfo } from './themes.mjs';
|
|
6
5
|
export { bundledLanguages, bundledLanguagesAlias, bundledLanguagesBase, bundledLanguagesInfo } from './langs.mjs';
|
|
6
|
+
export { g as getWasmInlined } from './chunks/wasm-dynamic.mjs';
|
package/dist/langs/astro.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import less from './less.mjs';
|
|
|
9
9
|
import postcss from './postcss.mjs';
|
|
10
10
|
import tsx from './tsx.mjs';
|
|
11
11
|
|
|
12
|
-
const lang = Object.freeze({ "displayName": "Astro", "fileTypes": ["astro"], "injections": { "L:(meta.script.astro) (meta.lang.js | meta.lang.javascript | meta.lang.partytown | meta.lang.node) - (meta source)": { "patterns": [{ "begin": "(?<=>)(?!</)", "contentName": "source.js", "end": "(?=</)", "name": "meta.embedded.block.astro", "patterns": [{ "include": "source.js" }] }] }, "L:(meta.script.astro) (meta.lang.json) - (meta source)": { "patterns": [{ "begin": "(?<=>)(?!</)", "contentName": "source.json", "end": "(?=</)", "name": "meta.embedded.block.astro", "patterns": [{ "include": "source.json" }] }] }, "L:(meta.script.astro) (meta.lang.ts | meta.lang.typescript) - (meta source)": { "patterns": [{ "begin": "(?<=>)(?!</)", "contentName": "source.ts", "end": "(?=</)", "name": "meta.embedded.block.astro", "patterns": [{ "include": "source.ts" }] }] }, "L:meta.script.astro - meta.lang - (meta source)": { "patterns": [{ "begin": "(?<=>)(?!</)", "contentName": "source.js", "end": "(?=</)", "name": "meta.embedded.block.astro", "patterns": [{ "include": "source.js" }] }] }, "L:meta.style.astro - meta.lang - (meta source)": { "patterns": [{ "begin": "(?<=>)(?!</)", "contentName": "source.css", "end": "(?=</)", "name": "meta.embedded.block.astro", "patterns": [{ "include": "source.css" }] }] }, "L:meta.style.astro meta.lang.css - (meta source)": { "patterns": [{ "begin": "(?<=>)(?!</)", "contentName": "source.css", "end": "(?=</)", "name": "meta.embedded.block.astro", "patterns": [{ "include": "source.css" }] }] }, "L:meta.style.astro meta.lang.less - (meta source)": { "patterns": [{ "begin": "(?<=>)(?!</)", "contentName": "source.css.less", "end": "(?=</)", "name": "meta.embedded.block.astro", "patterns": [{ "include": "source.css.less" }] }] }, "L:meta.style.astro meta.lang.postcss - (meta source)": { "patterns": [{ "begin": "(?<=>)(?!</)", "contentName": "source.css.postcss", "end": "(?=</)", "name": "meta.embedded.block.astro", "patterns": [{ "include": "source.css.postcss" }] }] }, "L:meta.style.astro meta.lang.sass - (meta source)": { "patterns": [{ "begin": "(?<=>)(?!</)", "contentName": "source.sass", "end": "(?=</)", "name": "meta.embedded.block.astro", "patterns": [{ "include": "source.sass" }] }] }, "L:meta.style.astro meta.lang.scss - (meta source)": { "patterns": [{ "begin": "(?<=>)(?!</)", "contentName": "source.css.scss", "end": "(?=</)", "name": "meta.embedded.block.astro", "patterns": [{ "include": "source.css.scss" }] }] }, "L:meta.style.astro meta.lang.stylus - (meta source)": { "patterns": [{ "begin": "(?<=>)(?!</)", "contentName": "source.stylus", "end": "(?=</)", "name": "meta.embedded.block.astro", "patterns": [{ "include": "source.stylus" }] }] } }, "name": "astro", "patterns": [{ "include": "#scope" }, { "include": "#frontmatter" }], "repository": { "attributes": { "patterns": [{ "include": "#attributes-events" }, { "include": "#attributes-keyvalue" }, { "include": "#attributes-interpolated" }] }, "attributes-events": { "begin": "(on(s(croll|t(orage|alled)|u(spend|bmit)|e(curitypolicyviolation|ek(ing|ed)|lect))|hashchange|c(hange|o(ntextmenu|py)|u(t|echange)|l(ick|ose)|an(cel|play(through)?))|t(imeupdate|oggle)|in(put|valid)|o(nline|ffline)|d(urationchange|r(op|ag(start|over|e(n(ter|d)|xit)|leave)?)|blclick)|un(handledrejection|load)|p(opstate|lay(ing)?|a(ste|use|ge(show|hide))|rogress)|e(nded|rror|mptied)|volumechange|key(down|up|press)|focus|w(heel|aiting)|l(oad(start|e(nd|d(data|metadata)))?|anguagechange)|a(uxclick|fterprint|bort)|r(e(s(ize|et)|jectionhandled)|atechange)|m(ouse(o(ut|ver)|down|up|enter|leave|move)|essage(error)?)|b(efore(unload|print)|lur)))(?![\\\\w:-])", "beginCaptures": { "0": { "patterns": [{ "match": ".*", "name": "entity.other.attribute-name.astro" }] } }, "end": "(?=\\s*+[^=\\s])", "name": "meta.attribute.$1.astro", "patterns": [{ "begin": "=", "beginCaptures": { "0": { "name": "punctuation.separator.key-value.astro" } }, "end": "(?<=[^\\s=])(?!\\s*=)|(?=/?>)", "patterns": [{ "begin": "(?=[^\\s=<>`/]|/(?!>))", "end": "(?!\\G)", "name": "meta.embedded.line.js", "patterns": [{ "captures": { "0": { "name": "source.js" }, "1": { "patterns": [{ "include": "source.js" }] } }, "match": "(([^\\s\\\"'=<>`/]|/(?!>))+)", "name": "string.unquoted.astro" }, { "begin": '(["])', "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.astro" } }, "end": "\\1", "endCaptures": { "0": { "name": "punctuation.definition.string.end.astro" } }, "name": "string.quoted.astro", "patterns": [{ "captures": { "0": { "patterns": [{ "include": "source.js" }] } }, "match": '([^\\n\\"/]|/(?![/*]))+' }, { "begin": "//", "beginCaptures": { "0": { "name": "punctuation.definition.comment.js" } }, "end": '(?=\\")|\\n', "name": "comment.line.double-slash.js" }, { "begin": "/\\*", "beginCaptures": { "0": { "name": "punctuation.definition.comment.begin.js" } }, "end": '(?=\\")|\\*/', "endCaptures": { "0": { "name": "punctuation.definition.comment.end.js" } }, "name": "comment.block.js" }] }, { "begin": "(['])", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.astro" } }, "end": "\\1", "endCaptures": { "0": { "name": "punctuation.definition.string.end.astro" } }, "name": "string.quoted.astro", "patterns": [{ "captures": { "0": { "patterns": [{ "include": "source.js" }] } }, "match": "([^\\n\\'/]|/(?![/*]))+" }, { "begin": "//", "beginCaptures": { "0": { "name": "punctuation.definition.comment.js" } }, "end": "(?=\\')|\\n", "name": "comment.line.double-slash.js" }, { "begin": "/\\*", "beginCaptures": { "0": { "name": "punctuation.definition.comment.begin.js" } }, "end": "(?=\\')|\\*/", "endCaptures": { "0": { "name": "punctuation.definition.comment.end.js" } }, "name": "comment.block.js" }] }] }] }] }, "attributes-interpolated": { "begin": "(?<!:|=)\\s*({)", "contentName": "meta.embedded.expression.astro source.tsx", "end": "(\\})", "patterns": [{ "include": "source.tsx" }] }, "attributes-keyvalue": { "begin": "([_@$[:alpha:]][:._\\-$[:alnum:]]*)", "beginCaptures": { "0": { "patterns": [{ "match": ".*", "name": "entity.other.attribute-name.astro" }] } }, "end": "(?=\\s*+[^=\\s])", "name": "meta.attribute.$1.astro", "patterns": [{ "begin": "=", "beginCaptures": { "0": { "name": "punctuation.separator.key-value.astro" } }, "end": "(?<=[^\\s=])(?!\\s*=)|(?=/?>)", "patterns": [{ "include": "#attributes-value" }] }] }, "attributes-value": { "patterns": [{ "include": "#interpolation" }, { "match": "([^\\s\"'=<>`/]|/(?!>))+", "name": "string.unquoted.astro" }, { "begin": `(['"])`, "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.astro" } }, "end": "\\1", "endCaptures": { "0": { "name": "punctuation.definition.string.end.astro" } }, "name": "string.quoted.astro" }, { "begin": "(`)", "end": "\\1", "name": "string.template.astro", "patterns": [{ "include": "source.tsx#template-substitution-element" }, { "include": "source.tsx#string-character-escape" }] }] }, "comments": { "begin": "<!--", "captures": { "0": { "name": "punctuation.definition.comment.astro" } }, "end": "-->", "name": "comment.block.astro", "patterns": [{ "match": "\\G-?>|<!--(?!>)|<!-(?=-->)|--!>", "name": "invalid.illegal.characters-not-allowed-here.astro" }] }, "frontmatter": { "begin": "\\A(-{3})\\s*$", "beginCaptures": { "1": { "name": "comment" } }, "contentName": "source.ts", "end": "(^|\\G)(-{3})|\\.{3}\\s*$", "endCaptures": { "2": { "name": "comment" } }, "patterns": [{ "include": "source.ts" }] }, "interpolation": { "patterns": [{ "begin": "\\{", "beginCaptures": { "0": { "name": "punctuation.section.embedded.begin.astro" } }, "contentName": "meta.embedded.expression.astro source.tsx", "end": "\\}", "endCaptures": { "0": { "name": "punctuation.section.embedded.end.astro" } }, "patterns": [{ "begin": "\\G\\s*(?={)", "end": "(?<=})", "patterns": [{ "include": "source.tsx#object-literal" }] }, { "include": "source.tsx" }] }] }, "scope": { "patterns": [{ "include": "#comments" }, { "include": "#tags" }, { "include": "#interpolation" }, { "begin": "(?<=>|})", "end": "(?=<|{)", "name": "text.astro" }] }, "tags": { "patterns": [{ "include": "#tags-raw" }, { "include": "#tags-lang" }, { "include": "#tags-void" }, { "include": "#tags-general-end" }, { "include": "#tags-general-start" }] }, "tags-end-node": { "captures": { "1": { "name": "meta.tag.end.astro punctuation.definition.tag.begin.astro" }, "2": { "name": "meta.tag.end.astro", "patterns": [{ "include": "#tags-name" }] }, "3": { "name": "meta.tag.end.astro punctuation.definition.tag.end.astro" }, "4": { "name": "meta.tag.start.astro punctuation.definition.tag.end.astro" } }, "match": "(</)(.*?)\\s*(>)|(/>)" }, "tags-general-end": { "begin": "(</)([^/\\s>]*)", "beginCaptures": { "1": { "name": "meta.tag.end.astro punctuation.definition.tag.begin.astro" }, "2": { "name": "meta.tag.end.astro", "patterns": [{ "include": "#tags-name" }] } }, "end": "(>)", "endCaptures": { "1": { "name": "meta.tag.end.astro punctuation.definition.tag.end.astro" } }, "name": "meta.scope.tag.$2.astro" }, "tags-general-start": { "begin": "(<)([^/\\s>/]*)", "beginCaptures": { "0": { "patterns": [{ "include": "#tags-start-node" }] } }, "end": "(/?>)", "endCaptures": { "1": { "name": "meta.tag.start.astro punctuation.definition.tag.end.astro" } }, "name": "meta.scope.tag.$2.astro", "patterns": [{ "include": "#tags-start-attributes" }] }, "tags-lang": { "begin": "<(script|style)", "beginCaptures": { "0": { "patterns": [{ "include": "#tags-start-node" }] } }, "end": "</\\1\\s*>|/>", "endCaptures": { "0": { "patterns": [{ "include": "#tags-end-node" }] } }, "name": "meta.scope.tag.$1.astro meta.$1.astro", "patterns": [{ "begin": `\\G(?=\\s*[^>]*?(type|lang)\\s*=\\s*(['"]|)(?:text\\/)?(application\\/ld\\+json)\\2)`, "end": "(?=</|/>)", "name": "meta.lang.json.astro", "patterns": [{ "include": "#tags-lang-start-attributes" }] }, { "begin": `\\G(?=\\s*[^>]*?(type|lang)\\s*=\\s*(['"]|)(module)\\2)`, "end": "(?=</|/>)", "name": "meta.lang.javascript.astro", "patterns": [{ "include": "#tags-lang-start-attributes" }] }, { "begin": `\\G(?=\\s*[^>]*?(type|lang)\\s*=\\s*(['"]|)(?:text/|application/)?([\\w\\/+]+)\\2)`, "end": "(?=</|/>)", "name": "meta.lang.$3.astro", "patterns": [{ "include": "#tags-lang-start-attributes" }] }, { "include": "#tags-lang-start-attributes" }] }, "tags-lang-start-attributes": { "begin": "\\G", "end": "(?=/>)|>", "endCaptures": { "0": { "name": "punctuation.definition.tag.end.astro" } }, "name": "meta.tag.start.astro", "patterns": [{ "include": "#attributes" }] }, "tags-name": { "patterns": [{ "match": "[A-Z][a-zA-Z0-9_]*", "name": "support.class.component.astro" }, { "match": "[a-z][\\w0-9:]*-[\\w0-9:-]*", "name": "meta.tag.custom.astro entity.name.tag.astro" }, { "match": "[a-z][\\w0-9:-]*", "name": "entity.name.tag.astro" }] }, "tags-raw": { "begin": "<([^/?!\\s<>]+)(?=[^>]+is:raw).*?", "beginCaptures": { "0": { "patterns": [{ "include": "#tags-start-node" }] } }, "contentName": "source.unknown", "end": "</\\1\\s*>|/>", "endCaptures": { "0": { "patterns": [{ "include": "#tags-end-node" }] } }, "name": "meta.scope.tag.$1.astro meta.raw.astro", "patterns": [{ "include": "#tags-lang-start-attributes" }] }, "tags-start-attributes": { "begin": "\\G", "end": "(?=/?>)", "name": "meta.tag.start.astro", "patterns": [{ "include": "#attributes" }] }, "tags-start-node": { "captures": { "1": { "name": "punctuation.definition.tag.begin.astro" }, "2": { "patterns": [{ "include": "#tags-name" }] } }, "match": "(<)([^/\\s>/]*)", "name": "meta.tag.start.astro" }, "tags-void": { "begin": "(<)(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)(?=\\s|/?>)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.astro" }, "2": { "name": "entity.name.tag.astro" } }, "end": "/?>", "endCaptures": { "0": { "name": "punctuation.definition.tag.begin.astro" } }, "name": "meta.tag.void.astro", "patterns": [{ "include": "#attributes" }] } }, "scopeName": "source.astro", "embeddedLangs": ["json", "javascript", "typescript", "stylus", "sass", "css", "scss", "less", "postcss", "tsx"] });
|
|
12
|
+
const lang = Object.freeze({ "displayName": "Astro", "fileTypes": ["astro"], "injections": { "L:(meta.script.astro) (meta.lang.js | meta.lang.javascript | meta.lang.partytown | meta.lang.node) - (meta source)": { "patterns": [{ "begin": "(?<=>)(?!</)", "contentName": "source.js", "end": "(?=</)", "name": "meta.embedded.block.astro", "patterns": [{ "include": "source.js" }] }] }, "L:(meta.script.astro) (meta.lang.json) - (meta source)": { "patterns": [{ "begin": "(?<=>)(?!</)", "contentName": "source.json", "end": "(?=</)", "name": "meta.embedded.block.astro", "patterns": [{ "include": "source.json" }] }] }, "L:(meta.script.astro) (meta.lang.ts | meta.lang.typescript) - (meta source)": { "patterns": [{ "begin": "(?<=>)(?!</)", "contentName": "source.ts", "end": "(?=</)", "name": "meta.embedded.block.astro", "patterns": [{ "include": "source.ts" }] }] }, "L:meta.script.astro - meta.lang - (meta source)": { "patterns": [{ "begin": "(?<=>)(?!</)", "contentName": "source.js", "end": "(?=</)", "name": "meta.embedded.block.astro", "patterns": [{ "include": "source.js" }] }] }, "L:meta.style.astro - meta.lang - (meta source)": { "patterns": [{ "begin": "(?<=>)(?!</)", "contentName": "source.css", "end": "(?=</)", "name": "meta.embedded.block.astro", "patterns": [{ "include": "source.css" }] }] }, "L:meta.style.astro meta.lang.css - (meta source)": { "patterns": [{ "begin": "(?<=>)(?!</)", "contentName": "source.css", "end": "(?=</)", "name": "meta.embedded.block.astro", "patterns": [{ "include": "source.css" }] }] }, "L:meta.style.astro meta.lang.less - (meta source)": { "patterns": [{ "begin": "(?<=>)(?!</)", "contentName": "source.css.less", "end": "(?=</)", "name": "meta.embedded.block.astro", "patterns": [{ "include": "source.css.less" }] }] }, "L:meta.style.astro meta.lang.postcss - (meta source)": { "patterns": [{ "begin": "(?<=>)(?!</)", "contentName": "source.css.postcss", "end": "(?=</)", "name": "meta.embedded.block.astro", "patterns": [{ "include": "source.css.postcss" }] }] }, "L:meta.style.astro meta.lang.sass - (meta source)": { "patterns": [{ "begin": "(?<=>)(?!</)", "contentName": "source.sass", "end": "(?=</)", "name": "meta.embedded.block.astro", "patterns": [{ "include": "source.sass" }] }] }, "L:meta.style.astro meta.lang.scss - (meta source)": { "patterns": [{ "begin": "(?<=>)(?!</)", "contentName": "source.css.scss", "end": "(?=</)", "name": "meta.embedded.block.astro", "patterns": [{ "include": "source.css.scss" }] }] }, "L:meta.style.astro meta.lang.stylus - (meta source)": { "patterns": [{ "begin": "(?<=>)(?!</)", "contentName": "source.stylus", "end": "(?=</)", "name": "meta.embedded.block.astro", "patterns": [{ "include": "source.stylus" }] }] } }, "name": "astro", "patterns": [{ "include": "#scope" }, { "include": "#frontmatter" }, { "include": "#text" }], "repository": { "attribute-literal": { "begin": "(`)", "end": "\\1", "name": "string.template.astro", "patterns": [{ "include": "source.tsx#template-substitution-element" }, { "include": "source.tsx#string-character-escape" }] }, "attributes": { "patterns": [{ "include": "#attributes-events" }, { "include": "#attributes-keyvalue" }, { "include": "#attributes-interpolated" }] }, "attributes-events": { "begin": "(on(s(croll|t(orage|alled)|u(spend|bmit)|e(curitypolicyviolation|ek(ing|ed)|lect))|hashchange|c(hange|o(ntextmenu|py)|u(t|echange)|l(ick|ose)|an(cel|play(through)?))|t(imeupdate|oggle)|in(put|valid)|o(nline|ffline)|d(urationchange|r(op|ag(start|over|e(n(ter|d)|xit)|leave)?)|blclick)|un(handledrejection|load)|p(opstate|lay(ing)?|a(ste|use|ge(show|hide))|rogress)|e(nded|rror|mptied)|volumechange|key(down|up|press)|focus|w(heel|aiting)|l(oad(start|e(nd|d(data|metadata)))?|anguagechange)|a(uxclick|fterprint|bort)|r(e(s(ize|et)|jectionhandled)|atechange)|m(ouse(o(ut|ver)|down|up|enter|leave|move)|essage(error)?)|b(efore(unload|print)|lur)))(?![\\\\w:-])", "beginCaptures": { "0": { "patterns": [{ "match": ".*", "name": "entity.other.attribute-name.astro" }] } }, "end": "(?=\\s*+[^=\\s])", "name": "meta.attribute.$1.astro", "patterns": [{ "begin": "=", "beginCaptures": { "0": { "name": "punctuation.separator.key-value.astro" } }, "end": "(?<=[^\\s=])(?!\\s*=)|(?=/?>)", "patterns": [{ "include": "#interpolation" }, { "include": "#attribute-literal" }, { "begin": "(?=[^\\s=<>`/]|/(?!>))", "end": "(?!\\G)", "name": "meta.embedded.line.js", "patterns": [{ "captures": { "0": { "name": "source.js" }, "1": { "patterns": [{ "include": "source.js" }] } }, "match": "(([^\\s\\\"'=<>`/]|/(?!>))+)", "name": "string.unquoted.astro" }, { "begin": '(["])', "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.astro" } }, "end": "\\1", "endCaptures": { "0": { "name": "punctuation.definition.string.end.astro" } }, "name": "string.quoted.astro", "patterns": [{ "captures": { "0": { "patterns": [{ "include": "source.js" }] } }, "match": '([^\\n\\"/]|/(?![/*]))+' }, { "begin": "//", "beginCaptures": { "0": { "name": "punctuation.definition.comment.js" } }, "end": '(?=\\")|\\n', "name": "comment.line.double-slash.js" }, { "begin": "/\\*", "beginCaptures": { "0": { "name": "punctuation.definition.comment.begin.js" } }, "end": '(?=\\")|\\*/', "endCaptures": { "0": { "name": "punctuation.definition.comment.end.js" } }, "name": "comment.block.js" }] }, { "begin": "(['])", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.astro" } }, "end": "\\1", "endCaptures": { "0": { "name": "punctuation.definition.string.end.astro" } }, "name": "string.quoted.astro", "patterns": [{ "captures": { "0": { "patterns": [{ "include": "source.js" }] } }, "match": "([^\\n\\'/]|/(?![/*]))+" }, { "begin": "//", "beginCaptures": { "0": { "name": "punctuation.definition.comment.js" } }, "end": "(?=\\')|\\n", "name": "comment.line.double-slash.js" }, { "begin": "/\\*", "beginCaptures": { "0": { "name": "punctuation.definition.comment.begin.js" } }, "end": "(?=\\')|\\*/", "endCaptures": { "0": { "name": "punctuation.definition.comment.end.js" } }, "name": "comment.block.js" }] }] }] }] }, "attributes-interpolated": { "begin": "(?<!:|=)\\s*({)", "contentName": "meta.embedded.expression.astro source.tsx", "end": "(\\})", "patterns": [{ "include": "source.tsx" }] }, "attributes-keyvalue": { "begin": "([_@$[:alpha:]][:._\\-$[:alnum:]]*)", "beginCaptures": { "0": { "patterns": [{ "match": ".*", "name": "entity.other.attribute-name.astro" }] } }, "end": "(?=\\s*+[^=\\s])", "name": "meta.attribute.$1.astro", "patterns": [{ "begin": "=", "beginCaptures": { "0": { "name": "punctuation.separator.key-value.astro" } }, "end": "(?<=[^\\s=])(?!\\s*=)|(?=/?>)", "patterns": [{ "include": "#attributes-value" }] }] }, "attributes-value": { "patterns": [{ "include": "#interpolation" }, { "match": "([^\\s\"'=<>`/]|/(?!>))+", "name": "string.unquoted.astro" }, { "begin": `(['"])`, "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.astro" } }, "end": "\\1", "endCaptures": { "0": { "name": "punctuation.definition.string.end.astro" } }, "name": "string.quoted.astro" }, { "include": "#attribute-literal" }] }, "comments": { "begin": "<!--", "captures": { "0": { "name": "punctuation.definition.comment.astro" } }, "end": "-->", "name": "comment.block.astro", "patterns": [{ "match": "\\G-?>|<!--(?!>)|<!-(?=-->)|--!>", "name": "invalid.illegal.characters-not-allowed-here.astro" }] }, "entities": { "patterns": [{ "captures": { "1": { "name": "punctuation.definition.entity.astro" }, "912": { "name": "punctuation.definition.entity.astro" } }, "match": "(?x)\n(&) (?=[a-zA-Z])\n(\n(a(s(ymp(eq)?|cr|t)|n(d(slope|d|v|and)?|g(s(t|ph)|zarr|e|le|rt(vb(d)?)?|msd(a(h|c|d|e|f|a|g|b))?)?)|c(y|irc|d|ute|E)?|tilde|o(pf|gon)|uml|p(id|os|prox(eq)?|e|E|acir)?|elig|f(r)?|w(conint|int)|l(pha|e(ph|fsym))|acute|ring|grave|m(p|a(cr|lg))|breve)|A(s(sign|cr)|nd|MP|c(y|irc)|tilde|o(pf|gon)|uml|pplyFunction|fr|Elig|lpha|acute|ring|grave|macr|breve))\n| (B(scr|cy|opf|umpeq|e(cause|ta|rnoullis)|fr|a(ckslash|r(v|wed))|reve)|b(s(cr|im(e)?|ol(hsub|b)?|emi)|n(ot|e(quiv)?)|c(y|ong)|ig(s(tar|qcup)|c(irc|up|ap)|triangle(down|up)|o(times|dot|plus)|uplus|vee|wedge)|o(t(tom)?|pf|wtie|x(h(d|u|D|U)?|times|H(d|u|D|U)?|d(R|l|r|L)|u(R|l|r|L)|plus|D(R|l|r|L)|v(R|h|H|l|r|L)?|U(R|l|r|L)|V(R|h|H|l|r|L)?|minus|box))|Not|dquo|u(ll(et)?|mp(e(q)?|E)?)|prime|e(caus(e)?|t(h|ween|a)|psi|rnou|mptyv)|karow|fr|l(ock|k(1(2|4)|34)|a(nk|ck(square|triangle(down|left|right)?|lozenge)))|a(ck(sim(eq)?|cong|prime|epsilon)|r(vee|wed(ge)?))|r(eve|vbar)|brk(tbrk)?))\n| (c(s(cr|u(p(e)?|b(e)?))|h(cy|i|eck(mark)?)|ylcty|c(irc|ups(sm)?|edil|a(ps|ron))|tdot|ir(scir|c(eq|le(d(R|circ|S|dash|ast)|arrow(left|right)))?|e|fnint|E|mid)?|o(n(int|g(dot)?)|p(y(sr)?|f|rod)|lon(e(q)?)?|m(p(fn|le(xes|ment))?|ma(t)?))|dot|u(darr(l|r)|p(s|c(up|ap)|or|dot|brcap)?|e(sc|pr)|vee|wed|larr(p)?|r(vearrow(left|right)|ly(eq(succ|prec)|vee|wedge)|arr(m)?|ren))|e(nt(erdot)?|dil|mptyv)|fr|w(conint|int)|lubs(uit)?|a(cute|p(s|c(up|ap)|dot|and|brcup)?|r(on|et))|r(oss|arr))|C(scr|hi|c(irc|onint|edil|aron)|ircle(Minus|Times|Dot|Plus)|Hcy|o(n(tourIntegral|int|gruent)|unterClockwiseContourIntegral|p(f|roduct)|lon(e)?)|dot|up(Cap)?|OPY|e(nterDot|dilla)|fr|lo(seCurly(DoubleQuote|Quote)|ckwiseContourIntegral)|a(yleys|cute|p(italDifferentialD)?)|ross))\n| (d(s(c(y|r)|trok|ol)|har(l|r)|c(y|aron)|t(dot|ri(f)?)|i(sin|e|v(ide(ontimes)?|onx)?|am(s|ond(suit)?)?|gamma)|Har|z(cy|igrarr)|o(t(square|plus|eq(dot)?|minus)?|ublebarwedge|pf|wn(harpoon(left|right)|downarrows|arrow)|llar)|d(otseq|a(rr|gger))?|u(har|arr)|jcy|e(lta|g|mptyv)|f(isht|r)|wangle|lc(orn|rop)|a(sh(v)?|leth|rr|gger)|r(c(orn|rop)|bkarow)|b(karow|lac)|Arr)|D(s(cr|trok)|c(y|aron)|Scy|i(fferentialD|a(critical(Grave|Tilde|Do(t|ubleAcute)|Acute)|mond))|o(t(Dot|Equal)?|uble(Right(Tee|Arrow)|ContourIntegral|Do(t|wnArrow)|Up(DownArrow|Arrow)|VerticalBar|L(ong(RightArrow|Left(RightArrow|Arrow))|eft(RightArrow|Tee|Arrow)))|pf|wn(Right(TeeVector|Vector(Bar)?)|Breve|Tee(Arrow)?|arrow|Left(RightVector|TeeVector|Vector(Bar)?)|Arrow(Bar|UpArrow)?))|Zcy|el(ta)?|D(otrahd)?|Jcy|fr|a(shv|rr|gger)))\n| (e(s(cr|im|dot)|n(sp|g)|c(y|ir(c)?|olon|aron)|t(h|a)|o(pf|gon)|dot|u(ro|ml)|p(si(v|lon)?|lus|ar(sl)?)|e|D(ot|Dot)|q(s(im|lant(less|gtr))|c(irc|olon)|u(iv(DD)?|est|als)|vparsl)|f(Dot|r)|l(s(dot)?|inters|l)?|a(ster|cute)|r(Dot|arr)|g(s(dot)?|rave)?|x(cl|ist|p(onentiale|ectation))|m(sp(1(3|4))?|pty(set|v)?|acr))|E(s(cr|im)|c(y|irc|aron)|ta|o(pf|gon)|NG|dot|uml|TH|psilon|qu(ilibrium|al(Tilde)?)|fr|lement|acute|grave|x(ists|ponentialE)|m(pty(SmallSquare|VerySmallSquare)|acr)))\n| (f(scr|nof|cy|ilig|o(pf|r(k(v)?|all))|jlig|partint|emale|f(ilig|l(ig|lig)|r)|l(tns|lig|at)|allingdotseq|r(own|a(sl|c(1(2|8|3|4|5|6)|78|2(3|5)|3(8|4|5)|45|5(8|6)))))|F(scr|cy|illed(SmallSquare|VerySmallSquare)|o(uriertrf|pf|rAll)|fr))\n| (G(scr|c(y|irc|edil)|t|opf|dot|T|Jcy|fr|amma(d)?|reater(Greater|SlantEqual|Tilde|Equal(Less)?|FullEqual|Less)|g|breve)|g(s(cr|im(e|l)?)|n(sim|e(q(q)?)?|E|ap(prox)?)|c(y|irc)|t(c(c|ir)|dot|quest|lPar|r(sim|dot|eq(qless|less)|less|a(pprox|rr)))?|imel|opf|dot|jcy|e(s(cc|dot(o(l)?)?|l(es)?)?|q(slant|q)?|l)?|v(nE|ertneqq)|fr|E(l)?|l(j|E|a)?|a(cute|p|mma(d)?)|rave|g(g)?|breve))\n| (h(s(cr|trok|lash)|y(phen|bull)|circ|o(ok(leftarrow|rightarrow)|pf|arr|rbar|mtht)|e(llip|arts(uit)?|rcon)|ks(earow|warow)|fr|a(irsp|lf|r(dcy|r(cir|w)?)|milt)|bar|Arr)|H(s(cr|trok)|circ|ilbertSpace|o(pf|rizontalLine)|ump(DownHump|Equal)|fr|a(cek|t)|ARDcy))\n| (i(s(cr|in(s(v)?|dot|v|E)?)|n(care|t(cal|prod|e(rcal|gers)|larhk)?|odot|fin(tie)?)?|c(y|irc)?|t(ilde)?|i(nfin|i(nt|int)|ota)?|o(cy|ta|pf|gon)|u(kcy|ml)|jlig|prod|e(cy|xcl)|quest|f(f|r)|acute|grave|m(of|ped|a(cr|th|g(part|e|line))))|I(scr|n(t(e(rsection|gral))?|visible(Comma|Times))|c(y|irc)|tilde|o(ta|pf|gon)|dot|u(kcy|ml)|Ocy|Jlig|fr|Ecy|acute|grave|m(plies|a(cr|ginaryI))?))\n| (j(s(cr|ercy)|c(y|irc)|opf|ukcy|fr|math)|J(s(cr|ercy)|c(y|irc)|opf|ukcy|fr))\n| (k(scr|hcy|c(y|edil)|opf|jcy|fr|appa(v)?|green)|K(scr|c(y|edil)|Hcy|opf|Jcy|fr|appa))\n| (l(s(h|cr|trok|im(e|g)?|q(uo(r)?|b)|aquo)|h(ar(d|u(l)?)|blk)|n(sim|e(q(q)?)?|E|ap(prox)?)|c(y|ub|e(il|dil)|aron)|Barr|t(hree|c(c|ir)|imes|dot|quest|larr|r(i(e|f)?|Par))?|Har|o(ng(left(arrow|rightarrow)|rightarrow|mapsto)|times|z(enge|f)?|oparrow(left|right)|p(f|lus|ar)|w(ast|bar)|a(ng|rr)|brk)|d(sh|ca|quo(r)?|r(dhar|ushar))|ur(dshar|uhar)|jcy|par(lt)?|e(s(s(sim|dot|eq(qgtr|gtr)|approx|gtr)|cc|dot(o(r)?)?|g(es)?)?|q(slant|q)?|ft(harpoon(down|up)|threetimes|leftarrows|arrow(tail)?|right(squigarrow|harpoons|arrow(s)?))|g)?|v(nE|ertneqq)|f(isht|loor|r)|E(g)?|l(hard|corner|tri|arr)?|a(ng(d|le)?|cute|t(e(s)?|ail)?|p|emptyv|quo|rr(sim|hk|tl|pl|fs|lp|b(fs)?)?|gran|mbda)|r(har(d)?|corner|tri|arr|m)|g(E)?|m(idot|oust(ache)?)|b(arr|r(k(sl(d|u)|e)|ac(e|k))|brk)|A(tail|arr|rr))|L(s(h|cr|trok)|c(y|edil|aron)|t|o(ng(RightArrow|left(arrow|rightarrow)|rightarrow|Left(RightArrow|Arrow))|pf|wer(RightArrow|LeftArrow))|T|e(ss(Greater|SlantEqual|Tilde|EqualGreater|FullEqual|Less)|ft(Right(Vector|Arrow)|Ceiling|T(ee(Vector|Arrow)?|riangle(Bar|Equal)?)|Do(ubleBracket|wn(TeeVector|Vector(Bar)?))|Up(TeeVector|DownVector|Vector(Bar)?)|Vector(Bar)?|arrow|rightarrow|Floor|A(ngleBracket|rrow(RightArrow|Bar)?)))|Jcy|fr|l(eftarrow)?|a(ng|cute|placetrf|rr|mbda)|midot))\n| (M(scr|cy|inusPlus|opf|u|e(diumSpace|llintrf)|fr|ap)|m(s(cr|tpos)|ho|nplus|c(y|omma)|i(nus(d(u)?|b)?|cro|d(cir|dot|ast)?)|o(dels|pf)|dash|u(ltimap|map)?|p|easuredangle|DDot|fr|l(cp|dr)|a(cr|p(sto(down|up|left)?)?|l(t(ese)?|e)|rker)))\n| (n(s(hort(parallel|mid)|c(cue|e|r)?|im(e(q)?)?|u(cc(eq)?|p(set(eq(q)?)?|e|E)?|b(set(eq(q)?)?|e|E)?)|par|qsu(pe|be)|mid)|Rightarrow|h(par|arr|Arr)|G(t(v)?|g)|c(y|ong(dot)?|up|edil|a(p|ron))|t(ilde|lg|riangle(left(eq)?|right(eq)?)|gl)|i(s(d)?|v)?|o(t(ni(v(c|a|b))?|in(dot|v(c|a|b)|E)?)?|pf)|dash|u(m(sp|ero)?)?|jcy|p(olint|ar(sl|t|allel)?|r(cue|e(c(eq)?)?)?)|e(s(im|ear)|dot|quiv|ar(hk|r(ow)?)|xist(s)?|Arr)?|v(sim|infin|Harr|dash|Dash|l(t(rie)?|e|Arr)|ap|r(trie|Arr)|g(t|e))|fr|w(near|ar(hk|r(ow)?)|Arr)|V(dash|Dash)|l(sim|t(ri(e)?)?|dr|e(s(s)?|q(slant|q)?|ft(arrow|rightarrow))?|E|arr|Arr)|a(ng|cute|tur(al(s)?)?|p(id|os|prox|E)?|bla)|r(tri(e)?|ightarrow|arr(c|w)?|Arr)|g(sim|t(r)?|e(s|q(slant|q)?)?|E)|mid|L(t(v)?|eft(arrow|rightarrow)|l)|b(sp|ump(e)?))|N(scr|c(y|edil|aron)|tilde|o(nBreakingSpace|Break|t(R(ightTriangle(Bar|Equal)?|everseElement)|Greater(Greater|SlantEqual|Tilde|Equal|FullEqual|Less)?|S(u(cceeds(SlantEqual|Tilde|Equal)?|perset(Equal)?|bset(Equal)?)|quareSu(perset(Equal)?|bset(Equal)?))|Hump(DownHump|Equal)|Nested(GreaterGreater|LessLess)|C(ongruent|upCap)|Tilde(Tilde|Equal|FullEqual)?|DoubleVerticalBar|Precedes(SlantEqual|Equal)?|E(qual(Tilde)?|lement|xists)|VerticalBar|Le(ss(Greater|SlantEqual|Tilde|Equal|Less)?|ftTriangle(Bar|Equal)?))?|pf)|u|e(sted(GreaterGreater|LessLess)|wLine|gative(MediumSpace|Thi(nSpace|ckSpace)|VeryThinSpace))|Jcy|fr|acute))\n| (o(s(cr|ol|lash)|h(m|bar)|c(y|ir(c)?)|ti(lde|mes(as)?)|S|int|opf|d(sold|iv|ot|ash|blac)|uml|p(erp|lus|ar)|elig|vbar|f(cir|r)|l(c(ir|ross)|t|ine|arr)|a(st|cute)|r(slope|igof|or|d(er(of)?|f|m)?|v|arr)?|g(t|on|rave)|m(i(nus|cron|d)|ega|acr))|O(s(cr|lash)|c(y|irc)|ti(lde|mes)|opf|dblac|uml|penCurly(DoubleQuote|Quote)|ver(B(ar|rac(e|ket))|Parenthesis)|fr|Elig|acute|r|grave|m(icron|ega|acr)))\n| (p(s(cr|i)|h(i(v)?|one|mmat)|cy|i(tchfork|v)?|o(intint|und|pf)|uncsp|er(cnt|tenk|iod|p|mil)|fr|l(us(sim|cir|two|d(o|u)|e|acir|mn|b)?|an(ck(h)?|kv))|ar(s(im|l)|t|a(llel)?)?|r(sim|n(sim|E|ap)|cue|ime(s)?|o(d|p(to)?|f(surf|line|alar))|urel|e(c(sim|n(sim|eqq|approx)|curlyeq|eq|approx)?)?|E|ap)?|m)|P(s(cr|i)|hi|cy|i|o(incareplane|pf)|fr|lusMinus|artialD|r(ime|o(duct|portion(al)?)|ecedes(SlantEqual|Tilde|Equal)?)?))\n| (q(scr|int|opf|u(ot|est(eq)?|at(int|ernions))|prime|fr)|Q(scr|opf|UOT|fr))\n| (R(s(h|cr)|ho|c(y|edil|aron)|Barr|ight(Ceiling|T(ee(Vector|Arrow)?|riangle(Bar|Equal)?)|Do(ubleBracket|wn(TeeVector|Vector(Bar)?))|Up(TeeVector|DownVector|Vector(Bar)?)|Vector(Bar)?|arrow|Floor|A(ngleBracket|rrow(Bar|LeftArrow)?))|o(undImplies|pf)|uleDelayed|e(verse(UpEquilibrium|E(quilibrium|lement)))?|fr|EG|a(ng|cute|rr(tl)?)|rightarrow)|r(s(h|cr|q(uo(r)?|b)|aquo)|h(o(v)?|ar(d|u(l)?))|nmid|c(y|ub|e(il|dil)|aron)|Barr|t(hree|imes|ri(e|f|ltri)?)|i(singdotseq|ng|ght(squigarrow|harpoon(down|up)|threetimes|left(harpoons|arrows)|arrow(tail)?|rightarrows))|Har|o(times|p(f|lus|ar)|a(ng|rr)|brk)|d(sh|ca|quo(r)?|ldhar)|uluhar|p(polint|ar(gt)?)|e(ct|al(s|ine|part)?|g)|f(isht|loor|r)|l(har|arr|m)|a(ng(d|e|le)?|c(ute|e)|t(io(nals)?|ail)|dic|emptyv|quo|rr(sim|hk|c|tl|pl|fs|w|lp|ap|b(fs)?)?)|rarr|x|moust(ache)?|b(arr|r(k(sl(d|u)|e)|ac(e|k))|brk)|A(tail|arr|rr)))\n| (s(s(cr|tarf|etmn|mile)|h(y|c(hcy|y)|ort(parallel|mid)|arp)|c(sim|y|n(sim|E|ap)|cue|irc|polint|e(dil)?|E|a(p|ron))?|t(ar(f)?|r(ns|aight(phi|epsilon)))|i(gma(v|f)?|m(ne|dot|plus|e(q)?|l(E)?|rarr|g(E)?)?)|zlig|o(pf|ftcy|l(b(ar)?)?)|dot(e|b)?|u(ng|cc(sim|n(sim|eqq|approx)|curlyeq|eq|approx)?|p(s(im|u(p|b)|et(neq(q)?|eq(q)?)?)|hs(ol|ub)|1|n(e|E)|2|d(sub|ot)|3|plus|e(dot)?|E|larr|mult)?|m|b(s(im|u(p|b)|et(neq(q)?|eq(q)?)?)|n(e|E)|dot|plus|e(dot)?|E|rarr|mult)?)|pa(des(uit)?|r)|e(swar|ct|tm(n|inus)|ar(hk|r(ow)?)|xt|mi|Arr)|q(su(p(set(eq)?|e)?|b(set(eq)?|e)?)|c(up(s)?|ap(s)?)|u(f|ar(e|f))?)|fr(own)?|w(nwar|ar(hk|r(ow)?)|Arr)|larr|acute|rarr|m(t(e(s)?)?|i(d|le)|eparsl|a(shp|llsetminus))|bquo)|S(scr|hort(RightArrow|DownArrow|UpArrow|LeftArrow)|c(y|irc|edil|aron)?|tar|igma|H(cy|CHcy)|opf|u(c(hThat|ceeds(SlantEqual|Tilde|Equal)?)|p(set|erset(Equal)?)?|m|b(set(Equal)?)?)|OFTcy|q(uare(Su(perset(Equal)?|bset(Equal)?)|Intersection|Union)?|rt)|fr|acute|mallCircle))\n| (t(s(hcy|c(y|r)|trok)|h(i(nsp|ck(sim|approx))|orn|e(ta(sym|v)?|re(4|fore))|k(sim|ap))|c(y|edil|aron)|i(nt|lde|mes(d|b(ar)?)?)|o(sa|p(cir|f(ork)?|bot)?|ea)|dot|prime|elrec|fr|w(ixt|ohead(leftarrow|rightarrow))|a(u|rget)|r(i(sb|time|dot|plus|e|angle(down|q|left(eq)?|right(eq)?)?|minus)|pezium|ade)|brk)|T(s(cr|trok)|RADE|h(i(nSpace|ckSpace)|e(ta|refore))|c(y|edil|aron)|S(cy|Hcy)|ilde(Tilde|Equal|FullEqual)?|HORN|opf|fr|a(u|b)|ripleDot))\n| (u(scr|h(ar(l|r)|blk)|c(y|irc)|t(ilde|dot|ri(f)?)|Har|o(pf|gon)|d(har|arr|blac)|u(arr|ml)|p(si(h|lon)?|harpoon(left|right)|downarrow|uparrows|lus|arrow)|f(isht|r)|wangle|l(c(orn(er)?|rop)|tri)|a(cute|rr)|r(c(orn(er)?|rop)|tri|ing)|grave|m(l|acr)|br(cy|eve)|Arr)|U(scr|n(ion(Plus)?|der(B(ar|rac(e|ket))|Parenthesis))|c(y|irc)|tilde|o(pf|gon)|dblac|uml|p(si(lon)?|downarrow|Tee(Arrow)?|per(RightArrow|LeftArrow)|DownArrow|Equilibrium|arrow|Arrow(Bar|DownArrow)?)|fr|a(cute|rr(ocir)?)|ring|grave|macr|br(cy|eve)))\n| (v(s(cr|u(pn(e|E)|bn(e|E)))|nsu(p|b)|cy|Bar(v)?|zigzag|opf|dash|prop|e(e(eq|bar)?|llip|r(t|bar))|Dash|fr|ltri|a(ngrt|r(s(igma|u(psetneq(q)?|bsetneq(q)?))|nothing|t(heta|riangle(left|right))|p(hi|i|ropto)|epsilon|kappa|r(ho)?))|rtri|Arr)|V(scr|cy|opf|dash(l)?|e(e|r(yThinSpace|t(ical(Bar|Separator|Tilde|Line))?|bar))|Dash|vdash|fr|bar))\n| (w(scr|circ|opf|p|e(ierp|d(ge(q)?|bar))|fr|r(eath)?)|W(scr|circ|opf|edge|fr))\n| (X(scr|i|opf|fr)|x(s(cr|qcup)|h(arr|Arr)|nis|c(irc|up|ap)|i|o(time|dot|p(f|lus))|dtri|u(tri|plus)|vee|fr|wedge|l(arr|Arr)|r(arr|Arr)|map))\n| (y(scr|c(y|irc)|icy|opf|u(cy|ml)|en|fr|ac(y|ute))|Y(scr|c(y|irc)|opf|uml|Icy|Ucy|fr|acute|Acy))\n| (z(scr|hcy|c(y|aron)|igrarr|opf|dot|e(ta|etrf)|fr|w(nj|j)|acute)|Z(scr|c(y|aron)|Hcy|opf|dot|e(ta|roWidthSpace)|fr|acute))\n)\n(;)\n", "name": "constant.character.entity.named.$2.astro" }, { "captures": { "1": { "name": "punctuation.definition.entity.astro" }, "3": { "name": "punctuation.definition.entity.astro" } }, "match": "(&)#[0-9]+(;)", "name": "constant.character.entity.numeric.decimal.astro" }, { "captures": { "1": { "name": "punctuation.definition.entity.astro" }, "3": { "name": "punctuation.definition.entity.astro" } }, "match": "(&)#[xX][0-9a-fA-F]+(;)", "name": "constant.character.entity.numeric.hexadecimal.astro" }, { "match": "&(?=[a-zA-Z0-9]+;)", "name": "invalid.illegal.ambiguous-ampersand.astro" }] }, "frontmatter": { "begin": "\\A(-{3})\\s*$", "beginCaptures": { "1": { "name": "comment" } }, "contentName": "source.ts", "end": "(^|\\G)(-{3})|\\.{3}\\s*$", "endCaptures": { "2": { "name": "comment" } }, "patterns": [{ "include": "source.ts" }] }, "interpolation": { "patterns": [{ "begin": "\\{", "beginCaptures": { "0": { "name": "punctuation.section.embedded.begin.astro" } }, "contentName": "meta.embedded.expression.astro source.tsx", "end": "\\}", "endCaptures": { "0": { "name": "punctuation.section.embedded.end.astro" } }, "patterns": [{ "begin": "\\G\\s*(?={)", "end": "(?<=})", "patterns": [{ "include": "source.tsx#object-literal" }] }, { "include": "source.tsx" }] }] }, "scope": { "patterns": [{ "include": "#comments" }, { "include": "#tags" }, { "include": "#interpolation" }, { "include": "#entities" }] }, "tags": { "patterns": [{ "include": "#tags-raw" }, { "include": "#tags-lang" }, { "include": "#tags-void" }, { "include": "#tags-general-end" }, { "include": "#tags-general-start" }] }, "tags-end-node": { "captures": { "1": { "name": "meta.tag.end.astro punctuation.definition.tag.begin.astro" }, "2": { "name": "meta.tag.end.astro", "patterns": [{ "include": "#tags-name" }] }, "3": { "name": "meta.tag.end.astro punctuation.definition.tag.end.astro" }, "4": { "name": "meta.tag.start.astro punctuation.definition.tag.end.astro" } }, "match": "(</)(.*?)\\s*(>)|(/>)" }, "tags-general-end": { "begin": "(</)([^/\\s>]*)", "beginCaptures": { "1": { "name": "meta.tag.end.astro punctuation.definition.tag.begin.astro" }, "2": { "name": "meta.tag.end.astro", "patterns": [{ "include": "#tags-name" }] } }, "end": "(>)", "endCaptures": { "1": { "name": "meta.tag.end.astro punctuation.definition.tag.end.astro" } }, "name": "meta.scope.tag.$2.astro" }, "tags-general-start": { "begin": "(<)([^/\\s>/]*)", "beginCaptures": { "0": { "patterns": [{ "include": "#tags-start-node" }] } }, "end": "(/?>)", "endCaptures": { "1": { "name": "meta.tag.start.astro punctuation.definition.tag.end.astro" } }, "name": "meta.scope.tag.$2.astro", "patterns": [{ "include": "#tags-start-attributes" }] }, "tags-lang": { "begin": "<(script|style)", "beginCaptures": { "0": { "patterns": [{ "include": "#tags-start-node" }] } }, "end": "</\\1\\s*>|/>", "endCaptures": { "0": { "patterns": [{ "include": "#tags-end-node" }] } }, "name": "meta.scope.tag.$1.astro meta.$1.astro", "patterns": [{ "begin": `\\G(?=\\s*[^>]*?(type|lang)\\s*=\\s*(['"]|)(?:text\\/)?(application\\/ld\\+json)\\2)`, "end": "(?=</|/>)", "name": "meta.lang.json.astro", "patterns": [{ "include": "#tags-lang-start-attributes" }] }, { "begin": `\\G(?=\\s*[^>]*?(type|lang)\\s*=\\s*(['"]|)(module)\\2)`, "end": "(?=</|/>)", "name": "meta.lang.javascript.astro", "patterns": [{ "include": "#tags-lang-start-attributes" }] }, { "begin": `\\G(?=\\s*[^>]*?(type|lang)\\s*=\\s*(['"]|)(?:text/|application/)?([\\w\\/+]+)\\2)`, "end": "(?=</|/>)", "name": "meta.lang.$3.astro", "patterns": [{ "include": "#tags-lang-start-attributes" }] }, { "include": "#tags-lang-start-attributes" }] }, "tags-lang-start-attributes": { "begin": "\\G", "end": "(?=/>)|>", "endCaptures": { "0": { "name": "punctuation.definition.tag.end.astro" } }, "name": "meta.tag.start.astro", "patterns": [{ "include": "#attributes" }] }, "tags-name": { "patterns": [{ "match": "[A-Z][a-zA-Z0-9_]*", "name": "support.class.component.astro" }, { "match": "[a-z][\\w0-9:]*-[\\w0-9:-]*", "name": "meta.tag.custom.astro entity.name.tag.astro" }, { "match": "[a-z][\\w0-9:-]*", "name": "entity.name.tag.astro" }] }, "tags-raw": { "begin": "<([^/?!\\s<>]+)(?=[^>]+is:raw).*?", "beginCaptures": { "0": { "patterns": [{ "include": "#tags-start-node" }] } }, "contentName": "source.unknown", "end": "</\\1\\s*>|/>", "endCaptures": { "0": { "patterns": [{ "include": "#tags-end-node" }] } }, "name": "meta.scope.tag.$1.astro meta.raw.astro", "patterns": [{ "include": "#tags-lang-start-attributes" }] }, "tags-start-attributes": { "begin": "\\G", "end": "(?=/?>)", "name": "meta.tag.start.astro", "patterns": [{ "include": "#attributes" }] }, "tags-start-node": { "captures": { "1": { "name": "punctuation.definition.tag.begin.astro" }, "2": { "patterns": [{ "include": "#tags-name" }] } }, "match": "(<)([^/\\s>/]*)", "name": "meta.tag.start.astro" }, "tags-void": { "begin": "(<)(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)(?=\\s|/?>)", "beginCaptures": { "1": { "name": "punctuation.definition.tag.begin.astro" }, "2": { "name": "entity.name.tag.astro" } }, "end": "/?>", "endCaptures": { "0": { "name": "punctuation.definition.tag.begin.astro" } }, "name": "meta.tag.void.astro", "patterns": [{ "include": "#attributes" }] }, "text": { "patterns": [{ "begin": "(?<=^|---|>|})", "end": "(?=<|{|$)", "name": "text.astro", "patterns": [{ "include": "#entities" }] }] } }, "scopeName": "source.astro", "embeddedLangs": ["json", "javascript", "typescript", "stylus", "sass", "css", "scss", "less", "postcss", "tsx"] });
|
|
13
13
|
var astro = [
|
|
14
14
|
...json,
|
|
15
15
|
...javascript,
|
package/dist/langs/bicep.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const lang = Object.freeze({ "displayName": "Bicep", "fileTypes": [".bicep"], "name": "bicep", "patterns": [{ "include": "#expression" }, { "include": "#comments" }], "repository": { "array-literal": { "begin": "\\[(?!(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\bfor\\b)", "end": "]", "name": "meta.array-literal.bicep", "patterns": [{ "include": "#expression" }, { "include": "#comments" }] }, "block-comment": { "begin": "/\\*", "end": "\\*/", "name": "comment.block.bicep" }, "comments": { "patterns": [{ "include": "#line-comment" }, { "include": "#block-comment" }] }, "decorator": { "begin": "@(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*(?=\\b[_$[:alpha:]][_$[:alnum:]]*\\b)", "end": "", "name": "meta.decorator.bicep", "patterns": [{ "include": "#expression" }, { "include": "#comments" }] }, "directive": { "begin": "#\\b[_a-zA-Z-0-9]+\\b", "end": "$", "name": "meta.directive.bicep", "patterns": [{ "include": "#directive-variable" }, { "include": "#comments" }] }, "directive-variable": { "match": "\\b[_a-zA-Z-0-9]+\\b", "name": "keyword.control.declaration.bicep" }, "escape-character": { "match": "\\\\(u{[0-9A-Fa-f]+}|n|r|t|\\\\|'|\\${)", "name": "constant.character.escape.bicep" }, "expression": { "patterns": [{ "include": "#string-literal" }, { "include": "#string-verbatim" }, { "include": "#numeric-literal" }, { "include": "#named-literal" }, { "include": "#object-literal" }, { "include": "#array-literal" }, { "include": "#keyword" }, { "include": "#identifier" }, { "include": "#function-call" }, { "include": "#decorator" }, { "include": "#lambda-start" }, { "include": "#directive" }] }, "function-call": { "begin": "(\\b[_$[:alpha:]][_$[:alnum:]]*\\b)(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\(", "beginCaptures": { "1": { "name": "entity.name.function.bicep" } }, "end": "\\)", "name": "meta.function-call.bicep", "patterns": [{ "include": "#expression" }, { "include": "#comments" }] }, "identifier": { "match": "\\b[_$[:alpha:]][_$[:alnum:]]*\\b(?!(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\()", "name": "variable.other.readwrite.bicep" }, "keyword": { "match": "\\b(metadata|targetScope|resource|module|param|var|output|for|in|if|existing|import|as|type|with|using|func|assert|provider)\\b", "name": "keyword.control.declaration.bicep" }, "lambda-start": { "begin": "(\\((?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\b[_$[:alpha:]][_$[:alnum:]]*\\b(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*(,(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\b[_$[:alpha:]][_$[:alnum:]]*\\b(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*)*\\)|\\((?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\)|(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\b[_$[:alpha:]][_$[:alnum:]]*\\b(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*)(?=(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*=>)", "beginCaptures": { "1": { "name": "meta.undefined.bicep", "patterns": [{ "include": "#identifier" }, { "include": "#comments" }] } }, "end": "(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*=>", "name": "meta.lambda-start.bicep" }, "line-comment": { "match": "//.*(?=$)", "name": "comment.line.double-slash.bicep" }, "named-literal": { "match": "\\b(true|false|null)\\b", "name": "constant.language.bicep" }, "numeric-literal": { "match": "[0-9]+", "name": "constant.numeric.bicep" }, "object-literal": { "begin": "{", "end": "}", "name": "meta.object-literal.bicep", "patterns": [{ "include": "#object-property-key" }, { "include": "#expression" }, { "include": "#comments" }] }, "object-property-key": { "match": "\\b[_$[:alpha:]][_$[:alnum:]]*\\b(?=(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*:)", "name": "variable.other.property.bicep" }, "string-literal": { "begin": "'(?!'')", "end": "'", "name": "string.quoted.single.bicep", "patterns": [{ "include": "#escape-character" }, { "include": "#string-literal-subst" }] }, "string-literal-subst": { "begin": "(?<!\\\\)(\\${)", "beginCaptures": { "1": { "name": "punctuation.definition.template-expression.begin.bicep" } }, "end": "(})", "endCaptures": { "1": { "name": "punctuation.definition.template-expression.end.bicep" } }, "name": "meta.string-literal-subst.bicep", "patterns": [{ "include": "#expression" }, { "include": "#comments" }] }, "string-verbatim": { "begin": "'''", "end": "'''", "name": "string.quoted.multi.bicep", "patterns": [] } }, "scopeName": "source.bicep" });
|
|
1
|
+
const lang = Object.freeze({ "displayName": "Bicep", "fileTypes": [".bicep"], "name": "bicep", "patterns": [{ "include": "#expression" }, { "include": "#comments" }], "repository": { "array-literal": { "begin": "\\[(?!(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\bfor\\b)", "end": "]", "name": "meta.array-literal.bicep", "patterns": [{ "include": "#expression" }, { "include": "#comments" }] }, "block-comment": { "begin": "/\\*", "end": "\\*/", "name": "comment.block.bicep" }, "comments": { "patterns": [{ "include": "#line-comment" }, { "include": "#block-comment" }] }, "decorator": { "begin": "@(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*(?=\\b[_$[:alpha:]][_$[:alnum:]]*\\b)", "end": "", "name": "meta.decorator.bicep", "patterns": [{ "include": "#expression" }, { "include": "#comments" }] }, "directive": { "begin": "#\\b[_a-zA-Z-0-9]+\\b", "end": "$", "name": "meta.directive.bicep", "patterns": [{ "include": "#directive-variable" }, { "include": "#comments" }] }, "directive-variable": { "match": "\\b[_a-zA-Z-0-9]+\\b", "name": "keyword.control.declaration.bicep" }, "escape-character": { "match": "\\\\(u{[0-9A-Fa-f]+}|n|r|t|\\\\|'|\\${)", "name": "constant.character.escape.bicep" }, "expression": { "patterns": [{ "include": "#string-literal" }, { "include": "#string-verbatim" }, { "include": "#numeric-literal" }, { "include": "#named-literal" }, { "include": "#object-literal" }, { "include": "#array-literal" }, { "include": "#keyword" }, { "include": "#identifier" }, { "include": "#function-call" }, { "include": "#decorator" }, { "include": "#lambda-start" }, { "include": "#directive" }] }, "function-call": { "begin": "(\\b[_$[:alpha:]][_$[:alnum:]]*\\b)(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\(", "beginCaptures": { "1": { "name": "entity.name.function.bicep" } }, "end": "\\)", "name": "meta.function-call.bicep", "patterns": [{ "include": "#expression" }, { "include": "#comments" }] }, "identifier": { "match": "\\b[_$[:alpha:]][_$[:alnum:]]*\\b(?!(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\()", "name": "variable.other.readwrite.bicep" }, "keyword": { "match": "\\b(metadata|targetScope|resource|module|param|var|output|for|in|if|existing|import|as|type|with|using|func|assert|provider)\\b", "name": "keyword.control.declaration.bicep" }, "lambda-start": { "begin": "(\\((?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\b[_$[:alpha:]][_$[:alnum:]]*\\b(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*(,(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\b[_$[:alpha:]][_$[:alnum:]]*\\b(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*)*\\)|\\((?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\)|(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*\\b[_$[:alpha:]][_$[:alnum:]]*\\b(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*)(?=(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*=>)", "beginCaptures": { "1": { "name": "meta.undefined.bicep", "patterns": [{ "include": "#identifier" }, { "include": "#comments" }] } }, "end": "(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*=>", "name": "meta.lambda-start.bicep" }, "line-comment": { "match": "//.*(?=$)", "name": "comment.line.double-slash.bicep" }, "named-literal": { "match": "\\b(true|false|null)\\b", "name": "constant.language.bicep" }, "numeric-literal": { "match": "[0-9]+", "name": "constant.numeric.bicep" }, "object-literal": { "begin": "{", "end": "}", "name": "meta.object-literal.bicep", "patterns": [{ "include": "#object-property-key" }, { "include": "#expression" }, { "include": "#comments" }] }, "object-property-key": { "match": "\\b[_$[:alpha:]][_$[:alnum:]]*\\b(?=(?:[ \\t\\r\\n]|\\/\\*(?:\\*(?!\\/)|[^*])*\\*\\/)*:)", "name": "variable.other.property.bicep" }, "string-literal": { "begin": "'(?!'')", "end": "'", "name": "string.quoted.single.bicep", "patterns": [{ "include": "#escape-character" }, { "include": "#string-literal-subst" }] }, "string-literal-subst": { "begin": "(?<!\\\\)(\\${)", "beginCaptures": { "1": { "name": "punctuation.definition.template-expression.begin.bicep" } }, "end": "(})", "endCaptures": { "1": { "name": "punctuation.definition.template-expression.end.bicep" } }, "name": "meta.string-literal-subst.bicep", "patterns": [{ "include": "#expression" }, { "include": "#comments" }] }, "string-verbatim": { "begin": "'''", "end": "'''(?!')", "name": "string.quoted.multi.bicep", "patterns": [] } }, "scopeName": "source.bicep" });
|
|
2
2
|
var bicep = [
|
|
3
3
|
lang
|
|
4
4
|
];
|
package/dist/langs/crystal.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import c from './c.mjs';
|
|
|
5
5
|
import javascript from './javascript.mjs';
|
|
6
6
|
import shellscript from './shellscript.mjs';
|
|
7
7
|
|
|
8
|
-
const lang = Object.freeze({ "displayName": "Crystal", "fileTypes": ["cr"], "firstLineMatch": "^#!/.*\\bcrystal", "foldingStartMarker": `(?x)^(\\s*+(annotation|module|class|struct|union|enum|def(?!.*\\bend\\s*$)|unless|if|case|begin|for|while|until|^=begin|("(\\\\.|[^"])*+"|'(\\\\.|[^'])*+'|[^#"'])*(\\s(do|begin|case)|(?<!\\$)[-+=&|*/~%^<>~]\\s*+(if|unless)))\\b(?![^;]*+;.*?\\bend\\b)|("(\\\\.|[^"])*+"|'(\\\\.|[^'])*+'|[^#"'])*(\\{(?![^}]*+\\})|\\[(?![^\\]]*+\\]))).*$|[#].*?\\(fold\\)\\s*+$`, "foldingStopMarker": "(?x)((^|;)\\s*+end\\s*+([#].*)?$|(^|;)\\s*+end\\..*$|^\\s*+[}\\]] ,?\\s*+([#].*)?$|[#].*?\\(end\\)\\s*+$|^=end)", "name": "crystal", "patterns": [{ "captures": { "1": { "name": "keyword.control.class.crystal" }, "2": { "name": "keyword.control.class.crystal" }, "3": { "name": "entity.name.type.class.crystal" }, "5": { "name": "punctuation.separator.crystal" }, "6": { "name": "support.class.other.type-param.crystal" }, "7": { "name": "entity.other.inherited-class.crystal" }, "8": { "name": "punctuation.separator.crystal" }, "9": { "name": "punctuation.separator.crystal" }, "10": { "name": "support.class.other.type-param.crystal" }, "11": { "name": "punctuation.definition.variable.crystal" } }, "match": "(?x)^\\s*(abstract)?\\s*(class|struct|union|annotation|enum)\\s+(([.A-Z_:\\x{80}-\\x{10FFFF}][.\\w:\\x{80}-\\x{10FFFF}]*(\\(([,\\s.a-zA-Z0-9_:\\x{80}-\\x{10FFFF}]+)\\))?(\\s*(<)\\s*[.:A-Z\\x{80}-\\x{10FFFF}][.:\\w\\x{80}-\\x{10FFFF}]*(\\(([.a-zA-Z0-9_:]+\\s,)\\))?)?)|((<<)\\s*[.A-Z0-9_:\\x{80}-\\x{10FFFF}]+))", "name": "meta.class.crystal" }, { "captures": { "1": { "name": "keyword.control.module.crystal" }, "2": { "name": "entity.name.type.module.crystal" }, "3": { "name": "entity.other.inherited-class.module.first.crystal" }, "4": { "name": "punctuation.separator.inheritance.crystal" }, "5": { "name": "entity.other.inherited-class.module.second.crystal" }, "6": { "name": "punctuation.separator.inheritance.crystal" }, "7": { "name": "entity.other.inherited-class.module.third.crystal" }, "8": { "name": "punctuation.separator.inheritance.crystal" } }, "match": "^\\s*(module)\\s+(([A-Z\\x{80}-\\x{10FFFF}][\\w\\x{80}-\\x{10FFFF}]*(::))?([A-Z\\x{80}-\\x{10FFFF}][\\w\\x{80}-\\x{10FFFF}]*(::))?([A-Z\\x{80}-\\x{10FFFF}][\\w\\x{80}-\\x{10FFFF}]*(::))*[A-Z\\x{80}-\\x{10FFFF}][\\w\\x{80}-\\x{10FFFF}]*)", "name": "meta.module.crystal" }, { "captures": { "1": { "name": "keyword.control.lib.crystal" }, "2": { "name": "entity.name.type.lib.crystal" }, "3": { "name": "entity.other.inherited-class.lib.first.crystal" }, "4": { "name": "punctuation.separator.inheritance.crystal" }, "5": { "name": "entity.other.inherited-class.lib.second.crystal" }, "6": { "name": "punctuation.separator.inheritance.crystal" }, "7": { "name": "entity.other.inherited-class.lib.third.crystal" }, "8": { "name": "punctuation.separator.inheritance.crystal" } }, "match": "^\\s*(lib)\\s+(([A-Z]\\w*(::))?([A-Z]\\w*(::))?([A-Z]\\w*(::))*[A-Z]\\w*)", "name": "meta.lib.crystal" }, { "captures": { "1": { "name": "keyword.control.lib.type.crystal" }, "2": { "name": "entity.name.lib.type.crystal" }, "3": { "name": "keyword.control.lib.crystal" }, "4": { "name": "entity.name.lib.type.value.crystal" } }, "comment": "type in lib", "match": "(?<!\\.)\\b(type)\\s+([A-Z]\\w+)\\s*(=)\\s*(.+)", "name": "meta.lib.type.crystal" }, { "comment": "everything being a reserved word, not a value, and needing a 'end' is a..", "match": "(?<!\\.)\\b(fun|begin|case|class|else|elsif|end|ensure|enum|for|if|macro|module|rescue|struct|then|union|unless|until|when|while)\\b(?![?!:])", "name": "keyword.control.crystal" }, { "comment": "everything being a reserved word, not a value, and not needing a 'end' is a..", "match": "(?<!\\.)\\b(abstract|alias|asm|break|extend|in|include|next|of|private|protected|struct|return|select|super|with|yield)\\b(?![?!:])", "name": "keyword.control.primary.crystal" }, { "comment": "everything being a spec keyword, not a value, and needing a block is a..", "match": "(?<!\\.)\\b(describe|context|it|expect_raises)\\b(?![?!:])", "name": "keyword.control.crystal" }, { "comment": "contextual smart pair support for block parameters", "match": "(?<!\\.)\\bdo\\b\\s*", "name": "keyword.control.start-block.crystal" }, { "comment": "contextual smart pair support", "match": "(?<=\\{)(\\s+)", "name": "meta.syntax.crystal.start-block" }, { "comment": "Just as above but being not a logical operation", "match": "(?<!\\.)\\b(pointerof|typeof|sizeof|instance_sizeof|offsetof|previous_def|forall|out|uninitialized)\\b(?![?!:])|\\.(is_a\\?|nil\\?|responds_to\\?|as\\?|as\b)", "name": "keyword.control.pseudo-method.crystal" }, { "match": "\\bnil\\b(?![?!:])", "name": "constant.language.nil.crystal" }, { "match": "\\b(true|false)\\b(?![?!:])", "name": "constant.language.boolean.crystal" }, { "match": "\\b(__(DIR|FILE|LINE|END_LINE)__)\\b(?![?!:])", "name": "variable.language.crystal" }, { "match": "\\b(self)\\b(?![?!:])", "name": "variable.language.self.crystal" }, { "comment": "https://crystal-lang.org/api/0.36.1/Object.html#macro-summary", "match": "(?<!\\.)\\b(((class_)?((getter|property)\\b[!?]?|setter\\b))|(def_(clone|equals|equals_and_hash|hash)|delegate|forward_missing_to)\\b)(?![?!:])", "name": "support.function.kernel.crystal" }, { "begin": "\\b(require)\\b", "captures": { "1": { "name": "keyword.other.special-method.crystal" } }, "end": "$|(?=#)", "name": "meta.require.crystal", "patterns": [{ "include": "$self" }] }, { "captures": { "1": { "name": "punctuation.definition.variable.crystal" } }, "match": "(@)[a-zA-Z_\\x{80}-\\x{10FFFF}][\\w\\x{80}-\\x{10FFFF}]*[?!=]?", "name": "variable.other.readwrite.instance.crystal" }, { "captures": { "1": { "name": "punctuation.definition.variable.crystal" } }, "match": "(@@)[a-zA-Z_\\x{80}-\\x{10FFFF}][\\w\\x{80}-\\x{10FFFF}]*[?!=]?", "name": "variable.other.readwrite.class.crystal" }, { "captures": { "1": { "name": "punctuation.definition.variable.crystal" } }, "match": "(\\$)[a-zA-Z_]\\w*", "name": "variable.other.readwrite.global.crystal" }, { "captures": { "1": { "name": "punctuation.definition.variable.crystal" } }, "match": "(?!%[Qxrqwi]?[\\(\\[\\{\\<\\|])%([a-zA-Z_]\\w*\\.)*[a-zA-Z_]\\w*", "name": "variable.other.readwrite.fresh.crystal" }, { "captures": { "1": { "name": "punctuation.definition.variable.crystal" } }, "match": "(\\$)(!|@|&|`|'|\\+|\\d+|~|=|/|\\\\|,|;|\\.|<|>|_|\\*|\\$|\\?|:|\"|-[0adFiIlpv])", "name": "variable.other.readwrite.global.pre-defined.crystal" }, { "begin": "\\b(ENV)\\[", "beginCaptures": { "1": { "name": "variable.other.constant.crystal" } }, "end": "\\]", "name": "meta.environment-variable.crystal", "patterns": [{ "include": "$self" }] }, { "comment": "Literals name of Crystal", "match": "\\b[A-Z\\x{80}-\\x{10FFFF}][\\w\\x{80}-\\x{10FFFF}]*", "name": "support.class.crystal" }, { "comment": "Fetch from https://crystal-lang.org/api/0.36.1/toplevel.html", "match": "(?<!\\.)\\b(abort|at_exit|caller|exit|gets|loop|main|p|pp|print|printf|puts|raise|rand|read_line|sleep|spawn|sprintf|system|debugger|record|spawn)\\b(?![?!:])", "name": "support.function.kernel.crystal" }, { "comment": "Constant name in any where", "match": "\\b[_A-Z]+\\b", "name": "variable.other.constant.crystal" }, { "begin": "(?x)\n(?=def\\b)\n(?<=^|\\s)(def)\\s+\n(\n(?>[a-zA-Z_]\\w*(?>\\.|::))?\n(?>\n[a-zA-Z_]\\w*(?>[?!]|=(?!>))?\n|\n\\^|===?|!=|>[>=]?|<=>|<[<=]?|[%&`/\\|]|\\*\\*?|=?~|[-+]@?|\\[][?=]?|\\[]=?\n)\n)\n\\s*(\\()", "beginCaptures": { "1": { "name": "keyword.control.def.crystal" }, "2": { "name": "entity.name.function.crystal" }, "3": { "name": "punctuation.definition.parameters.crystal" } }, "comment": "The method pattern comes from the symbol pattern. See there for an explanation.", "end": "\\)", "endCaptures": { "0": { "name": "punctuation.definition.parameters.crystal" } }, "name": "meta.function.method.with-arguments.crystal", "patterns": [{ "begin": "(?![\\s,)])", "end": "(?=,|\\)\\s*)", "patterns": [{ "captures": { "1": { "name": "storage.type.variable.crystal" }, "2": { "name": "constant.other.symbol.hashkey.parameter.function.crystal" }, "3": { "name": "punctuation.definition.constant.hashkey.crystal" }, "4": { "name": "variable.parameter.function.crystal" } }, "match": "\\G([&*]?)(?:([_a-zA-Z]\\w*(:))|([_a-zA-Z]\\w*))" }, { "include": "$self" }] }] }, { "captures": { "1": { "name": "keyword.control.def.crystal" }, "3": { "name": "entity.name.function.crystal" } }, "comment": " the optional name is just to catch the def also without a method-name", "match": "(?x)\n(?=def\\b)\n(?<=^|\\s)(def)\\b\n(\n\\s+\n(\n(?>[a-zA-Z_]\\w*(?>\\.|::))?\n(?>\n[a-zA-Z_]\\w*(?>[?!]|=(?!>))?\n|\n\\^|===?|!=|>[>=]?|<=>|<[<=]?|[%&`/\\|]|\\*\\*?|=?~|[-+]@?|\\[][?=]?|\\[]=?\n)\n)\n)?", "name": "meta.function.method.without-arguments.crystal" }, { "comment": "Floating point literal (fraction)", "match": "\\b[0-9][0-9_]*\\.[0-9][0-9_]*([eE][+-]?[0-9_]+)?(f32|f64)?\\b", "name": "constant.numeric.float.crystal" }, { "comment": "Floating point literal (exponent)", "match": "\\b[0-9][0-9_]*(\\.[0-9][0-9_]*)?[eE][+-]?[0-9_]+(f32|f64)?\\b", "name": "constant.numeric.float.crystal" }, { "comment": "Floating point literal (typed)", "match": "\\b[0-9][0-9_]*(\\.[0-9][0-9_]*)?([eE][+-]?[0-9_]+)?(f32|f64)\\b", "name": "constant.numeric.float.crystal" }, { "comment": "Integer literal (decimal)", "match": "\\b(?!0[0-9])[0-9][0-9_]*([ui](8|16|32|64|128))?\\b", "name": "constant.numeric.integer.decimal.crystal" }, { "comment": "Integer literal (hexadecimal)", "match": "\\b0x[a-fA-F0-9_]+([ui](8|16|32|64|128))?\\b", "name": "constant.numeric.integer.hexadecimal.crystal" }, { "comment": "Integer literal (octal)", "match": "\\b0o[0-7_]+([ui](8|16|32|64|128))?\\b", "name": "constant.numeric.integer.octal.crystal" }, { "comment": "Integer literal (binary)", "match": "\\b0b[01_]+([ui](8|16|32|64|128))?\\b", "name": "constant.numeric.integer.binary.crystal" }, { "begin": ":'", "beginCaptures": { "0": { "name": "punctuation.definition.symbol.begin.crystal" } }, "comment": "symbol literal with '' delimiter", "end": "'", "endCaptures": { "0": { "name": "punctuation.definition.symbol.end.crystal" } }, "name": "constant.other.symbol.crystal", "patterns": [{ "match": "\\\\['\\\\]", "name": "constant.character.escape.crystal" }] }, { "begin": ':"', "beginCaptures": { "0": { "name": "punctuation.section.symbol.begin.crystal" } }, "comment": 'symbol literal with "" delimiter', "end": '"', "endCaptures": { "0": { "name": "punctuation.section.symbol.end.crystal" } }, "name": "constant.other.symbol.interpolated.crystal", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "comment": "Needs higher precedence than regular expressions.", "match": "(?<!\\()/=", "name": "keyword.operator.assignment.augmented.crystal" }, { "begin": "'", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "string literal with '' delimiter", "end": "'", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.quoted.single.crystal", "patterns": [{ "match": "\\\\'|\\\\\\\\", "name": "constant.character.escape.crystal" }] }, { "begin": '"', "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": 'string literal with interpolation and "" delimiter', "end": '"', "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.quoted.double.interpolated.crystal", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "`", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "execute string (allows for interpolation)", "end": "`", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.interpolated.crystal", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "%x\\{", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "execute string (allow for interpolation)", "end": "\\}", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.interpolated.crystal", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_curly_i" }] }, { "begin": "%x\\[", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "execute string (allow for interpolation)", "end": "\\]", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.interpolated.crystal", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_brackets_i" }] }, { "begin": "%x\\<", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "execute string (allow for interpolation)", "end": "\\>", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.interpolated.crystal", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_ltgt_i" }] }, { "begin": "%x\\(", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "execute string (allow for interpolation)", "end": "\\)", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.interpolated.crystal", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_parens_i" }] }, { "begin": "%x\\|", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "execute string (allow for interpolation)", "end": "\\|", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.interpolated.crystal", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "(?x) (?: ^| (?<=[=>~(?:\\[,|&;] | [\\s;]if\\s| [\\s;]elsif\\s | [\\s;]while\\s | [\\s;]unless\\s | [\\s;]when\\s | [\\s;]assert_match\\s | [\\s;]or\\s| [\\s;]and\\s | [\\s;]not\\s | [\\s.]index\\s| [\\s.]scan\\s | [\\s.]sub\\s | [\\s.]sub!\\s | [\\s.]gsub\\s | [\\s.]gsub!\\s | [\\s.]match\\s ) | (?<=^when\\s| ^if\\s | ^elsif\\s | ^while\\s | ^unless\\s ) ) \\s*((/))(?![*+{}?])", "captures": { "1": { "name": "string.regexp.classic.crystal" }, "2": { "name": "punctuation.definition.string.crystal" } }, "comment": "regular expressions (normal) we only start a regexp if the character before it (excluding whitespace) is what we think is before a regexp", "contentName": "string.regexp.classic.crystal", "end": "((/[imsx]*))", "patterns": [{ "include": "#regex_sub" }] }, { "begin": "%r\\{", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "regular expressions (literal)", "end": "\\}[imsx]*", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.regexp.mod-r.crystal", "patterns": [{ "include": "#regex_sub" }, { "include": "#nest_curly_r" }] }, { "begin": "%r\\[", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "regular expressions (literal)", "end": "\\][imsx]*", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.regexp.mod-r.crystal", "patterns": [{ "include": "#regex_sub" }, { "include": "#nest_brackets_r" }] }, { "begin": "%r\\(", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "regular expressions (literal)", "end": "\\)[imsx]*", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.regexp.mod-r.crystal", "patterns": [{ "include": "#regex_sub" }, { "include": "#nest_parens_r" }] }, { "begin": "%r\\<", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "regular expressions (literal)", "end": "\\>[imsx]*", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.regexp.mod-r.crystal", "patterns": [{ "include": "#regex_sub" }, { "include": "#nest_ltgt_r" }] }, { "begin": "%r\\|", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "regular expressions (literal)", "end": "\\|[imsx]*", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.regexp.mod-r.crystal", "patterns": [{ "include": "#regex_sub" }] }, { "begin": "%Q?\\(", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "literal capable of interpolation ()", "end": "\\)", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.quoted.other.literal.upper.crystal", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_parens_i" }] }, { "begin": "%Q?\\[", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "literal capable of interpolation []", "end": "\\]", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.quoted.other.literal.upper.crystal", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_brackets_i" }] }, { "begin": "%Q?\\<", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "literal capable of interpolation <>", "end": "\\>", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.quoted.other.literal.upper.crystal", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_ltgt_i" }] }, { "begin": "%Q?\\{", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "literal capable of interpolation -- {}", "end": "\\}", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.quoted.double.crystal.mod", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_curly_i" }] }, { "begin": "%Q\\|", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "literal capable of interpolation -- ||", "end": "\\|", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.quoted.other.literal.upper.crystal", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "%[qwi]\\(", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "literal incapable of interpolation -- ()", "end": "\\)", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.quoted.other.literal.lower.crystal", "patterns": [{ "match": "\\\\\\)|\\\\\\\\", "name": "constant.character.escape.crystal" }, { "include": "#nest_parens" }] }, { "begin": "%[qwi]\\<", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "literal incapable of interpolation -- <>", "end": "\\>", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.quoted.other.literal.lower.crystal", "patterns": [{ "match": "\\\\\\>|\\\\\\\\", "name": "constant.character.escape.crystal" }, { "include": "#nest_ltgt" }] }, { "begin": "%[qwi]\\[", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "literal incapable of interpolation -- []", "end": "\\]", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.quoted.other.literal.lower.crystal", "patterns": [{ "match": "\\\\\\]|\\\\\\\\", "name": "constant.character.escape.crystal" }, { "include": "#nest_brackets" }] }, { "begin": "%[qwi]\\{", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "literal incapable of interpolation -- {}", "end": "\\}", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.quoted.other.literal.lower.crystal", "patterns": [{ "match": "\\\\\\}|\\\\\\\\", "name": "constant.character.escape.crystal" }, { "include": "#nest_curly" }] }, { "begin": "%[qwi]\\|", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "literal incapable of interpolation -- ||", "end": "\\|", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.quoted.other.literal.lower.crystal", "patterns": [{ "comment": "Cant be named because its not necessarily an escape.", "match": "\\\\." }] }, { "captures": { "1": { "name": "punctuation.definition.constant.crystal" } }, "comment": "symbols", "match": "(?<!:)(:)(?>[a-zA-Z_\\x{80}-\\x{10FFFF}][\\w\\x{80}-\\x{10FFFF}]*(?>[?!]|=(?![>=]))?|===?|>[>=]?|<[<=]?|<=>|[%&`/\\|]|\\*\\*?|=?~|[-+]@?|\\[\\][?=]?|@@?[a-zA-Z_\\x{80}-\\x{10FFFF}][\\w\\x{80}-\\x{10FFFF}]*)", "name": "constant.other.symbol.crystal" }, { "captures": { "1": { "name": "punctuation.definition.constant.crystal" } }, "comment": "symbols", "match": "(?>[a-zA-Z_\\x{80}-\\x{10FFFF}][\\w\\x{80}-\\x{10FFFF}]*(?>[?!])?)(:)(?!:)", "name": "constant.other.symbol.crystal.19syntax" }, { "captures": { "1": { "name": "punctuation.definition.comment.crystal" } }, "match": "(?:^[ \\t]+)?(#).*$\\n?", "name": "comment.line.number-sign.crystal" }, { "match": "\\b_([\\w]+[?!]?)\\b(?!\\()", "name": "comment.unused.crystal" }, { "begin": "(?><<-('?)((?:[_\\w]+_|)HTML)\\b\\1)", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "heredoc with embedded HTML and indented terminator", "contentName": "text.html.embedded.crystal", "end": "\\s*\\2\\b", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.unquoted.embedded.html.crystal", "patterns": [{ "include": "#heredoc" }, { "include": "text.html.basic" }, { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "(?><<-('?)((?:[_\\w]+_|)SQL)\\b\\1)", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "heredoc with embedded SQL and indented terminator", "contentName": "text.sql.embedded.crystal", "end": "\\s*\\2\\b", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.unquoted.embedded.sql.crystal", "patterns": [{ "include": "#heredoc" }, { "include": "source.sql" }, { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "(?><<-('?)((?:[_\\w]+_|)CSS)\\b\\1)", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "heredoc with embedded css and intented terminator", "contentName": "text.css.embedded.crystal", "end": "\\s*\\2\\b", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.unquoted.embedded.css.crystal", "patterns": [{ "include": "#heredoc" }, { "include": "source.css" }, { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "(?><<-('?)((?:[_\\w]+_|)CPP)\\b\\1)", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "heredoc with embedded c++ and intented terminator", "contentName": "text.c++.embedded.crystal", "end": "\\s*\\2\\b", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.unquoted.embedded.cplusplus.crystal", "patterns": [{ "include": "#heredoc" }, { "include": "source.c++" }, { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "(?><<-('?)((?:[_\\w]+_|)C)\\b\\1)", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "heredoc with embedded c++ and intented terminator", "contentName": "text.c.embedded.crystal", "end": "\\s*\\2\\b", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.unquoted.embedded.c.crystal", "patterns": [{ "include": "#heredoc" }, { "include": "source.c" }, { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "(?><<-('?)((?:[_\\w]+_|)(?:JS|JAVASCRIPT))\\b\\1)", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "heredoc with embedded javascript and intented terminator", "contentName": "text.js.embedded.crystal", "end": "\\s*\\2\\b", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.unquoted.embedded.js.crystal", "patterns": [{ "include": "#heredoc" }, { "include": "source.js" }, { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "(?><<-('?)((?:[_\\w]+_|)JQUERY)\\b\\1)", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "heredoc with embedded javascript and intented terminator", "contentName": "text.js.jquery.embedded.crystal", "end": "\\s*\\2\\b", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.unquoted.embedded.js.jquery.crystal", "patterns": [{ "include": "#heredoc" }, { "include": "source.js.jquery" }, { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "(?><<-('?)((?:[_\\w]+_|)(?:SH|SHELL))\\b\\1)", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "heredoc with embedded shell and intented terminator", "contentName": "text.shell.embedded.crystal", "end": "\\s*\\2\\b", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.unquoted.embedded.shell.crystal", "patterns": [{ "include": "#heredoc" }, { "include": "source.shell" }, { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "(?><<-('?)((?:[_\\w]+_|)CRYSTAL)\\b\\1)", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "heredoc with embedded crystal and intented terminator", "contentName": "text.crystal.embedded.crystal", "end": "\\s*\\2\\b", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.unquoted.embedded.crystal.crystal", "patterns": [{ "include": "#heredoc" }, { "include": "source.crystal" }, { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "(?><<-'(\\w+)')", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "heredoc with indented terminator", "end": "\\s*\\1\\b", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.unquoted.heredoc.crystal", "patterns": [{ "include": "#heredoc" }, { "include": "#escaped_char" }] }, { "begin": "(?><<-(\\w+)\\b)", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "heredoc with indented terminator", "end": "\\s*\\1\\b", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.unquoted.heredoc.crystal", "patterns": [{ "include": "#heredoc" }, { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "(?<={|{\\s|[^A-Za-z0-9_]do|^do|[^A-Za-z0-9_]do\\s|^do\\s)(\\|)", "captures": { "1": { "name": "punctuation.separator.variable.crystal" } }, "end": "(?<!\\|)(\\|)(?!\\|)", "patterns": [{ "include": "source.crystal" }, { "match": "[_a-zA-Z][_a-zA-Z0-9]*", "name": "variable.other.block.crystal" }, { "match": ",", "name": "punctuation.separator.variable.crystal" }] }, { "match": "=>", "name": "punctuation.separator.key-value" }, { "match": "->", "name": "support.function.kernel.crystal" }, { "match": "<<=|%=|&{1,2}=|\\*=|\\*\\*=|\\+=|-=|\\^=|\\|{1,2}=|<<", "name": "keyword.operator.assignment.augmented.crystal" }, { "match": "<=>|<(?!<|=)|>(?!<|=|>)|<=|>=|===|==|=~|!=|!~|(?<=[ \\t])\\?", "name": "keyword.operator.comparison.crystal" }, { "match": "(?<=^|[ \\t])!|&&|\\|\\||\\^", "name": "keyword.operator.logical.crystal" }, { "match": "(\\{\\%|\\%\\}|\\{\\{|\\}\\})", "name": "keyword.operator.macro.crystal" }, { "captures": { "1": { "name": "punctuation.separator.method.crystal" } }, "comment": "Safe navigation operator", "match": "(&\\.)\\s*(?![A-Z])" }, { "match": "(%|&|\\*\\*|\\*|\\+|\\-|/)", "name": "keyword.operator.arithmetic.crystal" }, { "match": "=", "name": "keyword.operator.assignment.crystal" }, { "match": "\\||~|>>", "name": "keyword.operator.other.crystal" }, { "match": ":", "name": "punctuation.separator.other.crystal" }, { "match": "\\;", "name": "punctuation.separator.statement.crystal" }, { "match": ",", "name": "punctuation.separator.object.crystal" }, { "match": "\\.|::", "name": "punctuation.separator.method.crystal" }, { "match": "\\{|\\}", "name": "punctuation.section.scope.crystal" }, { "match": "\\[|\\]", "name": "punctuation.section.array.crystal" }, { "match": "\\(|\\)", "name": "punctuation.section.function.crystal" }, { "begin": "(?=[a-zA-Z0-9_!?]+\\()", "end": "(?<=\\))", "name": "meta.function-call.crystal", "patterns": [{ "match": "([a-zA-Z0-9_!?]+)(?=\\()", "name": "entity.name.function.crystal" }, { "include": "$self" }] }, { "comment": "This is kindof experimental. There really is no way to perfectly match all regular variables, but you can pretty well assume that any normal word in certain curcumstances that havnt already been scoped as something else are probably variables, and the advantages beat the potential errors", "match": "((?<=\\W)\\b|^)\\w+\\b(?=\\s*([\\]\\)\\}\\=\\+\\-\\*\\/\\^\\$\\,\\.]|<\\s|<<[\\s|\\.]))", "name": "variable.other.crystal" }], "repository": { "escaped_char": { "comment": "https://crystal-lang.org/reference/syntax_and_semantics/literals/string.html", "match": "\\\\(?:[0-7]{1,3}|x[a-fA-F0-9]{2}|u[a-fA-F0-9]{4}|u\\{[a-fA-F0-9 ]+\\}|.)", "name": "constant.character.escape.crystal" }, "heredoc": { "begin": "^<<-?\\w+", "end": "$", "patterns": [{ "include": "$self" }] }, "interpolated_crystal": { "patterns": [{ "begin": "#\\{", "beginCaptures": { "0": { "name": "punctuation.section.embedded.begin.crystal" } }, "contentName": "source.crystal", "end": "(\\})", "endCaptures": { "0": { "name": "punctuation.section.embedded.end.crystal" }, "1": { "name": "source.crystal" } }, "name": "meta.embedded.line.crystal", "patterns": [{ "include": "#nest_curly_and_self" }, { "include": "$self" }], "repository": { "nest_curly_and_self": { "patterns": [{ "begin": "\\{", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\}", "patterns": [{ "include": "#nest_curly_and_self" }] }, { "include": "$self" }] } } }, { "captures": { "1": { "name": "punctuation.definition.variable.crystal" } }, "match": "(#@)[a-zA-Z_]\\w*", "name": "variable.other.readwrite.instance.crystal" }, { "captures": { "1": { "name": "punctuation.definition.variable.crystal" } }, "match": "(#@@)[a-zA-Z_]\\w*", "name": "variable.other.readwrite.class.crystal" }, { "captures": { "1": { "name": "punctuation.definition.variable.crystal" } }, "match": "(#\\$)[a-zA-Z_]\\w*", "name": "variable.other.readwrite.global.crystal" }] }, "nest_brackets": { "begin": "\\[", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\]", "patterns": [{ "include": "#nest_brackets" }] }, "nest_brackets_i": { "begin": "\\[", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\]", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_brackets_i" }] }, "nest_brackets_r": { "begin": "\\[", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\]", "patterns": [{ "include": "#regex_sub" }, { "include": "#nest_brackets_r" }] }, "nest_curly": { "begin": "\\{", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\}", "patterns": [{ "include": "#nest_curly" }] }, "nest_curly_and_self": { "patterns": [{ "begin": "\\{", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\}", "patterns": [{ "include": "#nest_curly_and_self" }] }, { "include": "$self" }] }, "nest_curly_i": { "begin": "\\{", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\}", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_curly_i" }] }, "nest_curly_r": { "begin": "\\{", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\}", "patterns": [{ "include": "#regex_sub" }, { "include": "#nest_curly_r" }] }, "nest_ltgt": { "begin": "\\<", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\>", "patterns": [{ "include": "#nest_ltgt" }] }, "nest_ltgt_i": { "begin": "\\<", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\>", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_ltgt_i" }] }, "nest_ltgt_r": { "begin": "\\<", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\>", "patterns": [{ "include": "#regex_sub" }, { "include": "#nest_ltgt_r" }] }, "nest_parens": { "begin": "\\(", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\)", "patterns": [{ "include": "#nest_parens" }] }, "nest_parens_i": { "begin": "\\(", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\)", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_parens_i" }] }, "nest_parens_r": { "begin": "\\(", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\)", "patterns": [{ "include": "#regex_sub" }, { "include": "#nest_parens_r" }] }, "regex_sub": { "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "captures": { "1": { "name": "punctuation.definition.arbitrary-repetition.crystal" }, "3": { "name": "punctuation.definition.arbitrary-repetition.crystal" } }, "match": "({)\\d+(,\\d+)?(})", "name": "string.regexp.arbitrary-repetition.crystal" }, { "begin": "\\[(?:\\^?])?", "captures": { "0": { "name": "punctuation.definition.character-class.crystal" } }, "end": "]", "name": "string.regexp.character-class.crystal", "patterns": [{ "include": "#escaped_char" }] }, { "begin": "\\(", "captures": { "0": { "name": "punctuation.definition.group.crystal" } }, "end": "\\)", "name": "string.regexp.group.crystal", "patterns": [{ "include": "#regex_sub" }] }, { "captures": { "1": { "name": "punctuation.definition.comment.crystal" } }, "comment": "We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.", "match": "(?<=^|\\s)(#)\\s[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$", "name": "comment.line.number-sign.crystal" }] } }, "scopeName": "source.crystal", "embeddedLangs": ["html", "sql", "css", "c", "javascript", "shellscript"] });
|
|
8
|
+
const lang = Object.freeze({ "displayName": "Crystal", "fileTypes": ["cr"], "firstLineMatch": "^#!/.*\\bcrystal", "foldingStartMarker": `(?x)^(\\s*+(annotation|module|class|struct|union|enum|def(?!.*\\bend\\s*$)|unless|if|case|begin|for|while|until|^=begin|("(\\\\.|[^"])*+"|'(\\\\.|[^'])*+'|[^#"'])*(\\s(do|begin|case)|(?<!\\$)[-+=&|*/~%^<>~]\\s*+(if|unless)))\\b(?![^;]*+;.*?\\bend\\b)|("(\\\\.|[^"])*+"|'(\\\\.|[^'])*+'|[^#"'])*(\\{(?![^}]*+\\})|\\[(?![^\\]]*+\\]))).*$|[#].*?\\(fold\\)\\s*+$`, "foldingStopMarker": "(?x)((^|;)\\s*+end\\s*+([#].*)?$|(^|;)\\s*+end\\..*$|^\\s*+[}\\]] ,?\\s*+([#].*)?$|[#].*?\\(end\\)\\s*+$|^=end)", "name": "crystal", "patterns": [{ "captures": { "1": { "name": "keyword.control.class.crystal" }, "2": { "name": "keyword.control.class.crystal" }, "3": { "name": "entity.name.type.class.crystal" }, "5": { "name": "punctuation.separator.crystal" }, "6": { "name": "support.class.other.type-param.crystal" }, "7": { "name": "entity.other.inherited-class.crystal" }, "8": { "name": "punctuation.separator.crystal" }, "9": { "name": "punctuation.separator.crystal" }, "10": { "name": "support.class.other.type-param.crystal" }, "11": { "name": "punctuation.definition.variable.crystal" } }, "match": "(?x)^\\s*(abstract)?\\s*(class|struct|union|annotation|enum)\\s+(([.A-Z_:\\x{80}-\\x{10FFFF}][.\\w:\\x{80}-\\x{10FFFF}]*(\\(([,\\s.a-zA-Z0-9_:\\x{80}-\\x{10FFFF}]+)\\))?(\\s*(<)\\s*[.:A-Z\\x{80}-\\x{10FFFF}][.:\\w\\x{80}-\\x{10FFFF}]*(\\(([.a-zA-Z0-9_:]+\\s,)\\))?)?)|((<<)\\s*[.A-Z0-9_:\\x{80}-\\x{10FFFF}]+))", "name": "meta.class.crystal" }, { "captures": { "1": { "name": "keyword.control.module.crystal" }, "2": { "name": "entity.name.type.module.crystal" }, "3": { "name": "entity.other.inherited-class.module.first.crystal" }, "4": { "name": "punctuation.separator.inheritance.crystal" }, "5": { "name": "entity.other.inherited-class.module.second.crystal" }, "6": { "name": "punctuation.separator.inheritance.crystal" }, "7": { "name": "entity.other.inherited-class.module.third.crystal" }, "8": { "name": "punctuation.separator.inheritance.crystal" } }, "match": "^\\s*(module)\\s+(([A-Z\\x{80}-\\x{10FFFF}][\\w\\x{80}-\\x{10FFFF}]*(::))?([A-Z\\x{80}-\\x{10FFFF}][\\w\\x{80}-\\x{10FFFF}]*(::))?([A-Z\\x{80}-\\x{10FFFF}][\\w\\x{80}-\\x{10FFFF}]*(::))*[A-Z\\x{80}-\\x{10FFFF}][\\w\\x{80}-\\x{10FFFF}]*)", "name": "meta.module.crystal" }, { "captures": { "1": { "name": "keyword.control.lib.crystal" }, "2": { "name": "entity.name.type.lib.crystal" }, "3": { "name": "entity.other.inherited-class.lib.first.crystal" }, "4": { "name": "punctuation.separator.inheritance.crystal" }, "5": { "name": "entity.other.inherited-class.lib.second.crystal" }, "6": { "name": "punctuation.separator.inheritance.crystal" }, "7": { "name": "entity.other.inherited-class.lib.third.crystal" }, "8": { "name": "punctuation.separator.inheritance.crystal" } }, "match": "^\\s*(lib)\\s+(([A-Z]\\w*(::))?([A-Z]\\w*(::))?([A-Z]\\w*(::))*[A-Z]\\w*)", "name": "meta.lib.crystal" }, { "captures": { "1": { "name": "keyword.control.lib.type.crystal" }, "2": { "name": "entity.name.lib.type.crystal" }, "3": { "name": "keyword.control.lib.crystal" }, "4": { "name": "entity.name.lib.type.value.crystal" } }, "comment": "type in lib", "match": "(?<!\\.)\\b(type)\\s+([A-Z]\\w+)\\s*(=)\\s*(.+)", "name": "meta.lib.type.crystal" }, { "comment": "everything being a reserved word, not a value, and needing a 'end' is a..", "match": "(?<!\\.)\\b(fun|begin|case|class|else|elsif|end|ensure|enum|for|if|macro|module|rescue|struct|then|union|unless|until|when|while)\\b(?![?!:])", "name": "keyword.control.crystal" }, { "comment": "everything being a reserved word, not a value, and not needing a 'end' is a..", "match": "(?<!\\.)\\b(abstract|alias|asm|break|extend|in|include|next|of|private|protected|struct|return|select|super|with|yield)\\b(?![?!:])", "name": "keyword.control.primary.crystal" }, { "comment": "everything being a spec keyword, not a value, and needing a block is a..", "match": "(?<!\\.)\\b(describe|context|it|expect_raises)\\b(?![?!:])", "name": "keyword.control.crystal" }, { "comment": "contextual smart pair support for block parameters", "match": "(?<!\\.)\\bdo\\b\\s*", "name": "keyword.control.start-block.crystal" }, { "comment": "contextual smart pair support", "match": "(?<=\\{)(\\s+)", "name": "meta.syntax.crystal.start-block" }, { "comment": "Just as above but being not a logical operation", "match": "(?<!\\.)\\b(pointerof|typeof|sizeof|instance_sizeof|offsetof|previous_def|forall|out|uninitialized)\\b(?![?!:])|\\.(is_a\\?|nil\\?|responds_to\\?|as\\?|as\b)", "name": "keyword.control.pseudo-method.crystal" }, { "match": "\\bnil\\b(?![?!:])", "name": "constant.language.nil.crystal" }, { "match": "\\b(true|false)\\b(?![?!:])", "name": "constant.language.boolean.crystal" }, { "match": "\\b(__(DIR|FILE|LINE|END_LINE)__)\\b(?![?!:])", "name": "variable.language.crystal" }, { "match": "\\b(self)\\b(?![?!:])", "name": "variable.language.self.crystal" }, { "comment": "https://crystal-lang.org/api/0.36.1/Object.html#macro-summary", "match": "(?<!\\.)\\b(((class_)?((getter|property)\\b[!?]?|setter\\b))|(def_(clone|equals|equals_and_hash|hash)|delegate|forward_missing_to)\\b)(?![?!:])", "name": "support.function.kernel.crystal" }, { "begin": "\\b(require)\\b", "captures": { "1": { "name": "keyword.other.special-method.crystal" } }, "end": "$|(?=#)", "name": "meta.require.crystal", "patterns": [{ "include": "$self" }] }, { "captures": { "1": { "name": "punctuation.definition.variable.crystal" } }, "match": "(@)[a-zA-Z_\\x{80}-\\x{10FFFF}][\\w\\x{80}-\\x{10FFFF}]*[?!=]?", "name": "variable.other.readwrite.instance.crystal" }, { "captures": { "1": { "name": "punctuation.definition.variable.crystal" } }, "match": "(@@)[a-zA-Z_\\x{80}-\\x{10FFFF}][\\w\\x{80}-\\x{10FFFF}]*[?!=]?", "name": "variable.other.readwrite.class.crystal" }, { "captures": { "1": { "name": "punctuation.definition.variable.crystal" } }, "match": "(\\$)[a-zA-Z_]\\w*", "name": "variable.other.readwrite.global.crystal" }, { "captures": { "1": { "name": "punctuation.definition.variable.crystal" } }, "match": "(?!%[Qxrqwi]?[\\(\\[\\{\\<\\|])%([a-zA-Z_]\\w*\\.)*[a-zA-Z_]\\w*", "name": "variable.other.readwrite.fresh.crystal" }, { "captures": { "1": { "name": "punctuation.definition.variable.crystal" } }, "match": "(\\$)(!|@|&|`|'|\\+|\\d+|~|=|/|\\\\|,|;|\\.|<|>|_|\\*|\\$|\\?|:|\"|-[0adFiIlpv])", "name": "variable.other.readwrite.global.pre-defined.crystal" }, { "begin": "\\b(ENV)\\[", "beginCaptures": { "1": { "name": "variable.other.constant.crystal" } }, "end": "\\]", "name": "meta.environment-variable.crystal", "patterns": [{ "include": "$self" }] }, { "comment": "Literals name of Crystal", "match": "\\b[A-Z\\x{80}-\\x{10FFFF}][\\w\\x{80}-\\x{10FFFF}]*", "name": "support.class.crystal" }, { "comment": "Fetch from https://crystal-lang.org/api/0.36.1/toplevel.html", "match": "(?<!\\.)\\b(abort|at_exit|caller|exit|gets|loop|main|p|pp|print|printf|puts|raise|rand|read_line|sleep|spawn|sprintf|system|debugger|record|spawn)\\b(?![?!:])", "name": "support.function.kernel.crystal" }, { "comment": "Constant name in any where", "match": "\\b[_A-Z]+\\b", "name": "variable.other.constant.crystal" }, { "begin": "(?x)\n(?=def\\b)\n(?<=^|\\s)(def)\\s+\n(\n(?>[a-zA-Z_]\\w*(?>\\.|::))?\n(?>\n[a-zA-Z_]\\w*(?>[?!]|=(?!>))?\n|\n\\^|===?|!=|>[>=]?|<=>|<[<=]?|[%&`/\\|]|\\*\\*?|=?~|[-+]@?|\\[][?=]?|\\[]=?\n)\n)\n\\s*(\\()", "beginCaptures": { "1": { "name": "keyword.control.def.crystal" }, "2": { "name": "entity.name.function.crystal" }, "3": { "name": "punctuation.definition.parameters.crystal" } }, "comment": "The method pattern comes from the symbol pattern. See there for an explanation.", "end": "\\)", "endCaptures": { "0": { "name": "punctuation.definition.parameters.crystal" } }, "name": "meta.function.method.with-arguments.crystal", "patterns": [{ "begin": "(?![\\s,)])", "end": "(?=,|\\)\\s*)", "patterns": [{ "captures": { "1": { "name": "storage.type.variable.crystal" }, "2": { "name": "constant.other.symbol.hashkey.parameter.function.crystal" }, "3": { "name": "punctuation.definition.constant.hashkey.crystal" }, "4": { "name": "variable.parameter.function.crystal" } }, "match": "\\G([&*]?)(?:([_a-zA-Z]\\w*(:))|([_a-zA-Z]\\w*))" }, { "include": "$self" }] }] }, { "captures": { "1": { "name": "keyword.control.def.crystal" }, "3": { "name": "entity.name.function.crystal" } }, "comment": " the optional name is just to catch the def also without a method-name", "match": "(?x)\n(?=def\\b)\n(?<=^|\\s)(def)\\b\n(\n\\s+\n(\n(?>[a-zA-Z_]\\w*(?>\\.|::))?\n(?>\n[a-zA-Z_]\\w*(?>[?!]|=(?!>))?\n|\n\\^|===?|!=|>[>=]?|<=>|<[<=]?|[%&`/\\|]|\\*\\*?|=?~|[-+]@?|\\[][?=]?|\\[]=?\n)\n)\n)?", "name": "meta.function.method.without-arguments.crystal" }, { "comment": "Floating point literal (fraction)", "match": "\\b[0-9][0-9_]*\\.[0-9][0-9_]*([eE][+-]?[0-9_]+)?(f32|f64)?\\b", "name": "constant.numeric.float.crystal" }, { "comment": "Floating point literal (exponent)", "match": "\\b[0-9][0-9_]*(\\.[0-9][0-9_]*)?[eE][+-]?[0-9_]+(f32|f64)?\\b", "name": "constant.numeric.float.crystal" }, { "comment": "Floating point literal (typed)", "match": "\\b[0-9][0-9_]*(\\.[0-9][0-9_]*)?([eE][+-]?[0-9_]+)?(f32|f64)\\b", "name": "constant.numeric.float.crystal" }, { "comment": "Integer literal (decimal)", "match": "\\b(?!0[0-9])[0-9][0-9_]*([ui](8|16|32|64|128))?\\b", "name": "constant.numeric.integer.decimal.crystal" }, { "comment": "Integer literal (hexadecimal)", "match": "\\b0x[a-fA-F0-9_]+([ui](8|16|32|64|128))?\\b", "name": "constant.numeric.integer.hexadecimal.crystal" }, { "comment": "Integer literal (octal)", "match": "\\b0o[0-7_]+([ui](8|16|32|64|128))?\\b", "name": "constant.numeric.integer.octal.crystal" }, { "comment": "Integer literal (binary)", "match": "\\b0b[01_]+([ui](8|16|32|64|128))?\\b", "name": "constant.numeric.integer.binary.crystal" }, { "begin": ":'", "beginCaptures": { "0": { "name": "punctuation.definition.symbol.begin.crystal" } }, "comment": "symbol literal with '' delimiter", "end": "'", "endCaptures": { "0": { "name": "punctuation.definition.symbol.end.crystal" } }, "name": "constant.other.symbol.crystal", "patterns": [{ "match": "\\\\['\\\\]", "name": "constant.character.escape.crystal" }] }, { "begin": ':"', "beginCaptures": { "0": { "name": "punctuation.section.symbol.begin.crystal" } }, "comment": 'symbol literal with "" delimiter', "end": '"', "endCaptures": { "0": { "name": "punctuation.section.symbol.end.crystal" } }, "name": "constant.other.symbol.interpolated.crystal", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "comment": "Needs higher precedence than regular expressions.", "match": "(?<!\\()/=", "name": "keyword.operator.assignment.augmented.crystal" }, { "begin": "'", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "string literal with '' delimiter", "end": "'", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.quoted.single.crystal", "patterns": [{ "match": "\\\\'|\\\\\\\\", "name": "constant.character.escape.crystal" }] }, { "begin": '"', "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": 'string literal with interpolation and "" delimiter', "end": '"', "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.quoted.double.interpolated.crystal", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "`", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "execute string (allows for interpolation)", "end": "`", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.interpolated.crystal", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "%x\\{", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "execute string (allow for interpolation)", "end": "\\}", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.interpolated.crystal", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_curly_i" }] }, { "begin": "%x\\[", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "execute string (allow for interpolation)", "end": "\\]", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.interpolated.crystal", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_brackets_i" }] }, { "begin": "%x\\<", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "execute string (allow for interpolation)", "end": "\\>", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.interpolated.crystal", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_ltgt_i" }] }, { "begin": "%x\\(", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "execute string (allow for interpolation)", "end": "\\)", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.interpolated.crystal", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_parens_i" }] }, { "begin": "%x\\|", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "execute string (allow for interpolation)", "end": "\\|", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.interpolated.crystal", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "(?x) (?: ^| (?<=[=>~(?:\\[,|&;] | [\\s;]if\\s| [\\s;]elsif\\s | [\\s;]while\\s | [\\s;]unless\\s | [\\s;]when\\s | [\\s;]assert_match\\s | [\\s;]or\\s| [\\s;]and\\s | [\\s;]not\\s | [\\s.]index\\s| [\\s.]scan\\s | [\\s.]sub\\s | [\\s.]sub!\\s | [\\s.]gsub\\s | [\\s.]gsub!\\s | [\\s.]match\\s ) | (?<=^when\\s| ^if\\s | ^elsif\\s | ^while\\s | ^unless\\s ) ) \\s*((/))(?![*+{}?])", "captures": { "1": { "name": "string.regexp.classic.crystal" }, "2": { "name": "punctuation.definition.string.crystal" } }, "comment": "regular expressions (normal) we only start a regexp if the character before it (excluding whitespace) is what we think is before a regexp", "contentName": "string.regexp.classic.crystal", "end": "((/[imsx]*))", "patterns": [{ "include": "#regex_sub" }] }, { "begin": "%r\\{", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "regular expressions (literal)", "end": "\\}[imsx]*", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.regexp.mod-r.crystal", "patterns": [{ "include": "#regex_sub" }, { "include": "#nest_curly_r" }] }, { "begin": "%r\\[", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "regular expressions (literal)", "end": "\\][imsx]*", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.regexp.mod-r.crystal", "patterns": [{ "include": "#regex_sub" }, { "include": "#nest_brackets_r" }] }, { "begin": "%r\\(", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "regular expressions (literal)", "end": "\\)[imsx]*", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.regexp.mod-r.crystal", "patterns": [{ "include": "#regex_sub" }, { "include": "#nest_parens_r" }] }, { "begin": "%r\\<", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "regular expressions (literal)", "end": "\\>[imsx]*", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.regexp.mod-r.crystal", "patterns": [{ "include": "#regex_sub" }, { "include": "#nest_ltgt_r" }] }, { "begin": "%r\\|", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "regular expressions (literal)", "end": "\\|[imsx]*", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.regexp.mod-r.crystal", "patterns": [{ "include": "#regex_sub" }] }, { "begin": "%Q?\\(", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "literal capable of interpolation ()", "end": "\\)", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.quoted.other.literal.upper.crystal", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_parens_i" }] }, { "begin": "%Q?\\[", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "literal capable of interpolation []", "end": "\\]", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.quoted.other.literal.upper.crystal", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_brackets_i" }] }, { "begin": "%Q?\\<", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "literal capable of interpolation <>", "end": "\\>", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.quoted.other.literal.upper.crystal", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_ltgt_i" }] }, { "begin": "%Q?\\{", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "literal capable of interpolation -- {}", "end": "\\}", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.quoted.double.crystal.mod", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_curly_i" }] }, { "begin": "%Q\\|", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "literal capable of interpolation -- ||", "end": "\\|", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.quoted.other.literal.upper.crystal", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "%[qwi]\\(", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "literal incapable of interpolation -- ()", "end": "\\)", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.quoted.other.literal.lower.crystal", "patterns": [{ "match": "\\\\\\)|\\\\\\\\", "name": "constant.character.escape.crystal" }, { "include": "#nest_parens" }] }, { "begin": "%[qwi]\\<", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "literal incapable of interpolation -- <>", "end": "\\>", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.quoted.other.literal.lower.crystal", "patterns": [{ "match": "\\\\\\>|\\\\\\\\", "name": "constant.character.escape.crystal" }, { "include": "#nest_ltgt" }] }, { "begin": "%[qwi]\\[", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "literal incapable of interpolation -- []", "end": "\\]", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.quoted.other.literal.lower.crystal", "patterns": [{ "match": "\\\\\\]|\\\\\\\\", "name": "constant.character.escape.crystal" }, { "include": "#nest_brackets" }] }, { "begin": "%[qwi]\\{", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "literal incapable of interpolation -- {}", "end": "\\}", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.quoted.other.literal.lower.crystal", "patterns": [{ "match": "\\\\\\}|\\\\\\\\", "name": "constant.character.escape.crystal" }, { "include": "#nest_curly" }] }, { "begin": "%[qwi]\\|", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "literal incapable of interpolation -- ||", "end": "\\|", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.quoted.other.literal.lower.crystal", "patterns": [{ "comment": "Cant be named because its not necessarily an escape.", "match": "\\\\." }] }, { "captures": { "1": { "name": "punctuation.definition.constant.crystal" } }, "comment": "symbols", "match": "(?<!:)(:)(?>[a-zA-Z_\\x{80}-\\x{10FFFF}][\\w\\x{80}-\\x{10FFFF}]*(?>[?!]|=(?![>=]))?|===?|>[>=]?|<[<=]?|<=>|[%&`/\\|]|\\*\\*?|=?~|[-+]@?|\\[\\][?=]?|@@?[a-zA-Z_\\x{80}-\\x{10FFFF}][\\w\\x{80}-\\x{10FFFF}]*)", "name": "constant.other.symbol.crystal" }, { "captures": { "1": { "name": "punctuation.definition.constant.crystal" } }, "comment": "symbols", "match": "(?>[a-zA-Z_\\x{80}-\\x{10FFFF}][\\w\\x{80}-\\x{10FFFF}]*(?>[?!])?)(:)(?!:)", "name": "constant.other.symbol.crystal.19syntax" }, { "captures": { "1": { "name": "punctuation.definition.comment.crystal" } }, "match": "(?:^[ \\t]+)?(#).*$\\n?", "name": "comment.line.number-sign.crystal" }, { "match": "(?<!}})\\b_([\\w]+[?!]?)\\b(?!\\()", "name": "comment.unused.crystal" }, { "begin": "(?><<-('?)((?:[_\\w]+_|)HTML)\\b\\1)", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "heredoc with embedded HTML and indented terminator", "contentName": "text.html.embedded.crystal", "end": "\\s*\\2\\b", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.unquoted.embedded.html.crystal", "patterns": [{ "include": "#heredoc" }, { "include": "text.html.basic" }, { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "(?><<-('?)((?:[_\\w]+_|)SQL)\\b\\1)", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "heredoc with embedded SQL and indented terminator", "contentName": "text.sql.embedded.crystal", "end": "\\s*\\2\\b", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.unquoted.embedded.sql.crystal", "patterns": [{ "include": "#heredoc" }, { "include": "source.sql" }, { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "(?><<-('?)((?:[_\\w]+_|)CSS)\\b\\1)", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "heredoc with embedded css and intented terminator", "contentName": "text.css.embedded.crystal", "end": "\\s*\\2\\b", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.unquoted.embedded.css.crystal", "patterns": [{ "include": "#heredoc" }, { "include": "source.css" }, { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "(?><<-('?)((?:[_\\w]+_|)CPP)\\b\\1)", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "heredoc with embedded c++ and intented terminator", "contentName": "text.c++.embedded.crystal", "end": "\\s*\\2\\b", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.unquoted.embedded.cplusplus.crystal", "patterns": [{ "include": "#heredoc" }, { "include": "source.c++" }, { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "(?><<-('?)((?:[_\\w]+_|)C)\\b\\1)", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "heredoc with embedded c++ and intented terminator", "contentName": "text.c.embedded.crystal", "end": "\\s*\\2\\b", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.unquoted.embedded.c.crystal", "patterns": [{ "include": "#heredoc" }, { "include": "source.c" }, { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "(?><<-('?)((?:[_\\w]+_|)(?:JS|JAVASCRIPT))\\b\\1)", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "heredoc with embedded javascript and intented terminator", "contentName": "text.js.embedded.crystal", "end": "\\s*\\2\\b", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.unquoted.embedded.js.crystal", "patterns": [{ "include": "#heredoc" }, { "include": "source.js" }, { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "(?><<-('?)((?:[_\\w]+_|)JQUERY)\\b\\1)", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "heredoc with embedded javascript and intented terminator", "contentName": "text.js.jquery.embedded.crystal", "end": "\\s*\\2\\b", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.unquoted.embedded.js.jquery.crystal", "patterns": [{ "include": "#heredoc" }, { "include": "source.js.jquery" }, { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "(?><<-('?)((?:[_\\w]+_|)(?:SH|SHELL))\\b\\1)", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "heredoc with embedded shell and intented terminator", "contentName": "text.shell.embedded.crystal", "end": "\\s*\\2\\b", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.unquoted.embedded.shell.crystal", "patterns": [{ "include": "#heredoc" }, { "include": "source.shell" }, { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "(?><<-('?)((?:[_\\w]+_|)CRYSTAL)\\b\\1)", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "heredoc with embedded crystal and intented terminator", "contentName": "text.crystal.embedded.crystal", "end": "\\s*\\2\\b", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.unquoted.embedded.crystal.crystal", "patterns": [{ "include": "#heredoc" }, { "include": "source.crystal" }, { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "(?><<-'(\\w+)')", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "heredoc with indented terminator", "end": "\\s*\\1\\b", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.unquoted.heredoc.crystal", "patterns": [{ "include": "#heredoc" }, { "include": "#escaped_char" }] }, { "begin": "(?><<-(\\w+)\\b)", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.crystal" } }, "comment": "heredoc with indented terminator", "end": "\\s*\\1\\b", "endCaptures": { "0": { "name": "punctuation.definition.string.end.crystal" } }, "name": "string.unquoted.heredoc.crystal", "patterns": [{ "include": "#heredoc" }, { "include": "#interpolated_crystal" }, { "include": "#escaped_char" }] }, { "begin": "(?<={|{\\s|[^A-Za-z0-9_]do|^do|[^A-Za-z0-9_]do\\s|^do\\s)(\\|)", "captures": { "1": { "name": "punctuation.separator.variable.crystal" } }, "end": "(?<!\\|)(\\|)(?!\\|)", "patterns": [{ "include": "source.crystal" }, { "match": "[_a-zA-Z][_a-zA-Z0-9]*", "name": "variable.other.block.crystal" }, { "match": ",", "name": "punctuation.separator.variable.crystal" }] }, { "match": "=>", "name": "punctuation.separator.key-value" }, { "match": "->", "name": "support.function.kernel.crystal" }, { "match": "<<=|%=|&{1,2}=|\\*=|\\*\\*=|\\+=|-=|\\^=|\\|{1,2}=|<<", "name": "keyword.operator.assignment.augmented.crystal" }, { "match": "<=>|<(?!<|=)|>(?!<|=|>)|<=|>=|===|==|=~|!=|!~|(?<=[ \\t])\\?", "name": "keyword.operator.comparison.crystal" }, { "match": "(?<=^|[ \\t])!|&&|\\|\\||\\^", "name": "keyword.operator.logical.crystal" }, { "match": "(\\{\\%|\\%\\}|\\{\\{|\\}\\})", "name": "keyword.operator.macro.crystal" }, { "captures": { "1": { "name": "punctuation.separator.method.crystal" } }, "comment": "Safe navigation operator", "match": "(&\\.)\\s*(?![A-Z])" }, { "match": "(%|&|\\*\\*|\\*|\\+|\\-|/)", "name": "keyword.operator.arithmetic.crystal" }, { "match": "=", "name": "keyword.operator.assignment.crystal" }, { "match": "\\||~|>>", "name": "keyword.operator.other.crystal" }, { "match": ":", "name": "punctuation.separator.other.crystal" }, { "match": "\\;", "name": "punctuation.separator.statement.crystal" }, { "match": ",", "name": "punctuation.separator.object.crystal" }, { "match": "\\.|::", "name": "punctuation.separator.method.crystal" }, { "match": "\\{|\\}", "name": "punctuation.section.scope.crystal" }, { "match": "\\[|\\]", "name": "punctuation.section.array.crystal" }, { "match": "\\(|\\)", "name": "punctuation.section.function.crystal" }, { "begin": "(?=[a-zA-Z0-9_!?]+\\()", "end": "(?<=\\))", "name": "meta.function-call.crystal", "patterns": [{ "match": "([a-zA-Z0-9_!?]+)(?=\\()", "name": "entity.name.function.crystal" }, { "include": "$self" }] }, { "comment": "This is kindof experimental. There really is no way to perfectly match all regular variables, but you can pretty well assume that any normal word in certain curcumstances that havnt already been scoped as something else are probably variables, and the advantages beat the potential errors", "match": "((?<=\\W)\\b|^)\\w+\\b(?=\\s*([\\]\\)\\}\\=\\+\\-\\*\\/\\^\\$\\,\\.]|<\\s|<<[\\s|\\.]))", "name": "variable.other.crystal" }], "repository": { "escaped_char": { "comment": "https://crystal-lang.org/reference/syntax_and_semantics/literals/string.html", "match": "\\\\(?:[0-7]{1,3}|x[a-fA-F0-9]{2}|u[a-fA-F0-9]{4}|u\\{[a-fA-F0-9 ]+\\}|.)", "name": "constant.character.escape.crystal" }, "heredoc": { "begin": "^<<-?\\w+", "end": "$", "patterns": [{ "include": "$self" }] }, "interpolated_crystal": { "patterns": [{ "begin": "#\\{", "beginCaptures": { "0": { "name": "punctuation.section.embedded.begin.crystal" } }, "contentName": "source.crystal", "end": "(\\})", "endCaptures": { "0": { "name": "punctuation.section.embedded.end.crystal" }, "1": { "name": "source.crystal" } }, "name": "meta.embedded.line.crystal", "patterns": [{ "include": "#nest_curly_and_self" }, { "include": "$self" }], "repository": { "nest_curly_and_self": { "patterns": [{ "begin": "\\{", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\}", "patterns": [{ "include": "#nest_curly_and_self" }] }, { "include": "$self" }] } } }, { "captures": { "1": { "name": "punctuation.definition.variable.crystal" } }, "match": "(#@)[a-zA-Z_]\\w*", "name": "variable.other.readwrite.instance.crystal" }, { "captures": { "1": { "name": "punctuation.definition.variable.crystal" } }, "match": "(#@@)[a-zA-Z_]\\w*", "name": "variable.other.readwrite.class.crystal" }, { "captures": { "1": { "name": "punctuation.definition.variable.crystal" } }, "match": "(#\\$)[a-zA-Z_]\\w*", "name": "variable.other.readwrite.global.crystal" }] }, "nest_brackets": { "begin": "\\[", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\]", "patterns": [{ "include": "#nest_brackets" }] }, "nest_brackets_i": { "begin": "\\[", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\]", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_brackets_i" }] }, "nest_brackets_r": { "begin": "\\[", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\]", "patterns": [{ "include": "#regex_sub" }, { "include": "#nest_brackets_r" }] }, "nest_curly": { "begin": "\\{", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\}", "patterns": [{ "include": "#nest_curly" }] }, "nest_curly_and_self": { "patterns": [{ "begin": "\\{", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\}", "patterns": [{ "include": "#nest_curly_and_self" }] }, { "include": "$self" }] }, "nest_curly_i": { "begin": "\\{", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\}", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_curly_i" }] }, "nest_curly_r": { "begin": "\\{", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\}", "patterns": [{ "include": "#regex_sub" }, { "include": "#nest_curly_r" }] }, "nest_ltgt": { "begin": "\\<", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\>", "patterns": [{ "include": "#nest_ltgt" }] }, "nest_ltgt_i": { "begin": "\\<", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\>", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_ltgt_i" }] }, "nest_ltgt_r": { "begin": "\\<", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\>", "patterns": [{ "include": "#regex_sub" }, { "include": "#nest_ltgt_r" }] }, "nest_parens": { "begin": "\\(", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\)", "patterns": [{ "include": "#nest_parens" }] }, "nest_parens_i": { "begin": "\\(", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\)", "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "include": "#nest_parens_i" }] }, "nest_parens_r": { "begin": "\\(", "captures": { "0": { "name": "punctuation.section.scope.crystal" } }, "end": "\\)", "patterns": [{ "include": "#regex_sub" }, { "include": "#nest_parens_r" }] }, "regex_sub": { "patterns": [{ "include": "#interpolated_crystal" }, { "include": "#escaped_char" }, { "captures": { "1": { "name": "punctuation.definition.arbitrary-repetition.crystal" }, "3": { "name": "punctuation.definition.arbitrary-repetition.crystal" } }, "match": "({)\\d+(,\\d+)?(})", "name": "string.regexp.arbitrary-repetition.crystal" }, { "begin": "\\[(?:\\^?])?", "captures": { "0": { "name": "punctuation.definition.character-class.crystal" } }, "end": "]", "name": "string.regexp.character-class.crystal", "patterns": [{ "include": "#escaped_char" }] }, { "begin": "\\(", "captures": { "0": { "name": "punctuation.definition.group.crystal" } }, "end": "\\)", "name": "string.regexp.group.crystal", "patterns": [{ "include": "#regex_sub" }] }, { "captures": { "1": { "name": "punctuation.definition.comment.crystal" } }, "comment": "We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.", "match": "(?<=^|\\s)(#)\\s[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$", "name": "comment.line.number-sign.crystal" }] } }, "scopeName": "source.crystal", "embeddedLangs": ["html", "sql", "css", "c", "javascript", "shellscript"] });
|
|
9
9
|
var crystal = [
|
|
10
10
|
...html,
|
|
11
11
|
...sql,
|