@@ -55,9 +55,10 @@ public enum _PrintForDebugger {
55
55
}
56
56
}
57
57
58
- static func asStringRepresentation( value: Any ? ,
59
- mirror: Mirror ,
60
- count: Int ) -> String ? {
58
+ static func asStringRepresentation(
59
+ value: Any ? ,
60
+ mirror: Mirror ,
61
+ count: Int ) -> String ? {
61
62
let ds = mirror. displayStyle ?? . `struct`
62
63
switch ds {
63
64
case . optional:
@@ -122,9 +123,10 @@ public enum _PrintForDebugger {
122
123
}
123
124
124
125
125
- static func shouldExpand( mirror: Mirror ,
126
- collectionStatus: CollectionStatus ,
127
- isRoot: Bool ) -> Bool {
126
+ static func shouldExpand(
127
+ mirror: Mirror ,
128
+ collectionStatus: CollectionStatus ,
129
+ isRoot: Bool ) -> Bool {
128
130
if isRoot || collectionStatus. isCollection { return true }
129
131
let count = Int ( mirror. children. count)
130
132
if count > 0 { return true }
@@ -214,16 +216,17 @@ public enum _PrintForDebugger {
214
216
var printedElements = 0
215
217
216
218
if let sc = mirror. superclassMirror {
217
- printForDebuggerImpl ( value: nil ,
218
- mirror: sc,
219
- name: " super " ,
220
- indent: indent + 2 ,
221
- maxDepth: maxDepth - 1 ,
222
- isRoot: false ,
223
- parentCollectionStatus: . NotACollection,
224
- refsAlreadySeen: & refsAlreadySeen,
225
- maxItemCounter: & maxItemCounter,
226
- targetStream: & targetStream)
219
+ printForDebuggerImpl (
220
+ value: nil ,
221
+ mirror: sc,
222
+ name: " super " ,
223
+ indent: indent + 2 ,
224
+ maxDepth: maxDepth - 1 ,
225
+ isRoot: false ,
226
+ parentCollectionStatus: . NotACollection,
227
+ refsAlreadySeen: & refsAlreadySeen,
228
+ maxItemCounter: & maxItemCounter,
229
+ targetStream: & targetStream)
227
230
}
228
231
229
232
for (optionalName, child) in mirror. children {
@@ -245,16 +248,17 @@ public enum _PrintForDebugger {
245
248
return
246
249
}
247
250
248
- printForDebuggerImpl ( value: child,
249
- mirror: Mirror ( reflecting: child) ,
250
- name: childName,
251
- indent: indent + 2 ,
252
- maxDepth: maxDepth - 1 ,
253
- isRoot: false ,
254
- parentCollectionStatus: collectionStatus,
255
- refsAlreadySeen: & refsAlreadySeen,
256
- maxItemCounter: & maxItemCounter,
257
- targetStream: & targetStream)
251
+ printForDebuggerImpl (
252
+ value: child,
253
+ mirror: Mirror ( reflecting: child) ,
254
+ name: childName,
255
+ indent: indent + 2 ,
256
+ maxDepth: maxDepth - 1 ,
257
+ isRoot: false ,
258
+ parentCollectionStatus: collectionStatus,
259
+ refsAlreadySeen: & refsAlreadySeen,
260
+ maxItemCounter: & maxItemCounter,
261
+ targetStream: & targetStream)
258
262
printedElements += 1
259
263
}
260
264
}
@@ -277,16 +281,17 @@ public enum _PrintForDebugger {
277
281
var refs = Set < ObjectIdentifier > ( )
278
282
var targetStream = StringOutput ( )
279
283
280
- printForDebuggerImpl ( value: value,
281
- mirror: Mirror ( reflecting: value) ,
282
- name: nil ,
283
- indent: 0 ,
284
- maxDepth: maxItemCounter,
285
- isRoot: true ,
286
- parentCollectionStatus: . NotACollection,
287
- refsAlreadySeen: & refs,
288
- maxItemCounter: & maxItemCounter,
289
- targetStream: & targetStream)
284
+ printForDebuggerImpl (
285
+ value: value,
286
+ mirror: Mirror ( reflecting: value) ,
287
+ name: nil ,
288
+ indent: 0 ,
289
+ maxDepth: maxItemCounter,
290
+ isRoot: true ,
291
+ parentCollectionStatus: . NotACollection,
292
+ refsAlreadySeen: & refs,
293
+ maxItemCounter: & maxItemCounter,
294
+ targetStream: & targetStream)
290
295
291
296
return targetStream. data
292
297
}
0 commit comments