File tree Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Expand file tree Collapse file tree 2 files changed +54
-0
lines changed Original file line number Diff line number Diff line change @@ -218,6 +218,20 @@ extension SyntaxTransformVisitor {
218
218
fatalError ( " Not expression? " )
219
219
}
220
220
}
221
+
222
+ public func visit( _ data: PatternSyntax ) -> [ ResultType ] {
223
+ switch data. raw. kind {
224
+ % for node in NON_BASE_SYNTAX_NODES:
225
+ % if node. base_kind == " Pattern " :
226
+ case . ${ node. swift_syntax_kind} :
227
+ let node = data. as ( ${ node. name} . self) !
228
+ return visit ( node)
229
+ % end
230
+ % end
231
+ default :
232
+ fatalError ( " Not expression? " )
233
+ }
234
+ }
221
235
222
236
public func visitChildren< SyntaxType: SyntaxProtocol > ( _ node: SyntaxType ) -> [ ResultType ] {
223
237
let syntaxNode = Syntax ( node)
Original file line number Diff line number Diff line change @@ -10870,6 +10870,46 @@ extension SyntaxTransformVisitor {
10870
10870
fatalError ( " Not expression? " )
10871
10871
}
10872
10872
}
10873
+
10874
+ public func visit( _ data: PatternSyntax ) -> [ ResultType ] {
10875
+ switch data. raw. kind {
10876
+ case . unknownPattern:
10877
+ let node = data. as ( UnknownPatternSyntax . self) !
10878
+ return visit ( node)
10879
+ case . missingPattern:
10880
+ let node = data. as ( MissingPatternSyntax . self) !
10881
+ return visit ( node)
10882
+ case . enumCasePattern:
10883
+ let node = data. as ( EnumCasePatternSyntax . self) !
10884
+ return visit ( node)
10885
+ case . isTypePattern:
10886
+ let node = data. as ( IsTypePatternSyntax . self) !
10887
+ return visit ( node)
10888
+ case . optionalPattern:
10889
+ let node = data. as ( OptionalPatternSyntax . self) !
10890
+ return visit ( node)
10891
+ case . identifierPattern:
10892
+ let node = data. as ( IdentifierPatternSyntax . self) !
10893
+ return visit ( node)
10894
+ case . asTypePattern:
10895
+ let node = data. as ( AsTypePatternSyntax . self) !
10896
+ return visit ( node)
10897
+ case . tuplePattern:
10898
+ let node = data. as ( TuplePatternSyntax . self) !
10899
+ return visit ( node)
10900
+ case . wildcardPattern:
10901
+ let node = data. as ( WildcardPatternSyntax . self) !
10902
+ return visit ( node)
10903
+ case . expressionPattern:
10904
+ let node = data. as ( ExpressionPatternSyntax . self) !
10905
+ return visit ( node)
10906
+ case . valueBindingPattern:
10907
+ let node = data. as ( ValueBindingPatternSyntax . self) !
10908
+ return visit ( node)
10909
+ default :
10910
+ fatalError ( " Not expression? " )
10911
+ }
10912
+ }
10873
10913
10874
10914
public func visitChildren< SyntaxType: SyntaxProtocol > ( _ node: SyntaxType ) -> [ ResultType ] {
10875
10915
let syntaxNode = Syntax ( node)
You can’t perform that action at this time.
0 commit comments