Skip to content

Remove underscore from SyntaxViewingMode._all #567

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Sources/SwiftSyntax/Syntax.swift
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ public extension SyntaxProtocol {
target.write(String(describing: syntaxNodeType))
}

let allChildren = children(viewMode: ._all)
let allChildren = children(viewMode: .all)
if includeChildren {
if !allChildren.isEmpty {
target.write(" children=\(allChildren.count)")
Expand Down
6 changes: 2 additions & 4 deletions Sources/SwiftSyntax/SyntaxTreeViewMode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ public enum SyntaxTreeViewMode {
case fixedUp

/// Both missing and garbage nodes will be traversed.
/// Mostly useful for SwiftSyntax internal verifiers that verify the integrity
/// of the entire tree
case _all
case all

/// Returns whether this traversal node should visit `node` or ignore it.
func shouldTraverse(node: RawSyntax) -> Bool {
Expand All @@ -36,7 +34,7 @@ public enum SyntaxTreeViewMode {
return node.presence == .present
case .fixedUp:
return node.kind != .garbageNodes
case ._all:
case .all:
return true
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/SwiftSyntax/SyntaxVerifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class SyntaxVerifier: SyntaxAnyVisitor {
var unknownNodes: [Syntax] = []

init() {
super.init(viewMode: ._all)
super.init(viewMode: .all)
}

public override func visitAny(_ node: Syntax) -> SyntaxVisitorContinueKind {
Expand Down
2 changes: 1 addition & 1 deletion Sources/_SwiftSyntaxTestSupport/Syntax+Assertions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ fileprivate class SyntaxTypeFinder: SyntaxAnyVisitor {
self.offset = offset
self.type = type
self.found = nil
super.init(viewMode: ._all)
super.init(viewMode: .all)
}

fileprivate override func visitAny(_ node: Syntax) -> SyntaxVisitorContinueKind {
Expand Down
4 changes: 2 additions & 2 deletions Sources/_SwiftSyntaxTestSupport/SyntaxComparison.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,8 @@ public extension SyntaxProtocol {
return TreeDifference(node: self, baseline: baseline, reason: reason)
}

var iterator = children(viewMode: ._all).makeIterator()
var baseIterator = baseline.children(viewMode: ._all).makeIterator()
var iterator = children(viewMode: .all).makeIterator()
var baseIterator = baseline.children(viewMode: .all).makeIterator()
while let child = iterator.next() {
guard let baselineChild = baseIterator.next() else {
return TreeDifference(node: child, baseline: baseline, reason: .additionalNode)
Expand Down
2 changes: 1 addition & 1 deletion Sources/lit-test-helper/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ func diagnose(args: CommandLineArguments) throws {
init(diagnosticHandler: @escaping ((Diagnostic) -> Void), _ converter: SourceLocationConverter) {
self.diagnosticHandler = diagnosticHandler
self.converter = converter
super.init(viewMode: ._all)
super.init(viewMode: .all)
}
override func visitAny(_ node: Syntax) -> SyntaxVisitorContinueKind {
if node.isUnknown {
Expand Down