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

16 lines
28 KiB
JavaScript
Raw Normal View History

2024-10-14 06:09:33 +00:00
import javascript from './javascript.mjs';
const lang = Object.freeze({ "displayName": "CoffeeScript", "name": "coffee", "patterns": [{ "include": "#jsx" }, { "captures": { "1": { "name": "keyword.operator.new.coffee" }, "2": { "name": "storage.type.class.coffee" }, "3": { "name": "entity.name.type.instance.coffee" }, "4": { "name": "entity.name.type.instance.coffee" } }, "match": "(new)\\s+(?:(?:(class)\\s+(\\w+(?:\\.\\w*)*)?)|(\\w+(?:\\.\\w*)*))", "name": "meta.class.instance.constructor.coffee" }, { "begin": "'''", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.coffee" } }, "end": "'''", "endCaptures": { "0": { "name": "punctuation.definition.string.end.coffee" } }, "name": "string.quoted.single.heredoc.coffee", "patterns": [{ "captures": { "1": { "name": "punctuation.definition.escape.backslash.coffee" } }, "match": "(\\\\).", "name": "constant.character.escape.backslash.coffee" }] }, { "begin": '"""', "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.coffee" } }, "end": '"""', "endCaptures": { "0": { "name": "punctuation.definition.string.end.coffee" } }, "name": "string.quoted.double.heredoc.coffee", "patterns": [{ "captures": { "1": { "name": "punctuation.definition.escape.backslash.coffee" } }, "match": "(\\\\).", "name": "constant.character.escape.backslash.coffee" }, { "include": "#interpolated_coffee" }] }, { "captures": { "1": { "name": "punctuation.definition.string.begin.coffee" }, "2": { "name": "source.js.embedded.coffee", "patterns": [{ "include": "source.js" }] }, "3": { "name": "punctuation.definition.string.end.coffee" } }, "match": "(`)(.*)(`)", "name": "string.quoted.script.coffee" }, { "begin": "(?<!#)###(?!#)", "beginCaptures": { "0": { "name": "punctuation.definition.comment.coffee" } }, "end": "###", "endCaptures": { "0": { "name": "punctuation.definition.comment.coffee" } }, "name": "comment.block.coffee", "patterns": [{ "match": "(?<=^|\\s)@\\w*(?=\\s)", "name": "storage.type.annotation.coffee" }] }, { "begin": "#", "beginCaptures": { "0": { "name": "punctuation.definition.comment.coffee" } }, "end": "$", "name": "comment.line.number-sign.coffee" }, { "begin": "///", "beginCaptures": { "0": { "name": "punctuation.definition.string.begin.coffee" } }, "end": "(///)[gimuy]*", "endCaptures": { "1": { "name": "punctuation.definition.string.end.coffee" } }, "name": "string.regexp.multiline.coffee", "patterns": [{ "include": "#heregexp" }] }, { "begin": "(?<![\\w$])(/)(?=(?![/*+?])(.+)(/)[gimuy]*(?!\\s*[\\w$/(]))", "beginCaptures": { "1": { "name": "punctuation.definition.string.begin.coffee" } }, "end": "(/)[gimuy]*(?!\\s*[\\w$/(])", "endCaptures": { "1": { "name": "punctuation.definition.string.end.coffee" } }, "name": "string.regexp.coffee", "patterns": [{ "include": "source.js.regexp" }] }, { "match": "\\b(?<![\\.\\$])(break|by|catch|continue|else|finally|for|in|of|if|return|switch|then|throw|try|unless|when|while|until|loop|do|export|import|default|from|as|yield|async|await|(?<=for)\\s+own)(?!\\s*:)\\b", "name": "keyword.control.coffee" }, { "match": "\\b(?<![\\.\\$])(delete|instanceof|new|typeof)(?!\\s*:)\\b", "name": "keyword.operator.$1.coffee" }, { "match": "\\b(?<![\\.\\$])(case|function|var|void|with|const|let|enum|native|__hasProp|__extends|__slice|__bind|__indexOf|implements|interface|package|private|protected|public|static)(?!\\s*:)\\b", "name": "keyword.reserved.coffee" }, { "begin": "(?x)\n(?<=\\s|^)((@)?[a-zA-Z_$][\\w$]*)\n\\s*([:=])\\s*\n(?=(\\([^\\(\\)]*\\)\\s*)?[=-]>)", "beginCaptures": { "1": { "name": "entity.name.function.coffee" }, "2": { "name": "variable.other.readwrite.instance.coffee" }, "3": { "name": "keyword.operator.assignment.coffee" } }, "end": "[=-]>", "endCaptures": { "0": { "name": "storage.type.function.coffee" } }, "name": "meta.function.coffee", "patterns": [{ "include": "#function_params" }] }, { "begin": `(?x)
(?<=\\s|^)(?:((')([^']*?)('))|((")([^"]*?)(")))
\\s*([:=])\\s*
(?=(\\([^\\(\\)]*\\)\\s*)?[=-]>)`, "beginCaptures": { "1": { "name": "string.quoted.single.coffee" }, "2": { "name": "punctuation.definition.string.begin.coffee" }, "3": { "name": "entity.name.function.coffee" }, "4": { "name": "punctuation.definition.string.end.coffee" }, "5": { "name": "string.quoted.double.coffee" }, "6": { "name": "punctuation.definition.string.begin.coffee" }, "7": { "name": "entity.name.function.coffee" }, "8": { "name": "punctuation.definition.string.end.coffee" }, "9": { "name": "keyword.operator.assignment.coffee" } }, "end": "[=-]>", "endCaptures": { "0": { "name": "storage.type.function.coffee" } }, "name": "meta.function.coffee", "patterns": [{ "include": "#function_params" }] }, { "begin": "(?=(\\([^\\(\\)]*\\)\\s*)?[=-]>)", "end": "[=-]>", "endCaptures": { "0": { "name": "storage.type.function.coffee" } }, "name": "meta.function.inline.coffee", "patterns": [{ "include": "#function_params" }] }, { "begin": `(?<=\\s|^)({)(?=[^'"#]+?}[\\s\\]}]*=)`, "beginCaptures": { "1": { "name": "punctuation.definition.destructuring.begin.bracket.curly.coffee" } }, "end": "}", "endCaptures": { "0": { "name": "punctuation.definition.destructuring.end.bracket.curly.coffee" } }, "name": "meta.variable.assignment.destructured.object.coffee", "patterns": [{ "include": "$self" }, { "match": "[a-zA-Z$_]\\w*", "name": "variable.assignment.coffee" }] }, { "begin": `(?<=\\s|^)(\\[)(?=[^'"#]+?\\][\\s\\]}]*=)`, "beginCaptures": { "1": { "name": "punctuation.definition.destructuring.begin.bracket.square.coffee" } }, "end": "\\]", "endCaptures": { "0": { "name": "punctuation.definition.destructuring.end.bracket.square.coffee" } }, "name": "meta.variable.assignment.destructured.array.coffee", "patterns": [{ "include": "$self" }, { "match": "[a-zA-Z$_]\\w*", "name": "variable.assignment.coffee" }] }, { "match": "\\b(?<!\\.|::)(true|on|yes)(?!\\s*[:=][^=])\\b", "name": "constant.language.boolean.true.coffee" }, { "match": "\\b(?<!\\.|::)(false|off|no)(?!\\s*[:=][^=])\\b", "name": "constant.language.boolean.false.coffee" }, { "match": "\\b(?<!\\.|::)null(?!\\s*[:=][^=])\\b", "name": "constant.language.null.coffee" }, { "match": "\\b(?<!\\.|::)extends(?!\\s*[:=])\\b", "name": "variable.language.coffee" }, { "match": "(?<!\\.)\\b(?<!\\$)(super|this|arguments)(?!\\s*[:=][^=]|\\$)\\b", "name": "variable.language.$1.coffee" }, { "captures": { "1": { "name": "storage.type.class.coffee" }, "2": { "name": "keyword.control.inheritance.coffee" }, "3": { "name": "entity.other.inherited-class.coffee" } }, "match": "(?<=\\s|^|\\[|\\()(class)\\s+(extends)\\s+(@?[a-zA-Z\\$\\._][\\w\\.]*)", "name": "meta.class.coffee" }, { "captures": { "1": { "name": "storage.type.class.coffee" }, "2": { "name": "entity.name.type.class.coffee" }, "3": { "name": "keyword.control.inheritance.coffee" }, "4": { "name": "entity.other.inherited-class.coffee" } }, "match": "(?<=\\s|^|\\[|\\()(class\\b)\\s+(@?[a-zA-Z\\$_][\\w\\.]*)?(?:\\s+(extends)\\s+(@?[a-zA-Z\\$\\._][\\w\\.]*))?", "name": "meta.class.coffee" }, { "match": "\\b(debugger|\\\\)\\b", "name": "keyword.other.coffee" }, { "match": "\\b(Array|ArrayBuffer|Blob|Boolean|Date|document|Function|Int(8|16|32|64)Array|Math|Map|Number|Object|Proxy|RegExp|Set|String|WeakMap|window|Uint(8|16|32|64)Array|XMLHttpRequest)\\b", "name": "support.class.coffee" }, { "match": "\\b(console)\\b", "name": "entity.name.type.object.coffee" }, { "match": "((?<=console\\.)(debug|warn|info|log|error|time|timeEnd|assert))\\b", "name": "support.function.console.coffee" }, { "match": "((?<=\\.)(apply|call|concat|every|filter|forEach|from|hasOwnProperty|indexOf|isPrototypeOf|join|lastIndexOf|map|of|pop|propertyIsEnumerable|push|reduce(Right)?|reverse|shift|slice|some|sort|splice|to(Locale)?String|unshift|valueOf))\\b", "name": "support.function.method.array.coffee" }, { "match": "((?<=Array\\.)(isArray))\\b", "name": "support.function.static.array.coffee" }, { "match": "((?<=Object\\.)(create|definePropert(ies|y)|freeze|getOwnProperty(Descriptors?|Names)|getProperty(Descriptor|Names)|getPrototypeOf|is(Extensible|Frozen|Sealed)?|isn
(@)?([\\w$]+)
\\s*
(?=\\s+(?!(?<![\\w$])(of|in|then|is|isnt|and|or|for|else|when|if|unless|by|instanceof)(?![\\w$]))(?=(@?[\\w$]+|[=-]>|\\-\\d|\\[|{|"|')))`, "beginCaptures": { "1": { "name": "variable.other.readwrite.instance.coffee" }, "2": { "patterns": [{ "include": "#function_names" }] } }, "end": "(?=\\s*(?<![\\w$])(of|in|then|is|isnt|and|or|for|else|when|if|unless|by|instanceof)(?![\\w$]))|(?=\\s*(}|\\]|\\)|#|$))", "name": "meta.function-call.coffee", "patterns": [{ "include": "#arguments" }] }] }, "function_names": { "patterns": [{ "match": "(?x)\n\\b(isNaN|isFinite|eval|uneval|parseInt|parseFloat|decodeURI|\ndecodeURIComponent|encodeURI|encodeURIComponent|escape|unescape|\nrequire|set(Interval|Timeout)|clear(Interval|Timeout))\\b", "name": "support.function.coffee" }, { "match": "[a-zA-Z_$][\\w$]*", "name": "entity.name.function.coffee" }, { "match": "\\d[\\w$]*", "name": "invalid.illegal.identifier.coffee" }] }, "function_params": { "patterns": [{ "begin": "\\(", "beginCaptures": { "0": { "name": "punctuation.definition.parameters.begin.bracket.round.coffee" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.definition.parameters.end.bracket.round.coffee" } }, "name": "meta.parameters.coffee", "patterns": [{ "captures": { "1": { "name": "variable.parameter.function.coffee" }, "2": { "name": "keyword.operator.splat.coffee" } }, "match": "([a-zA-Z_$][\\w$]*)(\\.\\.\\.)?" }, { "captures": { "1": { "name": "variable.parameter.function.readwrite.instance.coffee" }, "2": { "name": "keyword.operator.splat.coffee" } }, "match": "(@(?:[a-zA-Z_$][\\w$]*)?)(\\.\\.\\.)?" }, { "include": "$self" }] }] }, "heregexp": { "patterns": [{ "match": "\\\\[bB]|\\^|\\$", "name": "keyword.control.anchor.regexp" }, { "match": "\\\\[1-9]\\d*", "name": "keyword.other.back-reference.regexp" }, { "match": "[?+*]|\\{(\\d+,\\d+|\\d+,|,\\d+|\\d+)\\}\\??", "name": "keyword.operator.quantifier.regexp" }, { "match": "\\|", "name": "keyword.operator.or.regexp" }, { "begin": "(\\()((\\?=)|(\\?!))", "beginCaptures": { "1": { "name": "punctuation.definition.group.regexp" }, "3": { "name": "meta.assertion.look-ahead.regexp" }, "4": { "name": "meta.assertion.negative-look-ahead.regexp" } }, "end": "(\\))", "endCaptures": { "1": { "name": "punctuation.definition.group.regexp" } }, "name": "meta.group.assertion.regexp", "patterns": [{ "include": "#heregexp" }] }, { "begin": "\\((\\?:)?", "beginCaptures": { "0": { "name": "punctuation.definition.group.regexp" } }, "end": "\\)", "endCaptures": { "0": { "name": "punctuation.definition.group.regexp" } }, "name": "meta.group.regexp", "patterns": [{ "include": "#heregexp" }] }, { "begin": "(\\[)(\\^)?", "beginCaptures": { "1": { "name": "punctuation.definition.character-class.regexp" }, "2": { "name": "keyword.operator.negation.regexp" } }, "end": "(\\])", "endCaptures": { "1": { "name": "punctuation.definition.character-class.regexp" } }, "name": "constant.other.character-class.set.regexp", "patterns": [{ "captures": { "1": { "name": "constant.character.numeric.regexp" }, "2": { "name": "constant.character.control.regexp" }, "3": { "name": "constant.character.escape.backslash.regexp" }, "4": { "name": "constant.character.numeric.regexp" }, "5": { "name": "constant.character.control.regexp" }, "6": { "name": "constant.character.escape.backslash.regexp" } }, "match": "(?:.|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))\\-(?:[^\\]\\\\]|(\\\\(?:[0-7]{3}|x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4}))|(\\\\c[A-Z])|(\\\\.))", "name": "constant.other.character-class.range.regexp" }, { "include": "#regex-character-class" }] }, { "include": "#regex-character-class" }, { "include": "#interpolated_coffee" }, { "include": "#embedded_comment" }] }, "instance_variable": { "patterns": [{ "match": "(@)([a-zA-Z_\\$]\\w*)?", "name": "variable.other.readwrite.instance.coffee" }] }, "interpolated_coffee": { "patterns": [{ "begin": "\\#\\{", "captures": { "0": { "name": "punctuation.section.embedded.coffee" } }, "end": "\\}", "name": "source.coffee.embedded.source", "patterns": [{ "include": "$self" }] }] }, "jsx": { "pat
var coffee = [
...javascript,
lang
];
export { coffee as default };