Add `@available` attribute support.
This commit is contained in:
parent
2961debaba
commit
2f6ab41bbc
|
@ -16,4 +16,5 @@ public enum Attribute: String {
|
|||
case weak = "source.decl.attribute.weak"
|
||||
case ibAction = "source.decl.attribute.ibaction"
|
||||
case ibOutlet = "source.decl.attribute.iboutlet"
|
||||
case available = "source.decl.attribute.available"
|
||||
}
|
||||
|
|
|
@ -23,14 +23,17 @@ public struct ClassDeclaration: ContainerToken {
|
|||
}
|
||||
|
||||
public func replace(children tokens: [Token]) -> ClassDeclaration {
|
||||
return ClassDeclaration(name: self.name,
|
||||
return ClassDeclaration(
|
||||
name: self.name,
|
||||
accessibility: self.accessibility,
|
||||
range: self.range,
|
||||
nameRange: self.nameRange,
|
||||
bodyRange: self.bodyRange,
|
||||
initializers: self.initializers,
|
||||
children: tokens,
|
||||
inheritedTypes: self.inheritedTypes)
|
||||
implementation: self.implementation,
|
||||
inheritedTypes: self.inheritedTypes,
|
||||
attributes: self.attributes)
|
||||
}
|
||||
|
||||
public func isEqual(to other: Token) -> Bool {
|
||||
|
|
|
@ -19,14 +19,17 @@ public struct ProtocolDeclaration: ContainerToken {
|
|||
public let attributes: [Attribute] = []
|
||||
|
||||
public func replace(children tokens: [Token]) -> ProtocolDeclaration {
|
||||
return ProtocolDeclaration(name: self.name,
|
||||
return ProtocolDeclaration(
|
||||
name: self.name,
|
||||
accessibility: self.accessibility,
|
||||
range: self.range,
|
||||
nameRange: self.nameRange,
|
||||
bodyRange: self.bodyRange,
|
||||
initializers: self.initializers,
|
||||
children: tokens,
|
||||
inheritedTypes: self.inheritedTypes)
|
||||
implementation: self.implementation
|
||||
inheritedTypes: self.inheritedTypes,
|
||||
attributes: self.attributes)
|
||||
}
|
||||
|
||||
public func isEqual(to other: Token) -> Bool {
|
||||
|
|
Loading…
Reference in New Issue