@@ -131,12 +131,11 @@ extension TokenConsumer {
131
131
}
132
132
133
133
extension Parser {
134
- @_spi ( RawSyntax)
135
- public struct DeclAttributes {
136
- public var attributes : RawAttributeListSyntax ?
137
- public var modifiers : RawModifierListSyntax ?
134
+ struct DeclAttributes {
135
+ var attributes : RawAttributeListSyntax ?
136
+ var modifiers : RawModifierListSyntax ?
138
137
139
- public init ( attributes: RawAttributeListSyntax ? , modifiers: RawModifierListSyntax ? ) {
138
+ init ( attributes: RawAttributeListSyntax ? , modifiers: RawModifierListSyntax ? ) {
140
139
self . attributes = attributes
141
140
self . modifiers = modifiers
142
141
}
@@ -169,8 +168,7 @@ extension Parser {
169
168
///
170
169
/// If `inMemberDeclList` is `true`, we know that the next item must be a
171
170
/// declaration and thus start with a keyword. This allows futher recovery.
172
- @_spi ( RawSyntax)
173
- public mutating func parseDeclaration( inMemberDeclList: Bool = false ) -> RawDeclSyntax {
171
+ mutating func parseDeclaration( inMemberDeclList: Bool = false ) -> RawDeclSyntax {
174
172
switch self . at ( anyIn: PoundDeclarationStart . self) {
175
173
case ( . poundIfKeyword, _) ? :
176
174
if self . withLookahead ( { $0. consumeIfConfigOfAttributes ( ) } ) {
@@ -303,8 +301,7 @@ extension Parser {
303
301
/// import-declaration → attributes? 'import' import-kind? import-path
304
302
/// import-kind → 'typealias' | 'struct' | 'class' | 'enum' | 'protocol' | 'let' | 'var' | 'func'
305
303
/// import-path → identifier | identifier '.' import-path
306
- @_spi ( RawSyntax)
307
- public mutating func parseImportDeclaration(
304
+ mutating func parseImportDeclaration(
308
305
_ attrs: DeclAttributes ,
309
306
_ handle: RecoveryConsumptionHandle
310
307
) -> RawImportDeclSyntax {
@@ -322,8 +319,7 @@ extension Parser {
322
319
)
323
320
}
324
321
325
- @_spi ( RawSyntax)
326
- public mutating func parseImportKind( ) -> RawTokenSyntax ? {
322
+ mutating func parseImportKind( ) -> RawTokenSyntax ? {
327
323
enum ImportKind : TokenSpecSet {
328
324
case `typealias`
329
325
case `struct`
@@ -368,8 +364,7 @@ extension Parser {
368
364
return self . consume ( ifAnyIn: ImportKind . self)
369
365
}
370
366
371
- @_spi ( RawSyntax)
372
- public mutating func parseImportAccessPath( ) -> RawAccessPathSyntax {
367
+ mutating func parseImportAccessPath( ) -> RawAccessPathSyntax {
373
368
var elements = [ RawAccessPathComponentSyntax] ( )
374
369
var keepGoing : RawTokenSyntax ? = nil
375
370
var loopProgress = LoopProgressCondition ( )
@@ -398,8 +393,7 @@ extension Parser {
398
393
/// extension-body → '{' extension-members? '}'
399
394
/// extension-members → extension-member extension-members?
400
395
/// extension-member → declaration | compiler-control-statement
401
- @_spi ( RawSyntax)
402
- public mutating func parseExtensionDeclaration(
396
+ mutating func parseExtensionDeclaration(
403
397
_ attrs: DeclAttributes ,
404
398
_ handle: RecoveryConsumptionHandle
405
399
) -> RawExtensionDeclSyntax {
@@ -451,8 +445,7 @@ extension Parser {
451
445
)
452
446
}
453
447
454
- @_spi ( RawSyntax)
455
- public mutating func parseGenericParameters( ) -> RawGenericParameterClauseSyntax {
448
+ mutating func parseGenericParameters( ) -> RawGenericParameterClauseSyntax {
456
449
if let remainingTokens = remainingTokensIfMaximumNestingLevelReached ( ) {
457
450
return RawGenericParameterClauseSyntax (
458
451
remainingTokens,
@@ -614,8 +607,7 @@ extension Parser {
614
607
}
615
608
}
616
609
617
- @_spi ( RawSyntax)
618
- public mutating func parseGenericWhereClause( ) -> RawGenericWhereClauseSyntax {
610
+ mutating func parseGenericWhereClause( ) -> RawGenericWhereClauseSyntax {
619
611
let ( unexpectedBeforeWhereKeyword, whereKeyword) = self . expect ( . keyword( . where) )
620
612
621
613
var elements = [ RawGenericRequirementSyntax] ( )
@@ -779,8 +771,7 @@ extension Parser {
779
771
}
780
772
781
773
extension Parser {
782
- @_spi ( RawSyntax)
783
- public mutating func parseMemberDeclListItem( ) -> RawMemberDeclListItemSyntax ? {
774
+ mutating func parseMemberDeclListItem( ) -> RawMemberDeclListItemSyntax ? {
784
775
if let remainingTokens = remainingTokensIfMaximumNestingLevelReached ( ) {
785
776
let item = RawMemberDeclListItemSyntax (
786
777
remainingTokens,
@@ -819,8 +810,7 @@ extension Parser {
819
810
/// `introducer` is the `struct`, `class`, ... keyword that is the cause that the member decl block is being parsed.
820
811
/// If the left brace is missing, its indentation will be used to judge whether a following `}` was
821
812
/// indented to close this code block or a surrounding context. See `expectRightBrace`.
822
- @_spi ( RawSyntax)
823
- public mutating func parseMemberDeclList( introducer: RawTokenSyntax ? = nil ) -> RawMemberDeclBlockSyntax {
813
+ mutating func parseMemberDeclList( introducer: RawTokenSyntax ? = nil ) -> RawMemberDeclBlockSyntax {
824
814
var elements = [ RawMemberDeclListItemSyntax] ( )
825
815
let ( unexpectedBeforeLBrace, lbrace) = self . expect ( . leftBrace)
826
816
do {
@@ -878,8 +868,7 @@ extension Parser {
878
868
/// raw-value-style-enum-case → enum-case-name raw-value-assignment?
879
869
/// raw-value-assignment → = raw-value-literal
880
870
/// raw-value-literal → numeric-literal | static-string-literal | boolean-literal
881
- @_spi ( RawSyntax)
882
- public mutating func parseEnumCaseDeclaration(
871
+ mutating func parseEnumCaseDeclaration(
883
872
_ attrs: DeclAttributes ,
884
873
_ handle: RecoveryConsumptionHandle
885
874
) -> RawEnumCaseDeclSyntax {
@@ -945,8 +934,7 @@ extension Parser {
945
934
/// =======
946
935
///
947
936
/// protocol-associated-type-declaration → attributes? access-level-modifier? 'associatedtype' typealias-name type-inheritance-clause? typealias-assignment? generic-where-clause?
948
- @_spi ( RawSyntax)
949
- public mutating func parseAssociatedTypeDeclaration(
937
+ mutating func parseAssociatedTypeDeclaration(
950
938
_ attrs: DeclAttributes ,
951
939
_ handle: RecoveryConsumptionHandle
952
940
) -> RawAssociatedtypeDeclSyntax {
@@ -1036,8 +1024,7 @@ extension Parser {
1036
1024
/// initializer-head → attributes? declaration-modifiers? 'init' '?'
1037
1025
/// initializer-head → attributes? declaration-modifiers? 'init' '!'
1038
1026
/// initializer-body → code-block
1039
- @_spi ( RawSyntax)
1040
- public mutating func parseInitializerDeclaration(
1027
+ mutating func parseInitializerDeclaration(
1041
1028
_ attrs: DeclAttributes ,
1042
1029
_ handle: RecoveryConsumptionHandle
1043
1030
) -> RawInitializerDeclSyntax {
@@ -1092,8 +1079,7 @@ extension Parser {
1092
1079
/// =======
1093
1080
///
1094
1081
/// deinitializer-declaration → attributes? 'deinit' code-block
1095
- @_spi ( RawSyntax)
1096
- public mutating func parseDeinitializerDeclaration(
1082
+ mutating func parseDeinitializerDeclaration(
1097
1083
_ attrs: DeclAttributes ,
1098
1084
_ handle: RecoveryConsumptionHandle
1099
1085
) -> RawDeinitializerDeclSyntax {
@@ -1141,8 +1127,7 @@ extension Parser {
1141
1127
}
1142
1128
1143
1129
extension Parser {
1144
- @_spi ( RawSyntax)
1145
- public mutating func parseFuncDeclaration(
1130
+ mutating func parseFuncDeclaration(
1146
1131
_ attrs: DeclAttributes ,
1147
1132
_ handle: RecoveryConsumptionHandle
1148
1133
) -> RawFunctionDeclSyntax {
@@ -1192,8 +1177,7 @@ extension Parser {
1192
1177
)
1193
1178
}
1194
1179
1195
- @_spi ( RawSyntax)
1196
- public mutating func parseFunctionSignature( allowOutput: Bool = true ) -> RawFunctionSignatureSyntax {
1180
+ mutating func parseFunctionSignature( allowOutput: Bool = true ) -> RawFunctionSignatureSyntax {
1197
1181
let input = self . parseParameterClause ( RawParameterClauseSyntax . self) { parser in
1198
1182
parser. parseFunctionParameter ( )
1199
1183
}
@@ -1239,8 +1223,7 @@ extension Parser {
1239
1223
/// subscript-declaration → subscript-head subscript-result generic-where-clause? getter-setter-keyword-block
1240
1224
/// subscript-head → attributes? declaration-modifiers? 'subscript' generic-parameter-clause? parameter-clause
1241
1225
/// subscript-result → '->' attributes? type
1242
- @_spi ( RawSyntax)
1243
- public mutating func parseSubscriptDeclaration(
1226
+ mutating func parseSubscriptDeclaration(
1244
1227
_ attrs: DeclAttributes ,
1245
1228
_ handle: RecoveryConsumptionHandle
1246
1229
) -> RawSubscriptDeclSyntax {
@@ -1320,8 +1303,7 @@ extension Parser {
1320
1303
/// }
1321
1304
/// }
1322
1305
/// ```
1323
- @_spi ( RawSyntax)
1324
- public mutating func parseBindingDeclaration(
1306
+ mutating func parseBindingDeclaration(
1325
1307
_ attrs: DeclAttributes ,
1326
1308
_ handle: RecoveryConsumptionHandle ,
1327
1309
inMemberDeclList: Bool = false
@@ -1543,8 +1525,7 @@ extension Parser {
1543
1525
/// getter-setter-block → code-block
1544
1526
/// getter-setter-block → { getter-clause setter-clause opt }
1545
1527
/// getter-setter-block → { setter-clause getter-clause }
1546
- @_spi ( RawSyntax)
1547
- public mutating func parseGetSet( ) -> RawSubscriptDeclSyntax . Accessor {
1528
+ mutating func parseGetSet( ) -> RawSubscriptDeclSyntax . Accessor {
1548
1529
// Parse getter and setter.
1549
1530
let unexpectedBeforeLBrace : RawUnexpectedNodesSyntax ?
1550
1531
let lbrace : RawTokenSyntax
@@ -1618,8 +1599,7 @@ extension Parser {
1618
1599
/// typealias-declaration → attributes? access-level-modifier? 'typealias' typealias-name generic-parameter-clause? typealias-assignment
1619
1600
/// typealias-name → identifier
1620
1601
/// typealias-assignment → '=' type
1621
- @_spi ( RawSyntax)
1622
- public mutating func parseTypealiasDeclaration(
1602
+ mutating func parseTypealiasDeclaration(
1623
1603
_ attrs: DeclAttributes ,
1624
1604
_ handle: RecoveryConsumptionHandle
1625
1605
) -> RawTypealiasDeclSyntax {
@@ -1685,8 +1665,7 @@ extension Parser {
1685
1665
/// postfix-operator-declaration → 'postfix' 'operator' operator
1686
1666
/// infix-operator-declaration → 'infix' 'operator' operator infix-operator-group?
1687
1667
/// infix-operator-group → ':' precedence-group-name
1688
- @_spi ( RawSyntax)
1689
- public mutating func parseOperatorDeclaration(
1668
+ mutating func parseOperatorDeclaration(
1690
1669
_ attrs: DeclAttributes ,
1691
1670
_ handle: RecoveryConsumptionHandle
1692
1671
) -> RawOperatorDeclSyntax {
@@ -1803,8 +1782,7 @@ extension Parser {
1803
1782
///
1804
1783
/// precedence-group-names → precedence-group-name | precedence-group-name ',' precedence-group-names
1805
1784
/// precedence-group-name → identifier
1806
- @_spi ( RawSyntax)
1807
- public mutating func parsePrecedenceGroupDeclaration(
1785
+ mutating func parsePrecedenceGroupDeclaration(
1808
1786
_ attrs: DeclAttributes ,
1809
1787
_ handle: RecoveryConsumptionHandle
1810
1788
) -> RawPrecedenceGroupDeclSyntax {
@@ -1831,8 +1809,7 @@ extension Parser {
1831
1809
)
1832
1810
}
1833
1811
1834
- @_spi ( RawSyntax)
1835
- public mutating func parsePrecedenceGroupAttributeListSyntax( ) -> RawPrecedenceGroupAttributeListSyntax {
1812
+ mutating func parsePrecedenceGroupAttributeListSyntax( ) -> RawPrecedenceGroupAttributeListSyntax {
1836
1813
enum LabelText : TokenSpecSet {
1837
1814
case associativity
1838
1815
case assignment
0 commit comments