site/node_modules/shiki/dist/langs/csharp.mjs

11 lines
91 KiB
JavaScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
const lang = Object.freeze({ "displayName": "C#", "name": "csharp", "patterns": [{ "include": "#preprocessor" }, { "include": "#comment" }, { "include": "#directives" }, { "include": "#declarations" }, { "include": "#script-top-level" }], "repository": { "accessor-getter": { "patterns": [{ "begin": "\\{", "beginCaptures": { "0": { "name": "punctuation.curlybrace.open.cs" } }, "contentName": "meta.accessor.getter.cs", "end": "\\}", "endCaptures": { "0": { "name": "punctuation.curlybrace.close.cs" } }, "patterns": [{ "include": "#statement" }] }, { "include": "#accessor-getter-expression" }, { "include": "#punctuation-semicolon" }] }, "accessor-getter-expression": { "begin": "=>", "beginCaptures": { "0": { "name": "keyword.operator.arrow.cs" } }, "contentName": "meta.accessor.getter.cs", "end": "(?=;|\\})", "patterns": [{ "include": "#ref-modifier" }, { "include": "#expression" }] }, "accessor-setter": { "patterns": [{ "begin": "\\{", "beginCaptures": { "0": { "name": "punctuation.curlybrace.open.cs" } }, "contentName": "meta.accessor.setter.cs", "end": "\\}", "endCaptures": { "0": { "name": "punctuation.curlybrace.close.cs" } }, "patterns": [{ "include": "#statement" }] }, { "begin": "=>", "beginCaptures": { "0": { "name": "keyword.operator.arrow.cs" } }, "contentName": "meta.accessor.setter.cs", "end": "(?=;|\\})", "patterns": [{ "include": "#ref-modifier" }, { "include": "#expression" }] }, { "include": "#punctuation-semicolon" }] }, "anonymous-method-expression": { "patterns": [{ "begin": "(?x)\n((?:\\b(?:async|static)\\b\\s*)*)\n(?:\n(@?[_[:alpha:]][_[:alnum:]]*)\\b|\n(\\()\n(?<tuple>(?:[^()]|\\(\\g<tuple>\\))*)\n(\\))\n)\\s*\n(=>)", "beginCaptures": { "1": { "patterns": [{ "match": "async|static", "name": "storage.modifier.$0.cs" }] }, "2": { "name": "entity.name.variable.parameter.cs" }, "3": { "name": "punctuation.parenthesis.open.cs" }, "4": { "patterns": [{ "include": "#comment" }, { "include": "#explicit-anonymous-function-parameter" }, { "include": "#implicit-anonymous-function-parameter" }, { "include": "#default-argument" }, { "include": "#punctuation-comma" }] }, "5": { "name": "punctuation.parenthesis.close.cs" }, "6": { "name": "keyword.operator.arrow.cs" } }, "end": "(?=[,;)}])", "patterns": [{ "include": "#intrusive" }, { "begin": "(?={)", "end": "(?=[,;)}])", "patterns": [{ "include": "#block" }, { "include": "#intrusive" }] }, { "begin": "\\b(ref)\\b|(?=\\S)", "beginCaptures": { "1": { "name": "storage.modifier.ref.cs" } }, "end": "(?=[,;)}])", "patterns": [{ "include": "#expression" }] }] }, { "begin": "(?x)\n((?:\\b(?:async|static)\\b\\s*)*)\n\\b(delegate)\\b\\s*", "beginCaptures": { "1": { "patterns": [{ "match": "async|static", "name": "storage.modifier.$0.cs" }] }, "2": { "name": "storage.type.delegate.cs" } }, "end": "(?<=})|(?=[,;)}])", "patterns": [{ "include": "#intrusive" }, { "begin": "\\(", "beginCaptures": { "0": { "name": "punctuation.parenthesis.open.cs" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.parenthesis.close.cs" } }, "patterns": [{ "include": "#intrusive" }, { "include": "#explicit-anonymous-function-parameter" }, { "include": "#punctuation-comma" }] }, { "include": "#block" }] }] }, "anonymous-object-creation-expression": { "begin": "\\b(new)\\b\\s*(?=\\{|//|/\\*|$)", "beginCaptures": { "1": { "name": "keyword.operator.expression.new.cs" } }, "end": "(?<=\\})", "patterns": [{ "include": "#comment" }, { "include": "#initializer-expression" }] }, "argument": { "patterns": [{ "match": "\\b(ref|in)\\b", "name": "storage.modifier.$1.cs" }, { "begin": "\\b(out)\\b", "beginCaptures": { "1": { "name": "storage.modifier.out.cs" } }, "end": "(?=,|\\)|\\])", "patterns": [{ "include": "#declaration-expression-local" }, { "include": "#expression" }] }, { "include": "#expression" }] }, "argument-list": { "begin": "\\(", "beginCaptures": { "0": { "name": "punctuation.parenthesis.open.cs" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.parenthesis.close.cs" } }, "patterns": [{ "include": "#named-argument" }, { "include": "#argument" }, { "include": "#punctuat
(\\()
([\\s.:@_[:alnum:]]+)
(\\))
(?=[\\s+\\-!~]*@?[_[:alnum:]('"]+)`, "beginCaptures": { "1": { "name": "punctuation.parenthesis.open.cs" }, "2": { "patterns": [{ "include": "#type-builtin" }, { "include": "#type-name" }] }, "3": { "name": "punctuation.parenthesis.close.cs" } }, "end": "(?=[)}\\],;:?=&|^]|!=|\\b(and|or|when)\\b)", "patterns": [{ "include": "#casted-constant-pattern" }, { "begin": "\\(", "beginCaptures": { "0": { "name": "punctuation.parenthesis.open.cs" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.parenthesis.close.cs" } }, "patterns": [{ "include": "#constant-pattern" }] }, { "include": "#constant-pattern" }, { "captures": { "1": { "name": "entity.name.type.alias.cs" }, "2": { "name": "punctuation.separator.coloncolon.cs" } }, "match": "(@?[_[:alpha:]][_[:alnum:]]*)\\s*(\\:\\:)" }, { "captures": { "1": { "name": "entity.name.type.cs" }, "2": { "name": "punctuation.accessor.cs" } }, "match": "(@?[_[:alpha:]][_[:alnum:]]*)\\s*(\\.)" }, { "match": "\\@?[_[:alpha:]][_[:alnum:]]*", "name": "variable.other.constant.cs" }] }, "catch-clause": { "begin": "(?<!\\.)\\b(catch)\\b", "beginCaptures": { "1": { "name": "keyword.control.exception.catch.cs" } }, "end": "(?<=\\})", "patterns": [{ "begin": "\\(", "beginCaptures": { "0": { "name": "punctuation.parenthesis.open.cs" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.parenthesis.close.cs" } }, "patterns": [{ "captures": { "1": { "patterns": [{ "include": "#type" }] }, "6": { "name": "entity.name.variable.local.cs" } }, "match": "(?x)\n(?<type_name>\n(?:\n(?:\n(?:(?<identifier>@?[_[:alpha:]][_[:alnum:]]*)\\s*\\:\\:\\s*)?\n(?<name_and_type_args>\n\\g<identifier>\\s*\n(?<type_args>\\s*<(?:[^<>]|\\g<type_args>)+>\\s*)?\n)\n(?:\\s*\\.\\s*\\g<name_and_type_args>)* |\n(?<tuple>\\s*\\((?:[^\\(\\)]|\\g<tuple>)+\\))\n)\n(?:\\s*\\?\\s*)?\n(?:\\s*\n\\[\n(?:\\s*,\\s*)*\n\\]\n\\s*\n(?:\\?)?\n\\s*\n)*\n)\n)\\s*\n(?:(\\g<identifier>)\\b)?" }] }, { "include": "#when-clause" }, { "include": "#comment" }, { "include": "#block" }] }, "char-character-escape": { "match": "\\\\(x[0-9a-fA-F]{1,4}|u[0-9a-fA-F]{4}|.)", "name": "constant.character.escape.cs" }, "char-literal": { "begin": "'", "beginCaptures": { "0": { "name": "punctuation.definition.char.begin.cs" } }, "end": "(\\')|((?:[^\\\\\\n])$)", "endCaptures": { "1": { "name": "punctuation.definition.char.end.cs" }, "2": { "name": "invalid.illegal.newline.cs" } }, "name": "string.quoted.single.cs", "patterns": [{ "include": "#char-character-escape" }] }, "class-declaration": { "begin": "(?=(\\brecord\\b\\s+)?\\bclass\\b)", "end": "(?<=\\})|(?=;)", "patterns": [{ "begin": "(?x)\n(\\b(record)\\b\\s+)?\n\\b(class)\\b\\s+\n(@?[_[:alpha:]][_[:alnum:]]*)\\s*", "beginCaptures": { "2": { "name": "storage.type.record.cs" }, "3": { "name": "storage.type.class.cs" }, "4": { "name": "entity.name.type.class.cs" } }, "end": "(?=\\{)|(?=;)", "patterns": [{ "include": "#comment" }, { "include": "#type-parameter-list" }, { "include": "#parenthesized-parameter-list" }, { "include": "#base-types" }, { "include": "#generic-constraints" }] }, { "begin": "\\{", "beginCaptures": { "0": { "name": "punctuation.curlybrace.open.cs" } }, "end": "\\}", "endCaptures": { "0": { "name": "punctuation.curlybrace.close.cs" } }, "patterns": [{ "include": "#class-or-struct-members" }] }, { "include": "#preprocessor" }, { "include": "#comment" }] }, "class-or-struct-members": { "patterns": [{ "include": "#preprocessor" }, { "include": "#comment" }, { "include": "#storage-modifier" }, { "include": "#type-declarations" }, { "include": "#property-declaration" }, { "include": "#field-declaration" }, { "include": "#event-declaration" }, { "include": "#indexer-declaration" }, { "include": "#variable-initializer" }, { "include": "#constructor-declaration" }, { "include": "#destructor-declaration" }, { "include": "#operator-declaration" }, { "include": "#conversion-operator-declaration" }, { "include": "#method-declaration" }, { "include": "#attribute-section" }, { "include": "#punctuation-semicolon" }] }, "combinator-pattern": { "match": "\\b(and|or|not)\\b", "name": "keywo
var csharp = [
lang
];
export { csharp as default };