@@ -983,6 +983,8 @@ public struct ForInStmtSyntax: StmtSyntaxProtocol, SyntaxHashable {
983
983
case labelName
984
984
case labelColon
985
985
case forKeyword
986
+ case tryKeyword
987
+ case awaitKeyword
986
988
case caseKeyword
987
989
case pattern
988
990
case typeAnnotation
@@ -1078,6 +1080,50 @@ public struct ForInStmtSyntax: StmtSyntaxProtocol, SyntaxHashable {
1078
1080
return ForInStmtSyntax ( newData)
1079
1081
}
1080
1082
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
+
1081
1127
public var caseKeyword : TokenSyntax ? {
1082
1128
get {
1083
1129
let childData = data. child ( at: Cursor . caseKeyword,
@@ -1231,7 +1277,7 @@ public struct ForInStmtSyntax: StmtSyntaxProtocol, SyntaxHashable {
1231
1277
1232
1278
public func _validateLayout( ) {
1233
1279
let rawChildren = Array ( RawSyntaxChildren ( Syntax ( self ) ) )
1234
- assert ( rawChildren. count == 10 )
1280
+ assert ( rawChildren. count == 12 )
1235
1281
// Check child #0 child is TokenSyntax or missing
1236
1282
if let raw = rawChildren [ 0 ] . raw {
1237
1283
let info = rawChildren [ 0 ] . syntaxInfo
@@ -1265,56 +1311,72 @@ public struct ForInStmtSyntax: StmtSyntaxProtocol, SyntaxHashable {
1265
1311
let syntaxChild = Syntax ( syntaxData)
1266
1312
assert ( syntaxChild. is ( TokenSyntax . self) )
1267
1313
}
1268
- // Check child #4 child is PatternSyntax
1269
- assert ( rawChildren [ 4 ] . raw != nil )
1314
+ // Check child #4 child is TokenSyntax or missing
1270
1315
if let raw = rawChildren [ 4 ] . raw {
1271
1316
let info = rawChildren [ 4 ] . syntaxInfo
1272
1317
let absoluteRaw = AbsoluteRawSyntax ( raw: raw, info: info)
1273
1318
let syntaxData = SyntaxData ( absoluteRaw, parent: Syntax ( self ) )
1274
1319
let syntaxChild = Syntax ( syntaxData)
1275
- assert ( syntaxChild. is ( PatternSyntax . self) )
1320
+ assert ( syntaxChild. is ( TokenSyntax . self) )
1276
1321
}
1277
- // Check child #5 child is TypeAnnotationSyntax or missing
1322
+ // Check child #5 child is TokenSyntax or missing
1278
1323
if let raw = rawChildren [ 5 ] . raw {
1279
1324
let info = rawChildren [ 5 ] . syntaxInfo
1280
1325
let absoluteRaw = AbsoluteRawSyntax ( raw: raw, info: info)
1281
1326
let syntaxData = SyntaxData ( absoluteRaw, parent: Syntax ( self ) )
1282
1327
let syntaxChild = Syntax ( syntaxData)
1283
- assert ( syntaxChild. is ( TypeAnnotationSyntax . self) )
1328
+ assert ( syntaxChild. is ( TokenSyntax . self) )
1284
1329
}
1285
- // Check child #6 child is TokenSyntax
1330
+ // Check child #6 child is PatternSyntax
1286
1331
assert ( rawChildren [ 6 ] . raw != nil )
1287
1332
if let raw = rawChildren [ 6 ] . raw {
1288
1333
let info = rawChildren [ 6 ] . syntaxInfo
1289
1334
let absoluteRaw = AbsoluteRawSyntax ( raw: raw, info: info)
1290
1335
let syntaxData = SyntaxData ( absoluteRaw, parent: Syntax ( self ) )
1291
1336
let syntaxChild = Syntax ( syntaxData)
1292
- assert ( syntaxChild. is ( TokenSyntax . self) )
1337
+ assert ( syntaxChild. is ( PatternSyntax . self) )
1293
1338
}
1294
- // Check child #7 child is ExprSyntax
1295
- assert ( rawChildren [ 7 ] . raw != nil )
1339
+ // Check child #7 child is TypeAnnotationSyntax or missing
1296
1340
if let raw = rawChildren [ 7 ] . raw {
1297
1341
let info = rawChildren [ 7 ] . syntaxInfo
1298
1342
let absoluteRaw = AbsoluteRawSyntax ( raw: raw, info: info)
1299
1343
let syntaxData = SyntaxData ( absoluteRaw, parent: Syntax ( self ) )
1300
1344
let syntaxChild = Syntax ( syntaxData)
1301
- assert ( syntaxChild. is ( ExprSyntax . self) )
1345
+ assert ( syntaxChild. is ( TypeAnnotationSyntax . self) )
1302
1346
}
1303
- // Check child #8 child is WhereClauseSyntax or missing
1347
+ // Check child #8 child is TokenSyntax
1348
+ assert ( rawChildren [ 8 ] . raw != nil )
1304
1349
if let raw = rawChildren [ 8 ] . raw {
1305
1350
let info = rawChildren [ 8 ] . syntaxInfo
1306
1351
let absoluteRaw = AbsoluteRawSyntax ( raw: raw, info: info)
1307
1352
let syntaxData = SyntaxData ( absoluteRaw, parent: Syntax ( self ) )
1308
1353
let syntaxChild = Syntax ( syntaxData)
1309
- assert ( syntaxChild. is ( WhereClauseSyntax . self) )
1354
+ assert ( syntaxChild. is ( TokenSyntax . self) )
1310
1355
}
1311
- // Check child #9 child is CodeBlockSyntax
1356
+ // Check child #9 child is ExprSyntax
1312
1357
assert ( rawChildren [ 9 ] . raw != nil )
1313
1358
if let raw = rawChildren [ 9 ] . raw {
1314
1359
let info = rawChildren [ 9 ] . syntaxInfo
1315
1360
let absoluteRaw = AbsoluteRawSyntax ( raw: raw, info: info)
1316
1361
let syntaxData = SyntaxData ( absoluteRaw, parent: Syntax ( self ) )
1317
1362
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)
1318
1380
assert ( syntaxChild. is ( CodeBlockSyntax . self) )
1319
1381
}
1320
1382
}
@@ -1326,6 +1388,8 @@ extension ForInStmtSyntax: CustomReflectable {
1326
1388
" labelName " : labelName. map ( Syntax . init) ? . asProtocol ( SyntaxProtocol . self) as Any ,
1327
1389
" labelColon " : labelColon. map ( Syntax . init) ? . asProtocol ( SyntaxProtocol . self) as Any ,
1328
1390
" 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 ,
1329
1393
" caseKeyword " : caseKeyword. map ( Syntax . init) ? . asProtocol ( SyntaxProtocol . self) as Any ,
1330
1394
" pattern " : Syntax ( pattern) . asProtocol ( SyntaxProtocol . self) ,
1331
1395
" typeAnnotation " : typeAnnotation. map ( Syntax . init) ? . asProtocol ( SyntaxProtocol . self) as Any ,
0 commit comments