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

7 lines
9.1 KiB
JavaScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
const lang = Object.freeze({ "displayName": "Kotlin", "fileTypes": ["kt", "kts"], "name": "kotlin", "patterns": [{ "include": "#import" }, { "include": "#package" }, { "include": "#code" }], "repository": { "annotation-simple": { "match": "(?<!\\w)@[\\w\\.]+\\b(?!:)", "name": "entity.name.type.annotation.kotlin" }, "annotation-site": { "begin": "(?<!\\w)(@\\w+):\\s*(?!\\[)", "beginCaptures": { "1": { "name": "entity.name.type.annotation-site.kotlin" } }, "end": "$", "patterns": [{ "include": "#unescaped-annotation" }] }, "annotation-site-list": { "begin": "(?<!\\w)(@\\w+):\\s*\\[", "beginCaptures": { "1": { "name": "entity.name.type.annotation-site.kotlin" } }, "end": "\\]", "patterns": [{ "include": "#unescaped-annotation" }] }, "binary-literal": { "match": "0(b|B)[01][01_]*", "name": "constant.numeric.binary.kotlin" }, "boolean-literal": { "match": "\\b(true|false)\\b", "name": "constant.language.boolean.kotlin" }, "character": { "begin": "'", "end": "'", "name": "string.quoted.single.kotlin", "patterns": [{ "match": "\\\\.", "name": "constant.character.escape.kotlin" }] }, "class-declaration": { "captures": { "1": { "name": "storage.type.class.kotlin" }, "2": { "name": "entity.name.type.class.kotlin" }, "3": { "patterns": [{ "include": "#type-parameter" }] } }, "match": "\\b(class|(?:fun\\s+)?interface)\\s+(\\b\\w+\\b|`[^`]+`)\\s*(?<GROUP><([^<>]|\\g<GROUP>)+>)?" }, "code": { "patterns": [{ "include": "#comments" }, { "include": "#keywords" }, { "include": "#annotation-simple" }, { "include": "#annotation-site-list" }, { "include": "#annotation-site" }, { "include": "#class-declaration" }, { "include": "#object" }, { "include": "#type-alias" }, { "include": "#function" }, { "include": "#variable-declaration" }, { "include": "#type-constraint" }, { "include": "#type-annotation" }, { "include": "#function-call" }, { "include": "#method-reference" }, { "include": "#key" }, { "include": "#string" }, { "include": "#string-empty" }, { "include": "#string-multiline" }, { "include": "#character" }, { "include": "#lambda-arrow" }, { "include": "#operators" }, { "include": "#self-reference" }, { "include": "#decimal-literal" }, { "include": "#hex-literal" }, { "include": "#binary-literal" }, { "include": "#boolean-literal" }, { "include": "#null-literal" }] }, "comment-block": { "begin": "/\\*(?!\\*)", "end": "\\*/", "name": "comment.block.kotlin" }, "comment-javadoc": { "patterns": [{ "begin": "/\\*\\*", "end": "\\*/", "name": "comment.block.javadoc.kotlin", "patterns": [{ "match": "@(return|constructor|receiver|sample|see|author|since|suppress)\\b", "name": "keyword.other.documentation.javadoc.kotlin" }, { "captures": { "1": { "name": "keyword.other.documentation.javadoc.kotlin" }, "2": { "name": "variable.parameter.kotlin" } }, "match": "(@param|@property)\\s+(\\S+)" }, { "captures": { "1": { "name": "keyword.other.documentation.javadoc.kotlin" }, "2": { "name": "variable.parameter.kotlin" } }, "match": "(@param)\\[(\\S+)\\]" }, { "captures": { "1": { "name": "keyword.other.documentation.javadoc.kotlin" }, "2": { "name": "entity.name.type.class.kotlin" } }, "match": "(@(?:exception|throws))\\s+(\\S+)" }, { "captures": { "1": { "name": "keyword.other.documentation.javadoc.kotlin" }, "2": { "name": "entity.name.type.class.kotlin" }, "3": { "name": "variable.parameter.kotlin" } }, "match": "{(@link)\\s+(\\S+)?#([\\w$]+\\s*\\([^\\(\\)]*\\)).*}" }] }] }, "comment-line": { "begin": "//", "end": "$", "name": "comment.line.double-slash.kotlin" }, "comments": { "patterns": [{ "include": "#comment-line" }, { "include": "#comment-block" }, { "include": "#comment-javadoc" }] }, "control-keywords": { "match": "\\b(if|else|while|do|when|try|throw|break|continue|return|for)\\b", "name": "keyword.control.kotlin" }, "decimal-literal": { "match": "\\b\\d[\\d_]*(\\.[\\d_]+)?((e|E)\\d+)?(u|U)?(L|F|f)?\\b", "name": "constant.numeric.decimal.kotlin" }, "function": { "captures": { "1": { "name": "storage.type.function.kotlin" }, "2": { "patterns": [{ "include": "#type-parameter" }] }, "4": { "name": "entity.name.type.class.extension.kotlin" }, "5
var kotlin = [
lang
];
export { kotlin as default };