@@ -21,18 +21,17 @@ extension Parser {
2121
2222 func parseIdentifierGroup( ) throws -> ( identifiers: [ Identifier ] , closeBracketToken: Token ) {
2323 try consume ( . punctuation( . openBracket) , or: . badDeclaration( at: latestSource) )
24- guard let closingIndex = indexOfFirstAtCurrentDepth ( [ . punctuation( . closeBracket) ] ) else {
25- throw raise ( . expectedCloseParen( at: latestSource) )
26- }
27- let identifiers = try parseIdentifierList ( upTo: closingIndex)
24+ let identifiers = try parseIdentifierList ( )
2825 let closeBracketToken = try consume ( . punctuation( . closeBracket) , or: . expectedCloseParen( at: latestSource) )
2926
3027 return ( identifiers, closeBracketToken)
3128 }
3229
33- func parseIdentifierList( upTo closingIndex : Int ) throws -> [ Identifier ] {
30+ func parseIdentifierList( ) throws -> [ Identifier ] {
3431 var identifiers = [ Identifier] ( )
35-
32+ guard let closingIndex = indexOfFirstAtCurrentDepth ( [ . punctuation( . closeBracket) ] ) else {
33+ return [ ]
34+ }
3635 while currentIndex < closingIndex {
3736 identifiers. append ( try parseIdentifier ( ) )
3837 if currentIndex < closingIndex {
@@ -158,15 +157,6 @@ extension Parser {
158157 return ( callerCapabilities, closeBracketToken)
159158 }
160159
161- // MARK: Conformances
162- func parseConformances( ) throws -> [ Identifier ] {
163- try consume ( . punctuation( . colon) , or: . expectedConformance( at: latestSource) )
164- guard let endOfConformances = indexOfFirstAtCurrentDepth ( [ . punctuation( . openBracket) , . newline, . punctuation( . openBrace) ] ) else {
165- throw raise ( . expectedConformance( at: latestSource) )
166- }
167- return try parseIdentifierList ( upTo: endOfConformances)
168- }
169-
170160 // MARK: Type State
171161 func parseTypeStateGroup( ) throws -> [ TypeState ] {
172162 let ( identifiers, _) = try parseIdentifierGroup ( )
0 commit comments