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 @@ -10893,6 +10893,46 @@ extension SyntaxTransformVisitor {
10893
10893
fatalError ( " Not expression? " )
10894
10894
}
10895
10895
}
10896
+
10897
+ public func visit( _ data: PatternSyntax ) -> [ ResultType ] {
10898
+ switch data. raw. kind {
10899
+ case . unknownPattern:
10900
+ let node = data. as ( UnknownPatternSyntax . self) !
10901
+ return visit ( node)
10902
+ case . missingPattern:
10903
+ let node = data. as ( MissingPatternSyntax . self) !
10904
+ return visit ( node)
10905
+ case . enumCasePattern:
10906
+ let node = data. as ( EnumCasePatternSyntax . self) !
10907
+ return visit ( node)
10908
+ case . isTypePattern:
10909
+ let node = data. as ( IsTypePatternSyntax . self) !
10910
+ return visit ( node)
10911
+ case . optionalPattern:
10912
+ let node = data. as ( OptionalPatternSyntax . self) !
10913
+ return visit ( node)
10914
+ case . identifierPattern:
10915
+ let node = data. as ( IdentifierPatternSyntax . self) !
10916
+ return visit ( node)
10917
+ case . asTypePattern:
10918
+ let node = data. as ( AsTypePatternSyntax . self) !
10919
+ return visit ( node)
10920
+ case . tuplePattern:
10921
+ let node = data. as ( TuplePatternSyntax . self) !
10922
+ return visit ( node)
10923
+ case . wildcardPattern:
10924
+ let node = data. as ( WildcardPatternSyntax . self) !
10925
+ return visit ( node)
10926
+ case . expressionPattern:
10927
+ let node = data. as ( ExpressionPatternSyntax . self) !
10928
+ return visit ( node)
10929
+ case . valueBindingPattern:
10930
+ let node = data. as ( ValueBindingPatternSyntax . self) !
10931
+ return visit ( node)
10932
+ default :
10933
+ fatalError ( " Not expression? " )
10934
+ }
10935
+ }
10896
10936
10897
10937
public func visitChildren< SyntaxType: SyntaxProtocol > ( _ node: SyntaxType ) -> [ ResultType ] {
10898
10938
let syntaxNode = Syntax ( node)
You can’t perform that action at this time.
0 commit comments