1
1
mirror of https://github.com/github/semantic.git synced 2025-01-04 13:34:31 +03:00

Remove Category.

This commit is contained in:
Rob Rix 2015-10-14 09:02:21 -04:00
parent 1f40f40869
commit c7ef3cc586

View File

@ -1,60 +1,3 @@
/// A syntactic category to which nodes can belong.
public enum Category: AlgebraicHashable, Comparable, CustomDebugStringConvertible, CustomJSONConvertible {
case Tag(String)
public var tag: String {
switch self {
case let .Tag(s):
return s
}
}
// MARK: AlgebraicHashable
public var hash: Hash {
return Hash("Tag", Hash(tag))
}
// MARK: CustomDebugStringConvertible
public var debugDescription: String {
switch self {
case let .Tag(s):
return ".Tag(\(s))"
}
}
// MARK: CustomJSONConvertible
public var JSON: Doubt.JSON {
switch self {
case let .Tag(s):
return [ "tag": .String(s) ]
}
}
}
// MARK: - Equatable
public func == (left: Category, right: Category) -> Bool {
return left.tag == right.tag
}
// MARK: - Comparable
public func < (left: Category, right: Category) -> Bool {
return left.tag < right.tag
}
// MARK: - Categorizable
/// A type whose values belong to a set of categories.
public protocol Categorizable {
typealias Category: Hashable