Skip to content

Commit ba36874

Browse files
authored
Merge pull request #567 from ahoppen/pr/syntaxviewingmode-all-is-public
Remove underscore from SyntaxViewingMode._all
2 parents 366da77 + 4fd05f2 commit ba36874

File tree

6 files changed

+8
-10
lines changed

6 files changed

+8
-10
lines changed

Sources/SwiftSyntax/Syntax.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ public extension SyntaxProtocol {
540540
target.write(String(describing: syntaxNodeType))
541541
}
542542

543-
let allChildren = children(viewMode: ._all)
543+
let allChildren = children(viewMode: .all)
544544
if includeChildren {
545545
if !allChildren.isEmpty {
546546
target.write(" children=\(allChildren.count)")

Sources/SwiftSyntax/SyntaxTreeViewMode.swift

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,7 @@ public enum SyntaxTreeViewMode {
2525
case fixedUp
2626

2727
/// Both missing and garbage nodes will be traversed.
28-
/// Mostly useful for SwiftSyntax internal verifiers that verify the integrity
29-
/// of the entire tree
30-
case _all
28+
case all
3129

3230
/// Returns whether this traversal node should visit `node` or ignore it.
3331
func shouldTraverse(node: RawSyntax) -> Bool {
@@ -36,7 +34,7 @@ public enum SyntaxTreeViewMode {
3634
return node.presence == .present
3735
case .fixedUp:
3836
return node.kind != .garbageNodes
39-
case ._all:
37+
case .all:
4038
return true
4139
}
4240
}

Sources/SwiftSyntax/SyntaxVerifier.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ public class SyntaxVerifier: SyntaxAnyVisitor {
3131
var unknownNodes: [Syntax] = []
3232

3333
init() {
34-
super.init(viewMode: ._all)
34+
super.init(viewMode: .all)
3535
}
3636

3737
public override func visitAny(_ node: Syntax) -> SyntaxVisitorContinueKind {

Sources/_SwiftSyntaxTestSupport/Syntax+Assertions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ fileprivate class SyntaxTypeFinder: SyntaxAnyVisitor {
237237
self.offset = offset
238238
self.type = type
239239
self.found = nil
240-
super.init(viewMode: ._all)
240+
super.init(viewMode: .all)
241241
}
242242

243243
fileprivate override func visitAny(_ node: Syntax) -> SyntaxVisitorContinueKind {

Sources/_SwiftSyntaxTestSupport/SyntaxComparison.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ public extension SyntaxProtocol {
9494
return TreeDifference(node: self, baseline: baseline, reason: reason)
9595
}
9696

97-
var iterator = children(viewMode: ._all).makeIterator()
98-
var baseIterator = baseline.children(viewMode: ._all).makeIterator()
97+
var iterator = children(viewMode: .all).makeIterator()
98+
var baseIterator = baseline.children(viewMode: .all).makeIterator()
9999
while let child = iterator.next() {
100100
guard let baselineChild = baseIterator.next() else {
101101
return TreeDifference(node: child, baseline: baseline, reason: .additionalNode)

Sources/lit-test-helper/main.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ func diagnose(args: CommandLineArguments) throws {
528528
init(diagnosticHandler: @escaping ((Diagnostic) -> Void), _ converter: SourceLocationConverter) {
529529
self.diagnosticHandler = diagnosticHandler
530530
self.converter = converter
531-
super.init(viewMode: ._all)
531+
super.init(viewMode: .all)
532532
}
533533
override func visitAny(_ node: Syntax) -> SyntaxVisitorContinueKind {
534534
if node.isUnknown {

0 commit comments

Comments
 (0)