Skip to content

Commit 23e4c01

Browse files
authored
Merge pull request #2423 from ahoppen/ahoppen/available-in-specialize
Remove ability to parse `available` in `@_specialize`
2 parents 714be46 + 4be26b0 commit 23e4c01

File tree

5 files changed

+2
-31
lines changed

5 files changed

+2
-31
lines changed

CodeGeneration/Sources/SyntaxSupport/AttributeNodes.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -629,7 +629,6 @@ public let ATTRIBUTE_NODES: [Node] = [
629629
.keyword(.kind),
630630
.keyword(.spi),
631631
.keyword(.spiModule),
632-
.keyword(.available),
633632
]),
634633
nameForDiagnostics: "label",
635634
documentation: "The label of the argument"

Sources/SwiftParser/Attributes.swift

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -689,25 +689,6 @@ extension Parser {
689689
)
690690
)
691691
)
692-
case (.available, let handle)?:
693-
let label = self.eat(handle)
694-
let (unexpectedBeforeColon, colon) = self.expect(.colon)
695-
// FIXME: I have no idea what this is supposed to be, but the Syntax
696-
// tree only allows us to insert a token so we'll take anything.
697-
let available = self.consumeAnyToken()
698-
let comma = self.consume(if: .comma)
699-
elements.append(
700-
.labeledSpecializeArgument(
701-
RawLabeledSpecializeArgumentSyntax(
702-
label: label,
703-
unexpectedBeforeColon,
704-
colon: colon,
705-
value: available,
706-
trailingComma: comma,
707-
arena: self.arena
708-
)
709-
)
710-
)
711692
case (.exported, let handle)?:
712693
let label = self.eat(handle)
713694
let (unexpectedBeforeColon, colon) = self.expect(.colon)

Sources/SwiftParser/generated/Parser+TokenSpecSet.swift

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1910,7 +1910,6 @@ extension LabeledSpecializeArgumentSyntax {
19101910
case kind
19111911
case spi
19121912
case spiModule
1913-
case available
19141913

19151914
init?(lexeme: Lexer.Lexeme, experimentalFeatures: Parser.ExperimentalFeatures) {
19161915
switch PrepareForKeywordMatch(lexeme) {
@@ -1926,8 +1925,6 @@ extension LabeledSpecializeArgumentSyntax {
19261925
self = .spi
19271926
case TokenSpec(.spiModule):
19281927
self = .spiModule
1929-
case TokenSpec(.available):
1930-
self = .available
19311928
default:
19321929
return nil
19331930
}
@@ -1947,8 +1944,6 @@ extension LabeledSpecializeArgumentSyntax {
19471944
return .keyword(.spi)
19481945
case .spiModule:
19491946
return .keyword(.spiModule)
1950-
case .available:
1951-
return .keyword(.available)
19521947
}
19531948
}
19541949

@@ -1970,8 +1965,6 @@ extension LabeledSpecializeArgumentSyntax {
19701965
return .keyword(.spi)
19711966
case .spiModule:
19721967
return .keyword(.spiModule)
1973-
case .available:
1974-
return .keyword(.available)
19751968
}
19761969
}
19771970
}

Sources/SwiftSyntax/generated/raw/RawSyntaxValidation.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,8 +1667,7 @@ func validateLayout(layout: RawSyntaxBuffer, as kind: SyntaxKind) {
16671667
.keyword("exported"),
16681668
.keyword("kind"),
16691669
.keyword("spi"),
1670-
.keyword("spiModule"),
1671-
.keyword("available")
1670+
.keyword("spiModule")
16721671
]))
16731672
assertNoError(kind, 2, verify(layout[2], as: RawUnexpectedNodesSyntax?.self))
16741673
assertNoError(kind, 3, verify(layout[3], as: RawTokenSyntax.self, tokenChoices: [.tokenKind(.colon)]))

Sources/SwiftSyntax/generated/syntaxNodes/SyntaxNodesJKLMN.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ public struct LabeledExprSyntax: SyntaxProtocol, SyntaxHashable, _LeafSyntaxNode
10041004
///
10051005
/// ### Children
10061006
///
1007-
/// - `label`: (`target` | `availability` | `exported` | `kind` | `spi` | `spiModule` | `available`)
1007+
/// - `label`: (`target` | `availability` | `exported` | `kind` | `spi` | `spiModule`)
10081008
/// - `colon`: `:`
10091009
/// - `value`: ``TokenSyntax``
10101010
/// - `trailingComma`: `,`?
@@ -1099,7 +1099,6 @@ public struct LabeledSpecializeArgumentSyntax: SyntaxProtocol, SyntaxHashable, _
10991099
/// - `kind`
11001100
/// - `spi`
11011101
/// - `spiModule`
1102-
/// - `available`
11031102
public var label: TokenSyntax {
11041103
get {
11051104
return Syntax(self).child(at: 1)!.cast(TokenSyntax.self)

0 commit comments

Comments
 (0)