Skip to content

Commit d432c2b

Browse files
committed
Cleanup
1 parent 55919c1 commit d432c2b

File tree

10 files changed

+29
-26
lines changed

10 files changed

+29
-26
lines changed

Sources/DiffableTextKit/Utilities/Info.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ ExpressibleByStringInterpolation, ExpressibleByStringLiteral {
4040
}
4141

4242
//=------------------------------------------------------------------------=
43-
// MARK: Initializers x Indirect
43+
// MARK: Initializers
4444
//=------------------------------------------------------------------------=
4545

4646
@inlinable @inline(__always) public init() {
@@ -68,7 +68,7 @@ ExpressibleByStringInterpolation, ExpressibleByStringLiteral {
6868
}
6969

7070
//=------------------------------------------------------------------------=
71-
// MARK: Initializers x Builder
71+
// MARK: Initializers
7272
//=------------------------------------------------------------------------=
7373

7474
@inlinable @inline(__always) public init(@Info _ instance: () -> Self) {
@@ -80,7 +80,7 @@ ExpressibleByStringInterpolation, ExpressibleByStringLiteral {
8080
}
8181

8282
//=------------------------------------------------------------------------=
83-
// MARK: Initializers x Special
83+
// MARK: Initializers
8484
//=------------------------------------------------------------------------=
8585

8686
@inlinable @inline(__always) public static func note(_ item: @autoclosure () -> Any) -> Self {

Sources/DiffableTextKitXNumber/Graphs/Graph+Floats.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ where Value: _Input & BinaryFloatingPoint & SignedNumeric {
3636
// MARK: Initializers
3737
//=------------------------------------------------------------------------=
3838

39-
/// - Limited by `Double.max` due to `FloatingPointFormatStyle`.
39+
/// - Limited by Double.max due to FloatingPointFormatStyle.
4040
fileprivate init() where Value: LosslessStringConvertible {
4141
let size = Swift.min(Value.significandBitCount, Double.significandBitCount)
4242
self.precision = Int(log10(pow(2, Double.init(size))))/*-*/

Sources/DiffableTextKitXNumber/Graphs/Graph+Integers.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ where Value: _Input & FixedWidthInteger {
3636
//=------------------------------------------------------------------------=
3737

3838
/// - Limited by Int.max due to IntegerFormatStyle.
39-
/// - Limited by longest sequence of 9s due to IntegerFormatStyle.
40-
fileprivate init() where Value: LosslessStringConvertible {
39+
/// - Limited by the longest representable sequence of 9s due to IntegerFormatStyle.
40+
fileprivate init() {
4141
let limit = Value(clamping: Int.max)
4242
self.precision = Int(floor(log10(Double(limit))))
4343
self.max = Value(String(repeating: "9", count: precision))!

Sources/DiffableTextKitXNumber/Models/Components.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,35 @@ import Foundation
1717
@usableFromInline struct Components {
1818

1919
@usableFromInline static let ascii = Self(
20-
signs: .ascii(),
21-
digits: .ascii(),
20+
signs:/*-*/ .ascii(),
21+
digits:/**/ .ascii(),
2222
separators: .ascii())
2323

2424
//=------------------------------------------------------------------------=
2525

26-
@usableFromInline let signs: Links<Sign>
27-
@usableFromInline let digits: Links<Digit>
26+
@usableFromInline let signs:/*-*/ Links<Sign>
27+
@usableFromInline let digits:/**/ Links<Digit>
2828
@usableFromInline let separators: Links<Separator>
2929

3030
//=------------------------------------------------------------------------=
3131

3232
@inlinable init(signs: Links<Sign>, digits: Links<Digit>, separators: Links<Separator>) {
33-
self.signs = signs
34-
self.digits = digits
33+
self.signs/*-*/ = signs
34+
self.digits/**/ = digits
3535
self.separators = separators
3636
}
3737

3838
@inlinable static func standard(_ formatter: NumberFormatter) -> Self {
3939
assert(formatter.numberStyle == .none); return Self.init(
40-
signs: .standard(formatter),
41-
digits: .standard(formatter),
40+
signs:/*-*/ .standard(formatter),
41+
digits:/**/ .standard(formatter),
4242
separators: .standard(formatter))
4343
}
4444

4545
@inlinable static func currency(_ formatter: NumberFormatter) -> Self {
4646
assert(formatter.numberStyle == .none); return Self.init(
47-
signs: .currency(formatter),
48-
digits: .currency(formatter),
47+
signs:/*-*/ .currency(formatter),
48+
digits:/**/ .currency(formatter),
4949
separators: .currency(formatter))
5050
}
5151

@@ -68,8 +68,8 @@ import Foundation
6868
}
6969

7070
@inlinable func nonvirtual(_ character: Character) -> Bool {
71-
signs [character] != nil ||
72-
digits [character] != nil ||
71+
signs/*-*/[character] != nil ||
72+
digits/**/[character] != nil ||
7373
separators[character] == Separator.fraction
7474
}
7575
}

Sources/DiffableTextKitXNumber/Models/Interpreter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ import Foundation
5252

5353
@inlinable func number(_ symbols: some Sequence<Symbol>,
5454
as value: (some _Value).Type) throws -> Number? {
55-
let unformatted = symbols.lazy.nonvirtuals() /*--------------------------*/
55+
let unformatted = symbols.lazy.nonvirtuals()
5656
return try Number(unformatted: unformatted, signs: components.signs.tokens,
5757
digits: components.digits.tokens, separators: components.separators.tokens,
5858
optional: value.optional, unsigned: value.unsigned, integer: value.integer)

Sources/DiffableTextKitXNumber/Models/Translator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import DiffableTextKit
2323
//=------------------------------------------------------------------------=
2424

2525
@inlinable init(from source: Components, to target: Components) {
26-
source.signs .tokens.forEach { self.singular[$0] = target.signs [$1] }
27-
source.digits .tokens.forEach { self.singular[$0] = target.digits [$1] }
26+
source.signs/*-*/.tokens.forEach { self.singular[$0] = target.signs/*-*/[$1] }
27+
source.digits/**/.tokens.forEach { self.singular[$0] = target.digits/**/[$1] }
2828
source.separators.tokens.forEach { self.singular[$0] = target.separators[$1] }
2929

3030
let fraction = target.separators.characters[.fraction]

Sources/DiffableTextKitXNumber/Styles/Default+Currency.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ import Foundation
1717
public struct _CurrencyStyle<Format>: _DefaultStyle, _Currency
1818
where Format: _Format & _Currency, Format.FormatInput: _Input {
1919

20-
public typealias Graph = Format.FormatInput.NumberTextGraph
2120
public typealias Value = Format.FormatInput
2221
public typealias Input = Format.FormatInput
2322

23+
public typealias Graph = Format.FormatInput.NumberTextGraph
24+
2425
//=------------------------------------------------------------------------=
2526
// MARK: State
2627
//=------------------------------------------------------------------------=

Sources/DiffableTextKitXNumber/Styles/Default+Optional.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,12 @@ import Foundation
1717
public struct _OptionalStyle<Base>: _Style, WrapperTextStyle where
1818
Base: _Style & NullableTextStyle, Base.Value == Base.Input {
1919

20-
public typealias Graph = _OptionalGraph<Base.Graph>
2120
public typealias Cache = Base .Cache
2221
public typealias Value = Graph.Value
2322
public typealias Input = Graph.Input
2423

24+
public typealias Graph = _OptionalGraph<Base.Graph>
25+
2526
//=------------------------------------------------------------------------=
2627
// MARK: State
2728
//=------------------------------------------------------------------------=

Sources/DiffableTextKitXNumber/Styles/Default+Standard.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ import Foundation
1717
public struct _StandardStyle<Format>: _DefaultStyle, _Standard
1818
where Format: _Format & _Standard, Format.FormatInput: _Input {
1919

20-
public typealias Graph = Format.FormatInput.NumberTextGraph
2120
public typealias Value = Format.FormatInput
2221
public typealias Input = Format.FormatInput
2322

23+
public typealias Graph = Format.FormatInput.NumberTextGraph
24+
2425
//=------------------------------------------------------------------------=
2526
// MARK: State
2627
//=------------------------------------------------------------------------=

Tests/DiffableTextKitTests/Models/Snapshot.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,8 +184,8 @@ final class SnapshotTests: XCTestCase {
184184

185185
func testReplaceSubrangeWithCharacters() {
186186
snapshot = Snapshot(repeating: " ", count: 4)
187-
snapshot.replaceSubrange(snapshot.indices(at: C(0) ..< 2), with: Snapshot("AA", as: .content))
188-
snapshot.replaceSubrange(snapshot.indices(at: C(2) ..< 4), with: Snapshot("BB", as: .phantom))
187+
snapshot.replaceSubrange(snapshot.indices(at: C(0) ..< 2), with: "AA", as: .content)
188+
snapshot.replaceSubrange(snapshot.indices(at: C(2) ..< 4), with: "BB", as: .phantom)
189189

190190
Assert("AABB", [.content, .content, .phantom, .phantom])
191191
}

0 commit comments

Comments
 (0)