From bb71d917dd97b756d45f2594346efe3d70a15060 Mon Sep 17 00:00:00 2001 From: fwcd Date: Mon, 15 Jan 2024 16:41:17 +0000 Subject: [PATCH] Handle object and function literals in grammar --- syntaxes/kotlin.tmLanguage.json | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/syntaxes/kotlin.tmLanguage.json b/syntaxes/kotlin.tmLanguage.json index f6e4c81..5b32abb 100644 --- a/syntaxes/kotlin.tmLanguage.json +++ b/syntaxes/kotlin.tmLanguage.json @@ -78,13 +78,13 @@ "include": "#class-declaration" }, { - "include": "#object-declaration" + "include": "#object" }, { "include": "#type-alias" }, { - "include": "#function-declaration" + "include": "#function" }, { "include": "#variable-declaration" @@ -320,8 +320,8 @@ } } }, - "object-declaration": { - "match": "\\b(object)\\s+(\\b\\w+\\b|`[^`]+`)", + "object": { + "match": "\\b(object)(?:\\s+(\\b\\w+\\b|`[^`]+`))?", "captures": { "1": { "name": "storage.type.object.kotlin" @@ -349,8 +349,8 @@ } } }, - "function-declaration": { - "match": "\\b(fun)\\b\\s*(?<([^<>]|\\g)+>)?\\s*(?:(\\w+)\\.)?(\\b\\w+\\b|`[^`]+`)", + "function": { + "match": "\\b(fun)\\b\\s*(?<([^<>]|\\g)+>)?\\s*(?:(?:(\\w+)\\.)?(\\b\\w+\\b|`[^`]+`))?", "captures": { "1": { "name": "storage.type.function.kotlin"