@@ -150,12 +150,11 @@ extension TokenConsumer {
150
150
}
151
151
152
152
extension Parser {
153
- @_spi ( RawSyntax)
154
- public struct DeclAttributes {
155
- public var attributes : RawAttributeListSyntax ?
156
- public var modifiers : RawModifierListSyntax ?
153
+ struct DeclAttributes {
154
+ var attributes : RawAttributeListSyntax ?
155
+ var modifiers : RawModifierListSyntax ?
157
156
158
- public init ( attributes: RawAttributeListSyntax ? , modifiers: RawModifierListSyntax ? ) {
157
+ init ( attributes: RawAttributeListSyntax ? , modifiers: RawModifierListSyntax ? ) {
159
158
self . attributes = attributes
160
159
self . modifiers = modifiers
161
160
}
@@ -188,8 +187,7 @@ extension Parser {
188
187
///
189
188
/// If `inMemberDeclList` is `true`, we know that the next item must be a
190
189
/// declaration and thus start with a keyword. This allows futher recovery.
191
- @_spi ( RawSyntax)
192
- public mutating func parseDeclaration( inMemberDeclList: Bool = false ) -> RawDeclSyntax {
190
+ mutating func parseDeclaration( inMemberDeclList: Bool = false ) -> RawDeclSyntax {
193
191
switch self . at ( anyIn: PoundDeclarationStart . self) {
194
192
case ( . poundIfKeyword, _) ? :
195
193
if self . withLookahead ( { $0. consumeIfConfigOfAttributes ( ) } ) {
@@ -320,8 +318,7 @@ extension Parser {
320
318
/// import-declaration → attributes? 'import' import-kind? import-path
321
319
/// import-kind → 'typealias' | 'struct' | 'class' | 'enum' | 'protocol' | 'let' | 'var' | 'func'
322
320
/// import-path → identifier | identifier '.' import-path
323
- @_spi ( RawSyntax)
324
- public mutating func parseImportDeclaration(
321
+ mutating func parseImportDeclaration(
325
322
_ attrs: DeclAttributes ,
326
323
_ handle: RecoveryConsumptionHandle
327
324
) -> RawImportDeclSyntax {
@@ -339,8 +336,7 @@ extension Parser {
339
336
)
340
337
}
341
338
342
- @_spi ( RawSyntax)
343
- public mutating func parseImportKind( ) -> RawTokenSyntax ? {
339
+ mutating func parseImportKind( ) -> RawTokenSyntax ? {
344
340
enum ImportKind : TokenSpecSet {
345
341
case `typealias`
346
342
case `struct`
@@ -385,8 +381,7 @@ extension Parser {
385
381
return self . consume ( ifAnyIn: ImportKind . self)
386
382
}
387
383
388
- @_spi ( RawSyntax)
389
- public mutating func parseImportPath( ) -> RawImportPathSyntax {
384
+ mutating func parseImportPath( ) -> RawImportPathSyntax {
390
385
var elements = [ RawImportPathComponentSyntax] ( )
391
386
var keepGoing : RawTokenSyntax ? = nil
392
387
var loopProgress = LoopProgressCondition ( )
@@ -415,8 +410,7 @@ extension Parser {
415
410
/// extension-body → '{' extension-members? '}'
416
411
/// extension-members → extension-member extension-members?
417
412
/// extension-member → declaration | compiler-control-statement
418
- @_spi ( RawSyntax)
419
- public mutating func parseExtensionDeclaration(
413
+ mutating func parseExtensionDeclaration(
420
414
_ attrs: DeclAttributes ,
421
415
_ handle: RecoveryConsumptionHandle
422
416
) -> RawExtensionDeclSyntax {
@@ -468,8 +462,7 @@ extension Parser {
468
462
)
469
463
}
470
464
471
- @_spi ( RawSyntax)
472
- public mutating func parseGenericParameters( ) -> RawGenericParameterClauseSyntax {
465
+ mutating func parseGenericParameters( ) -> RawGenericParameterClauseSyntax {
473
466
if let remainingTokens = remainingTokensIfMaximumNestingLevelReached ( ) {
474
467
return RawGenericParameterClauseSyntax (
475
468
remainingTokens,
@@ -631,8 +624,7 @@ extension Parser {
631
624
}
632
625
}
633
626
634
- @_spi ( RawSyntax)
635
- public mutating func parseGenericWhereClause( ) -> RawGenericWhereClauseSyntax {
627
+ mutating func parseGenericWhereClause( ) -> RawGenericWhereClauseSyntax {
636
628
let ( unexpectedBeforeWhereKeyword, whereKeyword) = self . expect ( . keyword( . where) )
637
629
638
630
var elements = [ RawGenericRequirementSyntax] ( )
@@ -808,8 +800,7 @@ extension Parser {
808
800
}
809
801
810
802
extension Parser {
811
- @_spi ( RawSyntax)
812
- public mutating func parseMemberDeclListItem( ) -> RawMemberDeclListItemSyntax ? {
803
+ mutating func parseMemberDeclListItem( ) -> RawMemberDeclListItemSyntax ? {
813
804
if let remainingTokens = remainingTokensIfMaximumNestingLevelReached ( ) {
814
805
let item = RawMemberDeclListItemSyntax (
815
806
remainingTokens,
@@ -848,8 +839,7 @@ extension Parser {
848
839
/// `introducer` is the `struct`, `class`, ... keyword that is the cause that the member decl block is being parsed.
849
840
/// If the left brace is missing, its indentation will be used to judge whether a following `}` was
850
841
/// indented to close this code block or a surrounding context. See `expectRightBrace`.
851
- @_spi ( RawSyntax)
852
- public mutating func parseMemberDeclList( introducer: RawTokenSyntax ? = nil ) -> RawMemberDeclBlockSyntax {
842
+ mutating func parseMemberDeclList( introducer: RawTokenSyntax ? = nil ) -> RawMemberDeclBlockSyntax {
853
843
var elements = [ RawMemberDeclListItemSyntax] ( )
854
844
let ( unexpectedBeforeLBrace, lbrace) = self . expect ( . leftBrace)
855
845
do {
@@ -907,8 +897,7 @@ extension Parser {
907
897
/// raw-value-style-enum-case → enum-case-name raw-value-assignment?
908
898
/// raw-value-assignment → = raw-value-literal
909
899
/// raw-value-literal → numeric-literal | static-string-literal | boolean-literal
910
- @_spi ( RawSyntax)
911
- public mutating func parseEnumCaseDeclaration(
900
+ mutating func parseEnumCaseDeclaration(
912
901
_ attrs: DeclAttributes ,
913
902
_ handle: RecoveryConsumptionHandle
914
903
) -> RawEnumCaseDeclSyntax {
@@ -974,8 +963,7 @@ extension Parser {
974
963
/// =======
975
964
///
976
965
/// protocol-associated-type-declaration → attributes? access-level-modifier? 'associatedtype' typealias-name type-inheritance-clause? typealias-assignment? generic-where-clause?
977
- @_spi ( RawSyntax)
978
- public mutating func parseAssociatedTypeDeclaration(
966
+ mutating func parseAssociatedTypeDeclaration(
979
967
_ attrs: DeclAttributes ,
980
968
_ handle: RecoveryConsumptionHandle
981
969
) -> RawAssociatedtypeDeclSyntax {
@@ -1065,8 +1053,7 @@ extension Parser {
1065
1053
/// initializer-head → attributes? declaration-modifiers? 'init' '?'
1066
1054
/// initializer-head → attributes? declaration-modifiers? 'init' '!'
1067
1055
/// initializer-body → code-block
1068
- @_spi ( RawSyntax)
1069
- public mutating func parseInitializerDeclaration(
1056
+ mutating func parseInitializerDeclaration(
1070
1057
_ attrs: DeclAttributes ,
1071
1058
_ handle: RecoveryConsumptionHandle
1072
1059
) -> RawInitializerDeclSyntax {
@@ -1121,8 +1108,7 @@ extension Parser {
1121
1108
/// =======
1122
1109
///
1123
1110
/// deinitializer-declaration → attributes? 'deinit' code-block
1124
- @_spi ( RawSyntax)
1125
- public mutating func parseDeinitializerDeclaration(
1111
+ mutating func parseDeinitializerDeclaration(
1126
1112
_ attrs: DeclAttributes ,
1127
1113
_ handle: RecoveryConsumptionHandle
1128
1114
) -> RawDeinitializerDeclSyntax {
@@ -1170,8 +1156,7 @@ extension Parser {
1170
1156
}
1171
1157
1172
1158
extension Parser {
1173
- @_spi ( RawSyntax)
1174
- public mutating func parseFuncDeclaration(
1159
+ mutating func parseFuncDeclaration(
1175
1160
_ attrs: DeclAttributes ,
1176
1161
_ handle: RecoveryConsumptionHandle
1177
1162
) -> RawFunctionDeclSyntax {
@@ -1221,8 +1206,7 @@ extension Parser {
1221
1206
)
1222
1207
}
1223
1208
1224
- @_spi ( RawSyntax)
1225
- public mutating func parseFunctionSignature( allowOutput: Bool = true ) -> RawFunctionSignatureSyntax {
1209
+ mutating func parseFunctionSignature( allowOutput: Bool = true ) -> RawFunctionSignatureSyntax {
1226
1210
let input = self . parseParameterClause ( RawParameterClauseSyntax . self) { parser in
1227
1211
parser. parseFunctionParameter ( )
1228
1212
}
@@ -1268,8 +1252,7 @@ extension Parser {
1268
1252
/// subscript-declaration → subscript-head subscript-result generic-where-clause? getter-setter-keyword-block
1269
1253
/// subscript-head → attributes? declaration-modifiers? 'subscript' generic-parameter-clause? parameter-clause
1270
1254
/// subscript-result → '->' attributes? type
1271
- @_spi ( RawSyntax)
1272
- public mutating func parseSubscriptDeclaration(
1255
+ mutating func parseSubscriptDeclaration(
1273
1256
_ attrs: DeclAttributes ,
1274
1257
_ handle: RecoveryConsumptionHandle
1275
1258
) -> RawSubscriptDeclSyntax {
@@ -1349,8 +1332,7 @@ extension Parser {
1349
1332
/// }
1350
1333
/// }
1351
1334
/// ```
1352
- @_spi ( RawSyntax)
1353
- public mutating func parseBindingDeclaration(
1335
+ mutating func parseBindingDeclaration(
1354
1336
_ attrs: DeclAttributes ,
1355
1337
_ handle: RecoveryConsumptionHandle ,
1356
1338
inMemberDeclList: Bool = false
@@ -1572,8 +1554,7 @@ extension Parser {
1572
1554
/// getter-setter-block → code-block
1573
1555
/// getter-setter-block → { getter-clause setter-clause opt }
1574
1556
/// getter-setter-block → { setter-clause getter-clause }
1575
- @_spi ( RawSyntax)
1576
- public mutating func parseGetSet( ) -> RawSubscriptDeclSyntax . Accessor {
1557
+ mutating func parseGetSet( ) -> RawSubscriptDeclSyntax . Accessor {
1577
1558
// Parse getter and setter.
1578
1559
let unexpectedBeforeLBrace : RawUnexpectedNodesSyntax ?
1579
1560
let lbrace : RawTokenSyntax
@@ -1647,8 +1628,7 @@ extension Parser {
1647
1628
/// typealias-declaration → attributes? access-level-modifier? 'typealias' typealias-name generic-parameter-clause? typealias-assignment
1648
1629
/// typealias-name → identifier
1649
1630
/// typealias-assignment → '=' type
1650
- @_spi ( RawSyntax)
1651
- public mutating func parseTypealiasDeclaration(
1631
+ mutating func parseTypealiasDeclaration(
1652
1632
_ attrs: DeclAttributes ,
1653
1633
_ handle: RecoveryConsumptionHandle
1654
1634
) -> RawTypealiasDeclSyntax {
@@ -1714,8 +1694,7 @@ extension Parser {
1714
1694
/// postfix-operator-declaration → 'postfix' 'operator' operator
1715
1695
/// infix-operator-declaration → 'infix' 'operator' operator infix-operator-group?
1716
1696
/// infix-operator-group → ':' precedence-group-name
1717
- @_spi ( RawSyntax)
1718
- public mutating func parseOperatorDeclaration(
1697
+ mutating func parseOperatorDeclaration(
1719
1698
_ attrs: DeclAttributes ,
1720
1699
_ handle: RecoveryConsumptionHandle
1721
1700
) -> RawOperatorDeclSyntax {
@@ -1832,8 +1811,7 @@ extension Parser {
1832
1811
///
1833
1812
/// precedence-group-names → precedence-group-name | precedence-group-name ',' precedence-group-names
1834
1813
/// precedence-group-name → identifier
1835
- @_spi ( RawSyntax)
1836
- public mutating func parsePrecedenceGroupDeclaration(
1814
+ mutating func parsePrecedenceGroupDeclaration(
1837
1815
_ attrs: DeclAttributes ,
1838
1816
_ handle: RecoveryConsumptionHandle
1839
1817
) -> RawPrecedenceGroupDeclSyntax {
@@ -1860,8 +1838,7 @@ extension Parser {
1860
1838
)
1861
1839
}
1862
1840
1863
- @_spi ( RawSyntax)
1864
- public mutating func parsePrecedenceGroupAttributeListSyntax( ) -> RawPrecedenceGroupAttributeListSyntax {
1841
+ mutating func parsePrecedenceGroupAttributeListSyntax( ) -> RawPrecedenceGroupAttributeListSyntax {
1865
1842
enum LabelText : TokenSpecSet {
1866
1843
case associativity
1867
1844
case assignment
0 commit comments