Depreacted PathExplorer.real for .double
This commit is contained in:
parent
a3c5ff8c73
commit
70e9a041c9
|
@ -11,7 +11,7 @@ public extension Parser {
|
|||
|
||||
static func character(matching condition: @escaping (Character) -> Bool) -> Parser<Character> {
|
||||
Parser<Character> { input in
|
||||
guard let char = input.first, condition(char) else { return nil }
|
||||
guard let char = input.first, condition(char) else { return nil }
|
||||
return (char, input.dropFirst())
|
||||
}
|
||||
}
|
||||
|
|
|
@ -269,6 +269,7 @@ extension ExplorerValue {
|
|||
return double
|
||||
}
|
||||
|
||||
@available(*, deprecated, renamed: "double")
|
||||
public var real: Double? { double }
|
||||
|
||||
public var string: String? {
|
||||
|
|
|
@ -17,7 +17,7 @@ public struct CodablePathExplorer<Format: CodableFormat>: PathExplorer {
|
|||
public var int: Int? { value.int }
|
||||
@available(*, deprecated, renamed: "double")
|
||||
public var real: Double? { value.real }
|
||||
public var double: Double? { value.real }
|
||||
public var double: Double? { value.double }
|
||||
public var data: Data? { value.data }
|
||||
public func array<T>(of type: T.Type) throws -> [T] where T: ExplorerValueCreatable { try value.array(of: type) }
|
||||
public func dictionary<T>(of type: T.Type) throws -> [String: T] where T: ExplorerValueCreatable { try value.dictionary(of: type) }
|
||||
|
|
|
@ -29,6 +29,7 @@ where
|
|||
var int: Int? { get }
|
||||
|
||||
/// Non `nil` if the key is of the `Double` type
|
||||
@available(*, deprecated, renamed: "double")
|
||||
var real: Double? { get }
|
||||
|
||||
/// Non `nil` if the key is of the `Double` type
|
||||
|
|
|
@ -131,7 +131,7 @@ final class PathExplorerGetTests: XCTestCase {
|
|||
XCTAssertEqual(try explorer.get(0).string, "Endo")
|
||||
XCTAssertEqual(try explorer.get(1).int, 1)
|
||||
XCTAssertEqual(try explorer.get(2).bool, false)
|
||||
XCTAssertEqual(try explorer.get(3).real, 2.5)
|
||||
XCTAssertEqual(try explorer.get(3).double, 2.5)
|
||||
}
|
||||
|
||||
func testGetIndex_LastIndex<P: EquatablePathExplorer>(_ type: P.Type) throws {
|
||||
|
|
Loading…
Reference in New Issue