Update grammars

This commit is contained in:
Alex Ross
2019-08-05 12:44:23 +02:00
parent 63526965e2
commit edf34d3931
17 changed files with 3421 additions and 1475 deletions

View File

@@ -4,7 +4,7 @@
"If you want to provide a fix or improvement, please create a pull request against the original repository.",
"Once accepted there, we are happy to receive an update request."
],
"version": "https://github.com/textmate/swift.tmbundle/commit/cec27af6662e3799120b208e64483efdfe5521f5",
"version": "https://github.com/textmate/swift.tmbundle/commit/bdc8ae07562060a566b33da3f62601bb5aababd1",
"name": "Swift",
"scopeName": "source.swift",
"comment": "See swift.tmbundle/grammar-test.swift for test cases.",
@@ -46,7 +46,7 @@
"name": "constant.numeric.swift"
}
},
"match": "\\b((?:iOS|macOS|OSX|watchOS|tvOS)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))?"
"match": "\\b(swift|(?:iOS|macOS|OSX|watchOS|tvOS|UIKitForMac)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))?"
},
{
"begin": "\\b(introduced|deprecated|obsoleted)\\s*(:)\\s*",
@@ -587,7 +587,24 @@
"match": "\\b(os)\\s*(\\()\\s*(?:(macOS|OSX|iOS|tvOS|watchOS|Android|Linux|FreeBSD|Windows|PS4)|\\w+)\\s*(\\))"
},
{
"begin": "\\b(swift)\\s*(\\()",
"captures": {
"1": {
"name": "keyword.other.condition.swift"
},
"2": {
"name": "punctuation.definition.parameters.begin.swift"
},
"3": {
"name": "entity.name.type.module.swift"
},
"4": {
"name": "punctuation.definition.parameters.end.swift"
}
},
"match": "\\b(canImport)\\s*(\\()([\\p{L}_][\\p{L}_\\p{N}\\p{M}]*)(\\))"
},
{
"begin": "\\b(targetEnvironment)\\s*(\\()",
"beginCaptures": {
"1": {
"name": "keyword.other.condition.swift"
@@ -604,7 +621,30 @@
},
"patterns": [
{
"match": ">=",
"match": "\\b(simulator|UIKitForMac)\\b",
"name": "support.constant.platform.environment.swift"
}
]
},
{
"begin": "\\b(swift|compiler)\\s*(\\()",
"beginCaptures": {
"1": {
"name": "keyword.other.condition.swift"
},
"2": {
"name": "punctuation.definition.parameters.begin.swift"
}
},
"end": "(\\))|$",
"endCaptures": {
"1": {
"name": "punctuation.definition.parameters.end.swift"
}
},
"patterns": [
{
"match": ">=|<",
"name": "keyword.operator.comparison.swift"
},
{
@@ -1977,22 +2017,27 @@
"include": "#comments"
},
{
"captures": {
"begin": "(?x)\n\t\t\t\t\t\t\t\t\t\t(?:(_)|((?<q1>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*\\k<q1>))\n\t\t\t\t\t\t\t\t\t\t\\s+\n\t\t\t\t\t\t\t\t\t\t(((?<q2>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*\\k<q2>))\n\t\t\t\t\t\t\t\t\t\t\\s*(:)",
"beginCaptures": {
"1": {
"name": "invalid.illegal.distinct-labels-not-allowed.swift"
},
"3": {
"name": "entity.name.function.swift"
},
"4": {
"2": {
"name": "invalid.illegal.distinct-labels-not-allowed.swift"
},
"5": {
"name": "variable.parameter.function.swift"
},
"6": {
"7": {
"name": "punctuation.separator.argument-label.swift"
}
},
"end": "(?=[,)\\]])",
"match": "(?x)\n\t\t\t\t\t\t\t\t\t\t((?<q1>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*\\k<q1>)\n\t\t\t\t\t\t\t\t\t\t\\s+\n\t\t\t\t\t\t\t\t\t\t(((?<q2>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*\\k<q2>))\n\t\t\t\t\t\t\t\t\t\t\\s*(:)"
"patterns": [
{
"include": "#available-types"
}
]
},
{
"begin": "(((?<q>`?)[\\p{L}_][\\p{L}_\\p{N}\\p{M}]*\\k<q>))\\s*(:)",
@@ -2279,7 +2324,7 @@
"name": "constant.numeric.swift"
}
},
"match": "\\s*\\b((?:iOS|macOS|OSX|watchOS|tvOS)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))"
"match": "\\s*\\b((?:iOS|macOS|OSX|watchOS|tvOS|UIKitForMac)(?:ApplicationExtension)?)\\b(?:\\s+([0-9]+(?:\\.[0-9]+)*\\b))"
},
{
"captures": {