Improve highlighting of #available condition

Conforming to Xcode, the syntax file now highlights platforms contained
within the `#available` condition.

It also now removes highlighting numbers and the "*" (i.e, symbol for
future platforms) that are contained within the `#available` condition
since they are not literal numbers or operator (thanks to @acclissold
for the idea)

Additionally, add tests to example.swift to demonstrate highlighting of
them.

References #56
This commit is contained in:
Akshay Hegde
2015-09-07 00:57:11 -07:00
parent 456c8d3cc7
commit 91cc1e63cb
2 changed files with 12 additions and 0 deletions

View File

@@ -266,3 +266,10 @@ let dict = [
"fadsf",
],
]
if #available(OSX 10.10.3, *) {
// Use APIs OS X 10.10.3 and onwards
}
if #available(watchOS 2, iOS 9.0, OSX 10.11, *) {
// APIs available to watchOS 2.0, iOS 9.0, OSX 10.11 and onwards
}