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 weak = "source.decl.attribute.weak"
|
||||||
case ibAction = "source.decl.attribute.ibaction"
|
case ibAction = "source.decl.attribute.ibaction"
|
||||||
case ibOutlet = "source.decl.attribute.iboutlet"
|
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 {
|
public func replace(children tokens: [Token]) -> ClassDeclaration {
|
||||||
return ClassDeclaration(name: self.name,
|
return ClassDeclaration(
|
||||||
accessibility: self.accessibility,
|
name: self.name,
|
||||||
range: self.range,
|
accessibility: self.accessibility,
|
||||||
nameRange: self.nameRange,
|
range: self.range,
|
||||||
bodyRange: self.bodyRange,
|
nameRange: self.nameRange,
|
||||||
initializers: self.initializers,
|
bodyRange: self.bodyRange,
|
||||||
children: tokens,
|
initializers: self.initializers,
|
||||||
inheritedTypes: self.inheritedTypes)
|
children: tokens,
|
||||||
|
implementation: self.implementation,
|
||||||
|
inheritedTypes: self.inheritedTypes,
|
||||||
|
attributes: self.attributes)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func isEqual(to other: Token) -> Bool {
|
public func isEqual(to other: Token) -> Bool {
|
||||||
|
|
|
@ -19,14 +19,17 @@ public struct ProtocolDeclaration: ContainerToken {
|
||||||
public let attributes: [Attribute] = []
|
public let attributes: [Attribute] = []
|
||||||
|
|
||||||
public func replace(children tokens: [Token]) -> ProtocolDeclaration {
|
public func replace(children tokens: [Token]) -> ProtocolDeclaration {
|
||||||
return ProtocolDeclaration(name: self.name,
|
return ProtocolDeclaration(
|
||||||
accessibility: self.accessibility,
|
name: self.name,
|
||||||
range: self.range,
|
accessibility: self.accessibility,
|
||||||
nameRange: self.nameRange,
|
range: self.range,
|
||||||
bodyRange: self.bodyRange,
|
nameRange: self.nameRange,
|
||||||
initializers: self.initializers,
|
bodyRange: self.bodyRange,
|
||||||
children: tokens,
|
initializers: self.initializers,
|
||||||
inheritedTypes: self.inheritedTypes)
|
children: tokens,
|
||||||
|
implementation: self.implementation
|
||||||
|
inheritedTypes: self.inheritedTypes,
|
||||||
|
attributes: self.attributes)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func isEqual(to other: Token) -> Bool {
|
public func isEqual(to other: Token) -> Bool {
|
||||||
|
|
Loading…
Reference in New Issue