@@ -983,6 +983,8 @@ public struct ForInStmtSyntax: StmtSyntaxProtocol, SyntaxHashable {
983983 case labelName
984984 case labelColon
985985 case forKeyword
986+ case tryKeyword
987+ case awaitKeyword
986988 case caseKeyword
987989 case pattern
988990 case typeAnnotation
@@ -1078,6 +1080,50 @@ public struct ForInStmtSyntax: StmtSyntaxProtocol, SyntaxHashable {
10781080 return ForInStmtSyntax ( newData)
10791081 }
10801082
1083+ public var tryKeyword : TokenSyntax ? {
1084+ get {
1085+ let childData = data. child ( at: Cursor . tryKeyword,
1086+ parent: Syntax ( self ) )
1087+ if childData == nil { return nil }
1088+ return TokenSyntax ( childData!)
1089+ }
1090+ set ( value) {
1091+ self = withTryKeyword ( value)
1092+ }
1093+ }
1094+
1095+ /// Returns a copy of the receiver with its `tryKeyword` replaced.
1096+ /// - param newChild: The new `tryKeyword` to replace the node's
1097+ /// current `tryKeyword`, if present.
1098+ public func withTryKeyword(
1099+ _ newChild: TokenSyntax ? ) -> ForInStmtSyntax {
1100+ let raw = newChild? . raw
1101+ let newData = data. replacingChild ( raw, at: Cursor . tryKeyword)
1102+ return ForInStmtSyntax ( newData)
1103+ }
1104+
1105+ public var awaitKeyword : TokenSyntax ? {
1106+ get {
1107+ let childData = data. child ( at: Cursor . awaitKeyword,
1108+ parent: Syntax ( self ) )
1109+ if childData == nil { return nil }
1110+ return TokenSyntax ( childData!)
1111+ }
1112+ set ( value) {
1113+ self = withAwaitKeyword ( value)
1114+ }
1115+ }
1116+
1117+ /// Returns a copy of the receiver with its `awaitKeyword` replaced.
1118+ /// - param newChild: The new `awaitKeyword` to replace the node's
1119+ /// current `awaitKeyword`, if present.
1120+ public func withAwaitKeyword(
1121+ _ newChild: TokenSyntax ? ) -> ForInStmtSyntax {
1122+ let raw = newChild? . raw
1123+ let newData = data. replacingChild ( raw, at: Cursor . awaitKeyword)
1124+ return ForInStmtSyntax ( newData)
1125+ }
1126+
10811127 public var caseKeyword : TokenSyntax ? {
10821128 get {
10831129 let childData = data. child ( at: Cursor . caseKeyword,
@@ -1231,7 +1277,7 @@ public struct ForInStmtSyntax: StmtSyntaxProtocol, SyntaxHashable {
12311277
12321278 public func _validateLayout( ) {
12331279 let rawChildren = Array ( RawSyntaxChildren ( Syntax ( self ) ) )
1234- assert ( rawChildren. count == 10 )
1280+ assert ( rawChildren. count == 12 )
12351281 // Check child #0 child is TokenSyntax or missing
12361282 if let raw = rawChildren [ 0 ] . raw {
12371283 let info = rawChildren [ 0 ] . syntaxInfo
@@ -1265,56 +1311,72 @@ public struct ForInStmtSyntax: StmtSyntaxProtocol, SyntaxHashable {
12651311 let syntaxChild = Syntax ( syntaxData)
12661312 assert ( syntaxChild. is ( TokenSyntax . self) )
12671313 }
1268- // Check child #4 child is PatternSyntax
1269- assert ( rawChildren [ 4 ] . raw != nil )
1314+ // Check child #4 child is TokenSyntax or missing
12701315 if let raw = rawChildren [ 4 ] . raw {
12711316 let info = rawChildren [ 4 ] . syntaxInfo
12721317 let absoluteRaw = AbsoluteRawSyntax ( raw: raw, info: info)
12731318 let syntaxData = SyntaxData ( absoluteRaw, parent: Syntax ( self ) )
12741319 let syntaxChild = Syntax ( syntaxData)
1275- assert ( syntaxChild. is ( PatternSyntax . self) )
1320+ assert ( syntaxChild. is ( TokenSyntax . self) )
12761321 }
1277- // Check child #5 child is TypeAnnotationSyntax or missing
1322+ // Check child #5 child is TokenSyntax or missing
12781323 if let raw = rawChildren [ 5 ] . raw {
12791324 let info = rawChildren [ 5 ] . syntaxInfo
12801325 let absoluteRaw = AbsoluteRawSyntax ( raw: raw, info: info)
12811326 let syntaxData = SyntaxData ( absoluteRaw, parent: Syntax ( self ) )
12821327 let syntaxChild = Syntax ( syntaxData)
1283- assert ( syntaxChild. is ( TypeAnnotationSyntax . self) )
1328+ assert ( syntaxChild. is ( TokenSyntax . self) )
12841329 }
1285- // Check child #6 child is TokenSyntax
1330+ // Check child #6 child is PatternSyntax
12861331 assert ( rawChildren [ 6 ] . raw != nil )
12871332 if let raw = rawChildren [ 6 ] . raw {
12881333 let info = rawChildren [ 6 ] . syntaxInfo
12891334 let absoluteRaw = AbsoluteRawSyntax ( raw: raw, info: info)
12901335 let syntaxData = SyntaxData ( absoluteRaw, parent: Syntax ( self ) )
12911336 let syntaxChild = Syntax ( syntaxData)
1292- assert ( syntaxChild. is ( TokenSyntax . self) )
1337+ assert ( syntaxChild. is ( PatternSyntax . self) )
12931338 }
1294- // Check child #7 child is ExprSyntax
1295- assert ( rawChildren [ 7 ] . raw != nil )
1339+ // Check child #7 child is TypeAnnotationSyntax or missing
12961340 if let raw = rawChildren [ 7 ] . raw {
12971341 let info = rawChildren [ 7 ] . syntaxInfo
12981342 let absoluteRaw = AbsoluteRawSyntax ( raw: raw, info: info)
12991343 let syntaxData = SyntaxData ( absoluteRaw, parent: Syntax ( self ) )
13001344 let syntaxChild = Syntax ( syntaxData)
1301- assert ( syntaxChild. is ( ExprSyntax . self) )
1345+ assert ( syntaxChild. is ( TypeAnnotationSyntax . self) )
13021346 }
1303- // Check child #8 child is WhereClauseSyntax or missing
1347+ // Check child #8 child is TokenSyntax
1348+ assert ( rawChildren [ 8 ] . raw != nil )
13041349 if let raw = rawChildren [ 8 ] . raw {
13051350 let info = rawChildren [ 8 ] . syntaxInfo
13061351 let absoluteRaw = AbsoluteRawSyntax ( raw: raw, info: info)
13071352 let syntaxData = SyntaxData ( absoluteRaw, parent: Syntax ( self ) )
13081353 let syntaxChild = Syntax ( syntaxData)
1309- assert ( syntaxChild. is ( WhereClauseSyntax . self) )
1354+ assert ( syntaxChild. is ( TokenSyntax . self) )
13101355 }
1311- // Check child #9 child is CodeBlockSyntax
1356+ // Check child #9 child is ExprSyntax
13121357 assert ( rawChildren [ 9 ] . raw != nil )
13131358 if let raw = rawChildren [ 9 ] . raw {
13141359 let info = rawChildren [ 9 ] . syntaxInfo
13151360 let absoluteRaw = AbsoluteRawSyntax ( raw: raw, info: info)
13161361 let syntaxData = SyntaxData ( absoluteRaw, parent: Syntax ( self ) )
13171362 let syntaxChild = Syntax ( syntaxData)
1363+ assert ( syntaxChild. is ( ExprSyntax . self) )
1364+ }
1365+ // Check child #10 child is WhereClauseSyntax or missing
1366+ if let raw = rawChildren [ 10 ] . raw {
1367+ let info = rawChildren [ 10 ] . syntaxInfo
1368+ let absoluteRaw = AbsoluteRawSyntax ( raw: raw, info: info)
1369+ let syntaxData = SyntaxData ( absoluteRaw, parent: Syntax ( self ) )
1370+ let syntaxChild = Syntax ( syntaxData)
1371+ assert ( syntaxChild. is ( WhereClauseSyntax . self) )
1372+ }
1373+ // Check child #11 child is CodeBlockSyntax
1374+ assert ( rawChildren [ 11 ] . raw != nil )
1375+ if let raw = rawChildren [ 11 ] . raw {
1376+ let info = rawChildren [ 11 ] . syntaxInfo
1377+ let absoluteRaw = AbsoluteRawSyntax ( raw: raw, info: info)
1378+ let syntaxData = SyntaxData ( absoluteRaw, parent: Syntax ( self ) )
1379+ let syntaxChild = Syntax ( syntaxData)
13181380 assert ( syntaxChild. is ( CodeBlockSyntax . self) )
13191381 }
13201382 }
@@ -1326,6 +1388,8 @@ extension ForInStmtSyntax: CustomReflectable {
13261388 " labelName " : labelName. map ( Syntax . init) ? . asProtocol ( SyntaxProtocol . self) as Any ,
13271389 " labelColon " : labelColon. map ( Syntax . init) ? . asProtocol ( SyntaxProtocol . self) as Any ,
13281390 " forKeyword " : Syntax ( forKeyword) . asProtocol ( SyntaxProtocol . self) ,
1391+ " tryKeyword " : tryKeyword. map ( Syntax . init) ? . asProtocol ( SyntaxProtocol . self) as Any ,
1392+ " awaitKeyword " : awaitKeyword. map ( Syntax . init) ? . asProtocol ( SyntaxProtocol . self) as Any ,
13291393 " caseKeyword " : caseKeyword. map ( Syntax . init) ? . asProtocol ( SyntaxProtocol . self) as Any ,
13301394 " pattern " : Syntax ( pattern) . asProtocol ( SyntaxProtocol . self) ,
13311395 " typeAnnotation " : typeAnnotation. map ( Syntax . init) ? . asProtocol ( SyntaxProtocol . self) as Any ,
0 commit comments