mirror of
https://github.com/github/semantic.git
synced 2024-12-27 00:44:57 +03:00
JSONLeaf is CustomStringConvertible.
This commit is contained in:
parent
981f6bd92e
commit
97e8f1725f
@ -1,11 +1,25 @@
|
||||
import Doubt
|
||||
import Cocoa
|
||||
|
||||
enum JSONLeaf: Equatable {
|
||||
enum JSONLeaf: Equatable, CustomStringConvertible {
|
||||
case Number(Double)
|
||||
case Boolean(Bool)
|
||||
case String(Swift.String)
|
||||
case Null
|
||||
|
||||
|
||||
var description: Swift.String {
|
||||
switch self {
|
||||
case let .Number(n):
|
||||
return Swift.String(n)
|
||||
case let .Boolean(b):
|
||||
return Swift.String(b)
|
||||
case let .String(s):
|
||||
return Swift.String(reflecting: s)
|
||||
case .Null:
|
||||
return "null"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func == (left: JSONLeaf, right: JSONLeaf) -> Bool {
|
||||
|
Loading…
Reference in New Issue
Block a user