Closed natecook1000 closed 9 years ago
I've removed the potential collision with #14 and updated the various reserved word fields from the Lexical Structure section of Apple's documentation for Swift. 🐦
Here's a code sample that demonstrates some of the problems fixed—public, private, required, guard, throw, and throws should all be highlighted as keywords:
public class Foo {
public enum FooError : ErrorType {
case NumericConversionError
}
private let bar: String
public required init(s: String) {
self.bar = s
}
public func asInt() throws -> Int {
guard let number = Int(bar) else {
throw FooError.NumericConversionError
}
return number
}
}
Pulled, thanks!
:balloon: :star2: :tada: Thanks, @infininight!
This adds several keywords (access modifiers, new Swift 2.0 features, etc.) that have come to Swift since the last syntax update, and fixes the problem where the formatting disappears after
foo
in this code sample: