const lang = Object.freeze({ "displayName": "Kotlin", "fileTypes": ["kt", "kts"], "name": "kotlin", "patterns": [{ "include": "#import" }, { "include": "#package" }, { "include": "#code" }], "repository": { "annotation-simple": { "match": "(?<([^<>]|\\g)+>)?" }, "code": { "patterns": [{ "include": "#comments" }, { "include": "#keywords" }, { "include": "#annotation-simple" }, { "include": "#annotation-site-list" }, { "include": "#annotation-site" }, { "include": "#class-declaration" }, { "include": "#object-declaration" }, { "include": "#type-alias" }, { "include": "#function-declaration" }, { "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-call": { "captures": { "1": { "name": "entity.name.function.call.kotlin" }, "2": { "patterns": [{ "include": "#type-parameter" }] } }, "match": "\\??\\.?(\\b\\w+\\b|`[^`]+`)\\s*(?<([^<>]|\\g)+>)?\\s*(?=[({])" }, "function-declaration": { "captures": { "1": { "name": "storage.type.function.kotlin" }, "2": { "patterns": [{ "include": "#type-parameter" }] }, "4": { "name": "entity.name.type.class.extension.kotlin" }, "5": { "name": "entity.name.function.declaration.kotlin" } }, "match": "\\b(fun)\\b\\s*(?<([^<>]|\\g)+>)?\\s*(?:(\\w+)\\.)?(\\b\\w+\\b|`[^`]+`)" }, "hard-keywords": { "match": "\\b(as|typeof|is|in)\\b", "name": "keyword.hard.kotlin" }, "hex-literal": { "match": "0(x|X)[A-Fa-f0-9][A-Fa-f0-9_]*(u|U)?", "name": "constant.numeric.hex.kotlin" }, "import": { "begin": "\\b(import)\\b\\s*", "beginCaptures": { "1": { "name": "storage.type.import.kotlin" } }, "contentName": "entity.name.package.kotlin", "end": ";|$", "name": "meta.import.kotlin", "patterns": [{ "include": "#comments" }, { "include": "#hard-keywords" }, { "match": "\\*", "name": "variable.language.wildcard.kotlin" }] }, "key": { "captures": { "1": { "name": "variable.parameter.kotlin" }, "2": { "name": "keyword.operator.assignment.kotlin" } }, "match": "\\b(\\w=)\\s*(=)" }, "keywords": { "patterns": [{ "include": "#prefix-modifiers" }, { "include": "#postfix-modifiers" }, { "include": "#soft-keywords" }, { "include": "#hard-keywords" }, { "include": "#control-keywords" }] }, "lambda-arrow": { "match": "->", "name": "storage.type.function.arrow.kotlin" }, "method-reference": { "captures": { "1": { "name": "entity.name.function.reference.kotlin" } }, "match": "\\??::(\\b\\w+\\b|`[^`]+`)" }, "null-literal": { "match": "\\bnull\\b", "name": "constant.language.null.kotlin" }, "object-declaration": { "captures": { "1": { "name": "storage.type.object.kotlin" }, "2": { "name": "entity.name.type.object.kotlin" } }, "match": "\\b(object)\\s+(\\b\\w+\\b|`[^`]+`)" }, "operators": { "patterns": [{ "match": "(===?|\\!==?|<=|>=|<|>)", "name": "keyword.operator.comparison.kotlin" }, { "match": "([+*/%-]=)", "name": "keyword.operator.assignment.arithmetic.kotlin" }, { "match": "(=)", "name": "keyword.operator.assignment.kotlin" }, { "match": "([+*/%-])", "name": "keyword.operator.arithmetic.kotlin" }, { "match": "(!|&&|\\|\\|)", "name": "keyword.operator.logical.kotlin" }, { "match": "(--|\\+\\+)", "name": "keyword.operator.increment-decrement.kotlin" }, { "match": "(\\.\\.)", "name": "keyword.operator.range.kotlin" }] }, "package": { "begin": "\\b(package)\\b\\s*", "beginCaptures": { "1": { "name": "storage.type.package.kotlin" } }, "contentName": "entity.name.package.kotlin", "end": ";|$", "name": "meta.package.kotlin", "patterns": [{ "include": "#comments" }] }, "postfix-modifiers": { "match": "\\b(where|by|get|set)\\b", "name": "storage.modifier.other.kotlin" }, "prefix-modifiers": { "match": "\\b(abstract|final|enum|open|annotation|sealed|data|override|final|lateinit|private|protected|public|internal|inner|companion|noinline|crossinline|vararg|reified|tailrec|operator|infix|inline|external|const|suspend|value)\\b", "name": "storage.modifier.other.kotlin" }, "self-reference": { "match": "\\b(this|super)(@\\w+)?\\b", "name": "variable.language.this.kotlin" }, "soft-keywords": { "match": "\\b(catch|finally|field)\\b", "name": "keyword.soft.kotlin" }, "string": { "begin": '(?<([^<>]|\\g)+>)?" }, "type-annotation": { "captures": { "0": { "patterns": [{ "include": "#type-parameter" }] } }, "match": `(?|(?[<(]([^<>()"']|\\g)+[)>]))+` }, "type-parameter": { "patterns": [{ "match": "\\b\\w+\\b", "name": "entity.name.type.kotlin" }, { "match": "\\b(in|out)\\b", "name": "storage.modifier.kotlin" }] }, "unescaped-annotation": { "match": "\\b[\\w\\.]+\\b", "name": "entity.name.type.annotation.kotlin" }, "variable-declaration": { "captures": { "1": { "name": "storage.type.variable.kotlin" }, "2": { "patterns": [{ "include": "#type-parameter" }] } }, "match": "\\b(val|var)\\b\\s*(?<([^<>]|\\g)+>)?" } }, "scopeName": "source.kotlin", "aliases": ["kt", "kts"] }); var kotlin = [ lang ]; export { kotlin as default };