Skip to content

Commit

Permalink
Merge pull request #20 from belyaev-mikhail/master
Browse files Browse the repository at this point in the history
Trying to fix #19, #18, #6, #4 and #8
  • Loading branch information
vkostyukov authored Apr 2, 2018
2 parents 4612f71 + ce599a8 commit 31d02f9
Show file tree
Hide file tree
Showing 2 changed files with 134 additions and 82 deletions.
83 changes: 52 additions & 31 deletions Kotlin.JSON-tmLanguage
Original file line number Diff line number Diff line change
Expand Up @@ -109,15 +109,15 @@
"types": {
"patterns": [
{
"match": "\\b(Any|Unit|String|Int|Boolean|Char|Long|Double|Float|Short|Byte|dynamic)\\b",
"match": "\\b(Nothing|Any|Unit|String|CharSequence|Int|Boolean|Char|Long|Double|Float|Short|Byte|dynamic)\\b",
"name": "storage.type.buildin.kotlin"
},
{
"match": "\\b(IntArray|BooleanArray|CharArray|LongArray|DoubleArray|FloatArray|ShortArray|ByteArray)\\b",
"name": "storage.type.buildin.array.kotlin"
},
{
"begin": "\\b(Array|List|Map)<\\b",
"begin": "\\b(Array|Collection|List|Map|Set|MutableList|MutableMap|MutableSet|Sequence)<\\b",
"beginCaptures": {
"1": {
"name": "storage.type.buildin.collection.kotlin"
Expand Down Expand Up @@ -145,20 +145,6 @@
}
]
},
{
"begin": "(#)\\(",
"beginCaptures": {
"1": {
"name": "keyword.operator.tuple.kotlin"
}
},
"end": "\\)",
"patterns": [
{
"include": "#expressions"
}
]
},
{
"begin": "\\{",
"end": "\\}",
Expand Down Expand Up @@ -231,21 +217,26 @@
]
},
"classes": {
"begin": "(?=\\s*(?:companion|class|object|interface))",
"end": "}|(?=$)",
"begin": "(?<!::)(?=\\b(?:companion|class|object|interface)\\b)",
"end": "(?=$|\\})",
"patterns": [
{
"begin": "\\b(companion\s*)?(class|object|interface)\\b",
"include" : "#comments"
},
{
"begin": "\\b(companion\\s*)?(class|object|interface)\\b",
"beginCaptures": {
"1": {
"name": "keyword.other.kotlin"
"name": "storage.modifier.kotlin"
},
"2": {
"name": "storage.modifier.kotlin"
}
},
"end": "(?=<|{|\\(|:)",
"end": "(?=<|\\{|\\(|:|$)",
"patterns": [
{
"match": "\\b(object)\\b",
"name": "keyword.other.kotlin"
"include" : "#comments"
},
{
"match": "\\w+",
Expand Down Expand Up @@ -307,8 +298,8 @@
]
},
"variables": {
"begin": "(?=\\s*(?:var|val))",
"end": "(?=:|=|$)",
"begin": "(?=\\s*\\b(?:var|val)\\b)",
"end": "(?=:|=|(\\b(by)\\b)|$)",
"patterns": [
{
"begin": "\\b(var|val)\\b",
Expand All @@ -317,7 +308,7 @@
"name": "keyword.other.kotlin"
}
},
"end": "(?=:|=|$)",
"end": "(?=:|=|(\\b(by)\\b)|$)",
"patterns": [
{
"begin": "<",
Expand Down Expand Up @@ -355,6 +346,20 @@
}
]
},
{
"begin": "\\b(by)\\b",
"beginCaptures": {
"1": {
"name": "keyword.other.kotlin"
}
},
"end": "(?=$)",
"patterns": [
{
"include": "#expressions"
}
]
},
{
"begin": "(=)",
"beginCaptures": {
Expand Down Expand Up @@ -456,8 +461,8 @@
]
},
"functions": {
"begin": "(?=\\s*(?:fun))",
"end": "}|(?=$)",
"begin": "(?=\\s*\\b(?:fun)\\b)",
"end": "(?=$|\\})",
"patterns": [
{
"begin": "\\b(fun)\\b",
Expand Down Expand Up @@ -699,7 +704,7 @@
"name": "constant.language.kotlin"
},
{
"match": "\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)([LlFfUuDd]|UL|ul)?\\b",
"match": "\\b((0(x|X)[0-9a-fA-F]*)|(([0-9]+\\.?[0-9]*)|(\\.[0-9]+))((e|E)(\\+|-)?[0-9]+)?)([LlFf])?\\b",
"name": "constant.numeric.kotlin"
},
{
Expand All @@ -711,7 +716,7 @@
"keywords": {
"patterns": [
{
"match": "\\b(var|val|public|private|protected|abstract|final|enum|open|attribute|annotation|override|inline|var|val|vararg|lazy|in|out|internal|data|tailrec|operator|infix|const|yield|typealias|typeof)\\b",
"match": "\\b(var|val|public|private|protected|abstract|final|sealed|enum|open|attribute|annotation|override|inline|vararg|in|out|internal|data|tailrec|operator|infix|const|yield|typealias|typeof|reified|suspend)\\b",
"name": "storage.modifier.kotlin"
},
{
Expand All @@ -723,7 +728,7 @@
"name": "keyword.control.kotlin"
},
{
"match": "\\b(in|is|as|assert)\\b",
"match": "\\b(in|is|!in|!is|as|as\\?|assert)\\b",
"name": "keyword.operator.kotlin"
},
{
Expand All @@ -734,14 +739,30 @@
"match": "(=)",
"name": "keyword.operator.assignment.kotlin"
},
{
"match": "(::)",
"name": "keyword.operator.kotlin"
},
{
"match": "(:)",
"name": "keyword.operator.declaration.kotlin"
},
{
"match": "\\b(by)\\b",
"name": "keyword.other.by.kotlin"
},
{
"match": "(\\?\\.)",
"name": "keyword.operator.safenav.kotlin"
},
{
"match": "(\\.)",
"name": "keyword.operator.dot.kotlin"
},
{
"match": "(\\?:)",
"name": "keyword.operator.elvis.kotlin"
},
{
"match": "(\\-\\-|\\+\\+)",
"name": "keyword.operator.increment-decrement.kotlin"
Expand Down
Loading

0 comments on commit 31d02f9

Please sign in to comment.