Skip to content

Commit

Permalink
Merge pull request #145 from fwcd/object-fun-literals
Browse files Browse the repository at this point in the history
Handle object and function literals in grammar
  • Loading branch information
fwcd authored Jan 15, 2024
2 parents c07a2b0 + bb71d91 commit 8815dfe
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions syntaxes/kotlin.tmLanguage.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,13 @@
"include": "#class-declaration"
},
{
"include": "#object-declaration"
"include": "#object"
},
{
"include": "#type-alias"
},
{
"include": "#function-declaration"
"include": "#function"
},
{
"include": "#variable-declaration"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -349,8 +349,8 @@
}
}
},
"function-declaration": {
"match": "\\b(fun)\\b\\s*(?<GROUP><([^<>]|\\g<GROUP>)+>)?\\s*(?:(\\w+)\\.)?(\\b\\w+\\b|`[^`]+`)",
"function": {
"match": "\\b(fun)\\b\\s*(?<GROUP><([^<>]|\\g<GROUP>)+>)?\\s*(?:(?:(\\w+)\\.)?(\\b\\w+\\b|`[^`]+`))?",
"captures": {
"1": {
"name": "storage.type.function.kotlin"
Expand Down

0 comments on commit 8815dfe

Please sign in to comment.