Skip to content

Commit 3fbed3a

Browse files
authored
Merge pull request swiftlang#236 from DougGregor/concurrency-contextual-await
[Concurrency] Regenerate for 'await' being a contextual keyword.
2 parents b6374bb + 8906281 commit 3fbed3a

File tree

6 files changed

+6
-26
lines changed

6 files changed

+6
-26
lines changed

Sources/SwiftSyntax/gyb_generated/Misc.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1944,6 +1944,6 @@ extension Syntax {
19441944
extension SyntaxParser {
19451945
static func verifyNodeDeclarationHash() -> Bool {
19461946
return String(cString: swiftparse_syntax_structure_versioning_identifier()!) ==
1947-
"71bf2d5d9308cb7092ce3660702fe668381dbbab"
1947+
"26709743ccc5ea2001419f44996c8fa671901c03"
19481948
}
19491949
}

Sources/SwiftSyntax/gyb_generated/SyntaxBuilders.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ public struct AwaitExprSyntaxBuilder {
274274

275275
internal mutating func buildData() -> SyntaxData {
276276
if (layout[0] == nil) {
277-
layout[0] = RawSyntax.missingToken(TokenKind.awaitKeyword)
277+
layout[0] = RawSyntax.missingToken(TokenKind.identifier(""))
278278
}
279279
if (layout[1] == nil) {
280280
layout[1] = RawSyntax.missing(SyntaxKind.expr)

Sources/SwiftSyntax/gyb_generated/SyntaxClassification.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,8 @@ extension SyntaxClassification {
6565
// Separate checks for token nodes (most common checks) versus checks for layout nodes.
6666
if childKind == .token {
6767
switch (parentKind, indexInParent) {
68+
case (.awaitExpr, 0):
69+
return (.keyword, false)
6870
case (.arrowExpr, 0):
6971
return (.keyword, false)
7072
case (.closureSignature, 2):
@@ -220,8 +222,6 @@ extension RawTokenKind {
220222
return .keyword
221223
case .throwsKeyword:
222224
return .keyword
223-
case .awaitKeyword:
224-
return .keyword
225225
case .__file__Keyword:
226226
return .keyword
227227
case .__line__Keyword:

Sources/SwiftSyntax/gyb_generated/SyntaxFactory.swift

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ public enum SyntaxFactory {
264264
public static func makeBlankAwaitExpr() -> AwaitExprSyntax {
265265
let data = SyntaxData.forRoot(RawSyntax.create(kind: .awaitExpr,
266266
layout: [
267-
RawSyntax.missingToken(TokenKind.awaitKeyword),
267+
RawSyntax.missingToken(TokenKind.identifier("")),
268268
RawSyntax.missing(SyntaxKind.expr),
269269
], length: .zero, presence: .present))
270270
return AwaitExprSyntax(data)
@@ -5066,12 +5066,6 @@ public enum SyntaxFactory {
50665066
leadingTrivia: leadingTrivia,
50675067
trailingTrivia: trailingTrivia)
50685068
}
5069-
public static func makeAwaitKeyword(leadingTrivia: Trivia = [],
5070-
trailingTrivia: Trivia = []) -> TokenSyntax {
5071-
return makeToken(.awaitKeyword, presence: .present,
5072-
leadingTrivia: leadingTrivia,
5073-
trailingTrivia: trailingTrivia)
5074-
}
50755069
public static func make__FILE__Keyword(leadingTrivia: Trivia = [],
50765070
trailingTrivia: Trivia = []) -> TokenSyntax {
50775071
return makeToken(.__file__Keyword, presence: .present,

Sources/SwiftSyntax/gyb_generated/TokenKind.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ public enum TokenKind {
6868
case trueKeyword
6969
case tryKeyword
7070
case throwsKeyword
71-
case awaitKeyword
7271
case __file__Keyword
7372
case __line__Keyword
7473
case __column__Keyword
@@ -196,7 +195,6 @@ public enum TokenKind {
196195
case .trueKeyword: return "true"
197196
case .tryKeyword: return "try"
198197
case .throwsKeyword: return "throws"
199-
case .awaitKeyword: return "__await"
200198
case .__file__Keyword: return "__FILE__"
201199
case .__line__Keyword: return "__LINE__"
202200
case .__column__Keyword: return "__COLUMN__"
@@ -325,7 +323,6 @@ public enum TokenKind {
325323
case .trueKeyword: return true
326324
case .tryKeyword: return true
327325
case .throwsKeyword: return true
328-
case .awaitKeyword: return true
329326
case .__file__Keyword: return true
330327
case .__line__Keyword: return true
331328
case .__column__Keyword: return true
@@ -454,7 +451,6 @@ public enum TokenKind {
454451
case .trueKeyword: return "kw_true"
455452
case .tryKeyword: return "kw_try"
456453
case .throwsKeyword: return "kw_throws"
457-
case .awaitKeyword: return "kw___await"
458454
case .__file__Keyword: return "kw___FILE__"
459455
case .__line__Keyword: return "kw___LINE__"
460456
case .__column__Keyword: return "kw___COLUMN__"
@@ -583,7 +579,6 @@ public enum TokenKind {
583579
case .trueKeyword: return SourceLength(utf8Length: 4)
584580
case .tryKeyword: return SourceLength(utf8Length: 3)
585581
case .throwsKeyword: return SourceLength(utf8Length: 6)
586-
case .awaitKeyword: return SourceLength(utf8Length: 7)
587582
case .__file__Keyword: return SourceLength(utf8Length: 8)
588583
case .__line__Keyword: return SourceLength(utf8Length: 8)
589584
case .__column__Keyword: return SourceLength(utf8Length: 10)
@@ -714,7 +709,6 @@ extension TokenKind: Equatable {
714709
case (.trueKeyword, .trueKeyword): return true
715710
case (.tryKeyword, .tryKeyword): return true
716711
case (.throwsKeyword, .throwsKeyword): return true
717-
case (.awaitKeyword, .awaitKeyword): return true
718712
case (.__file__Keyword, .__file__Keyword): return true
719713
case (.__line__Keyword, .__line__Keyword): return true
720714
case (.__column__Keyword, .__column__Keyword): return true
@@ -913,8 +907,6 @@ extension TokenKind {
913907
return .tryKeyword
914908
case 53:
915909
return .throwsKeyword
916-
case 123:
917-
return .awaitKeyword
918910
case 54:
919911
return .__file__Keyword
920912
case 55:
@@ -1175,8 +1167,6 @@ extension TokenKind {
11751167
return false
11761168
case 53:
11771169
return false
1178-
case 123:
1179-
return false
11801170
case 54:
11811171
return false
11821172
case 55:
@@ -1377,7 +1367,6 @@ internal enum RawTokenKind: CTokenKind {
13771367
case trueKeyword = 51
13781368
case tryKeyword = 52
13791369
case throwsKeyword = 53
1380-
case awaitKeyword = 123
13811370
case __file__Keyword = 54
13821371
case __line__Keyword = 55
13831372
case __column__Keyword = 56
@@ -1619,9 +1608,6 @@ extension TokenKind {
16191608
case .throwsKeyword:
16201609
let length = 6
16211610
return body(.init(kind: .throwsKeyword, length: length))
1622-
case .awaitKeyword:
1623-
let length = 7
1624-
return body(.init(kind: .awaitKeyword, length: length))
16251611
case .__file__Keyword:
16261612
let length = 8
16271613
return body(.init(kind: .__file__Keyword, length: length))

Sources/SwiftSyntax/gyb_generated/syntax_nodes/SyntaxExprNodes.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -412,7 +412,7 @@ public struct AwaitExprSyntax: ExprSyntaxProtocol, SyntaxHashable {
412412
/// current `awaitKeyword`, if present.
413413
public func withAwaitKeyword(
414414
_ newChild: TokenSyntax?) -> AwaitExprSyntax {
415-
let raw = newChild?.raw ?? RawSyntax.missingToken(TokenKind.awaitKeyword)
415+
let raw = newChild?.raw ?? RawSyntax.missingToken(TokenKind.identifier(""))
416416
let newData = data.replacingChild(raw, at: Cursor.awaitKeyword)
417417
return AwaitExprSyntax(newData)
418418
}

0 commit comments

Comments
 (0)