Skip to content

Commit 85d15cf

Browse files
committed
reverted changes
1 parent f1736a6 commit 85d15cf

File tree

8 files changed

+97
-97
lines changed

8 files changed

+97
-97
lines changed

Sources/SwiftOperators/OperatorTable+Semantics.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ extension OperatorTable {
9696
errors.append(error)
9797
}
9898

99-
override func visitOperatorDeclSyntax(
99+
override func visit(
100100
_ node: OperatorDeclSyntax
101101
) -> SyntaxVisitorContinueKind {
102102
opPrecedence.record(
@@ -106,7 +106,7 @@ extension OperatorTable {
106106
return .skipChildren
107107
}
108108

109-
override func visitPrecedenceGroupDeclSyntax(
109+
override func visit(
110110
_ node: PrecedenceGroupDeclSyntax
111111
) -> SyntaxVisitorContinueKind {
112112
opPrecedence.record(
@@ -117,19 +117,19 @@ extension OperatorTable {
117117
}
118118

119119
// Only visit top-level entities to find operators and precedence groups.
120-
override func visitSourceFileSyntax(
120+
override func visit(
121121
_ node: SourceFileSyntax
122122
) -> SyntaxVisitorContinueKind {
123123
return .visitChildren
124124
}
125125

126-
override func visitCodeBlockItemListSyntax(
126+
override func visit(
127127
_ node: CodeBlockItemListSyntax
128128
) -> SyntaxVisitorContinueKind {
129129
return .visitChildren
130130
}
131131

132-
override func visitCodeBlockItemSyntax(
132+
override func visit(
133133
_ node: CodeBlockItemSyntax
134134
) -> SyntaxVisitorContinueKind {
135135
return .visitChildren

Sources/SwiftParserDiagnostics/ParseDiagnosticsGenerator.swift

Lines changed: 69 additions & 69 deletions
Large diffs are not rendered by default.

Sources/SwiftSyntax/SourceLocation.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public struct SourceRange: Hashable, Codable {
107107
fileprivate class SourceLocationCollector: SyntaxVisitor {
108108
private var sourceLocationDirectives: [PoundSourceLocationSyntax] = []
109109

110-
override func visitPoundSourceLocationSyntax(_ node: PoundSourceLocationSyntax) -> SyntaxVisitorContinueKind {
110+
override func visit(_ node: PoundSourceLocationSyntax) -> SyntaxVisitorContinueKind {
111111
sourceLocationDirectives.append(node)
112112
return .skipChildren
113113
}

Sources/SwiftSyntaxMacroExpansion/MacroReplacement.swift

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -71,48 +71,48 @@ fileprivate class ParameterReplacementVisitor: SyntaxAnyVisitor {
7171
}
7272

7373
// Integer literals
74-
override func visitIntegerLiteralExprSyntax(_ node: IntegerLiteralExprSyntax) -> SyntaxVisitorContinueKind {
74+
override func visit(_ node: IntegerLiteralExprSyntax) -> SyntaxVisitorContinueKind {
7575
.visitChildren
7676
}
7777

7878
// Floating point literals
79-
override func visitFloatLiteralExprSyntax(_ node: FloatLiteralExprSyntax) -> SyntaxVisitorContinueKind {
79+
override func visit(_ node: FloatLiteralExprSyntax) -> SyntaxVisitorContinueKind {
8080
.visitChildren
8181
}
8282

8383
// nil literals
84-
override func visitNilLiteralExprSyntax(_ node: NilLiteralExprSyntax) -> SyntaxVisitorContinueKind {
84+
override func visit(_ node: NilLiteralExprSyntax) -> SyntaxVisitorContinueKind {
8585
.visitChildren
8686
}
8787

8888
// String literals
89-
override func visitStringLiteralExprSyntax(_ node: StringLiteralExprSyntax) -> SyntaxVisitorContinueKind {
89+
override func visit(_ node: StringLiteralExprSyntax) -> SyntaxVisitorContinueKind {
9090
.visitChildren
9191
}
9292

9393
// Array literals
94-
override func visitArrayExprSyntax(_ node: ArrayExprSyntax) -> SyntaxVisitorContinueKind {
94+
override func visit(_ node: ArrayExprSyntax) -> SyntaxVisitorContinueKind {
9595
.visitChildren
9696
}
9797

9898
// Dictionary literals
99-
override func visitDictionaryExprSyntax(_ node: DictionaryExprSyntax) -> SyntaxVisitorContinueKind {
99+
override func visit(_ node: DictionaryExprSyntax) -> SyntaxVisitorContinueKind {
100100
.visitChildren
101101
}
102102

103103
// Tuple literals
104-
override func visitTupleExprSyntax(_ node: TupleExprSyntax) -> SyntaxVisitorContinueKind {
104+
override func visit(_ node: TupleExprSyntax) -> SyntaxVisitorContinueKind {
105105
.visitChildren
106106
}
107107

108108
// Macro uses.
109-
override func visitMacroExpansionExprSyntax(_ node: MacroExpansionExprSyntax) -> SyntaxVisitorContinueKind {
109+
override func visit(_ node: MacroExpansionExprSyntax) -> SyntaxVisitorContinueKind {
110110
.visitChildren
111111
}
112112

113113
// References to declarations. Only accept those that refer to a parameter
114114
// of a macro.
115-
override func visitDeclReferenceExprSyntax(_ node: DeclReferenceExprSyntax) -> SyntaxVisitorContinueKind {
115+
override func visit(_ node: DeclReferenceExprSyntax) -> SyntaxVisitorContinueKind {
116116
let baseName = node.baseName
117117
let signature = macro.signature
118118

@@ -234,9 +234,9 @@ private final class MacroExpansionRewriter: SyntaxRewriter {
234234
super.init(viewMode: .sourceAccurate)
235235
}
236236

237-
override func visitDeclReferenceExprSyntax(_ node: DeclReferenceExprSyntax) -> ExprSyntax {
237+
override func visit(_ node: DeclReferenceExprSyntax) -> ExprSyntax {
238238
guard let parameterIndex = parameterReplacements[node] else {
239-
return super.visitDeclReferenceExprSyntax(node)
239+
return super.visit(node)
240240
}
241241

242242
// Swap in the argument for this parameter
@@ -266,7 +266,7 @@ extension MacroDeclSyntax {
266266
}
267267
),
268268
arguments: arguments
269-
).visitMacroExpansionExprSyntax(definition)
269+
).visit(definition)
270270
}
271271

272272
/// Given a freestanding macro expansion syntax node that references this

Tests/SwiftOperatorsTest/OperatorTableTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import _SwiftSyntaxTestSupport
1919
private class ExprSequenceSearcher: SyntaxAnyVisitor {
2020
var foundSequenceExpr = false
2121

22-
override func visitSequenceExprSyntax(
22+
override func visit(
2323
_ node: SequenceExprSyntax
2424
) -> SyntaxVisitorContinueKind {
2525
foundSequenceExpr = true
@@ -43,7 +43,7 @@ extension SyntaxProtocol {
4343
/// A syntax rewriter that folds explicitly-parenthesized sequence expressions
4444
/// into a structured syntax tree.
4545
class ExplicitParenFolder: SyntaxRewriter {
46-
override func visitTupleExprSyntax(_ node: TupleExprSyntax) -> ExprSyntax {
46+
override func visit(_ node: TupleExprSyntax) -> ExprSyntax {
4747
// Identify syntax nodes of the form (x (op) y), which is a
4848
// TupleExprSyntax(SequenceExpr(x, (op), y)).
4949
guard node.elements.count == 1,

Tests/SwiftParserTest/StringLiteralRepresentedLiteralValueTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ public class StringLiteralRepresentedLiteralValueTests: ParserTestCase {
311311
literals[line]?[index]
312312
}
313313

314-
override func visitStringLiteralExprSyntax(_ node: StringLiteralExprSyntax) -> SyntaxVisitorContinueKind {
314+
override func visit(_ node: StringLiteralExprSyntax) -> SyntaxVisitorContinueKind {
315315
let line = UInt(locationConverter?.location(for: node.position).line ?? 0)
316316
literals[line, default: []].append(node)
317317
return .visitChildren

Tests/SwiftSyntaxTest/SyntaxVisitorTests.swift

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ public class SyntaxVisitorTests: XCTestCase {
135135
public func testBasic() {
136136
class FuncCounter: SyntaxVisitor {
137137
var funcCount = 0
138-
override func visitFunctionDeclSyntax(_ node: FunctionDeclSyntax) -> SyntaxVisitorContinueKind {
138+
override func visit(_ node: FunctionDeclSyntax) -> SyntaxVisitorContinueKind {
139139
funcCount += 1
140140
return .visitChildren
141141
}
@@ -150,7 +150,7 @@ public class SyntaxVisitorTests: XCTestCase {
150150

151151
public func testRewritingNodeWithEmptyChild() {
152152
class ClosureRewriter: SyntaxRewriter {
153-
override func visitClosureExprSyntax(_ node: ClosureExprSyntax) -> ExprSyntax {
153+
override func visit(_ node: ClosureExprSyntax) -> ExprSyntax {
154154
// Perform a no-op transform that requires rebuilding the node.
155155
return ExprSyntax(node.with(\.statements, node.statements))
156156
}
@@ -181,15 +181,15 @@ public class SyntaxVisitorTests: XCTestCase {
181181
let rewriter = VisitAnyRewriter(transform: { _ in
182182
return TokenSyntax.identifier("")
183183
})
184-
let rewritten = rewriter.visitDeclReferenceExprSyntax(parsed)
184+
let rewritten = rewriter.visit(parsed)
185185
XCTAssertEqual(rewritten.description, "")
186186
}
187187

188188
public func testSyntaxRewriterVisitCollection() {
189189
class VisitCollections: SyntaxVisitor {
190190
var numberOfCodeBlockItems = 0
191191

192-
override func visitCodeBlockItemListSyntax(_ items: CodeBlockItemListSyntax) -> SyntaxVisitorContinueKind {
192+
override func visit(_ items: CodeBlockItemListSyntax) -> SyntaxVisitorContinueKind {
193193
numberOfCodeBlockItems += items.count
194194
return .visitChildren
195195
}
@@ -203,9 +203,9 @@ public class SyntaxVisitorTests: XCTestCase {
203203
public func testVisitorClass() {
204204
class FuncCounter: SyntaxVisitor {
205205
var funcCount = 0
206-
override func visitFunctionDeclSyntax(_ node: FunctionDeclSyntax) -> SyntaxVisitorContinueKind {
206+
override func visit(_ node: FunctionDeclSyntax) -> SyntaxVisitorContinueKind {
207207
funcCount += 1
208-
return super.visitFunctionDeclSyntax(node)
208+
return super.visit(node)
209209
}
210210
}
211211
let sourceFile = Self.nestedFunctionsFile

Tests/SwiftSyntaxTest/VisitorTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class VisitorTests: XCTestCase {
2020
class MissingExprChecker: SyntaxVisitor {
2121
var didSeeMissingExprSyntax = false
2222

23-
override func visitMissingExprSyntax(_ node: MissingExprSyntax) -> SyntaxVisitorContinueKind {
23+
override func visit(_ node: MissingExprSyntax) -> SyntaxVisitorContinueKind {
2424
didSeeMissingExprSyntax = true
2525
return .visitChildren
2626
}

0 commit comments

Comments
 (0)