@@ -901,25 +901,23 @@ extension Parser.Lookahead {
901901
902902extension Parser {
903903 private mutating func parseLifetimeTypeSpecifier( ) -> RawTypeSpecifierListSyntax . Element {
904- let specifier = self . eat ( TokenSpec ( . dependsOn) )
904+ let ( unexpectedBeforeDependsOnKeyword , dependsOnKeyword ) = self . expect ( . keyword ( . dependsOn) )
905905
906906 guard let leftParen = self . consume ( if: . leftParen) else {
907907 // If there is no left paren, add an entirely missing detail. Otherwise, we start to consume the following type
908908 // name as a token inside the detail, which leads to confusing recovery results.
909- let arguments = RawLifetimeSpecifierArgumentsSyntax (
910- arguments: RawLifetimeSpecifierArgumentListSyntax (
911- elements: [
912- RawLifetimeSpecifierArgumentSyntax ( parameter: missingToken ( . identifier) , trailingComma: nil , arena: arena)
913- ] ,
914- arena: self . arena
915- ) ,
909+ let lifetimeSpecifierArgumentList = RawLifetimeSpecifierArgumentListSyntax (
910+ elements: [
911+ RawLifetimeSpecifierArgumentSyntax ( parameter: missingToken ( . identifier) , trailingComma: nil , arena: arena)
912+ ] ,
916913 arena: self . arena
917914 )
918915 let lifetimeSpecifier = RawLifetimeTypeSpecifierSyntax (
919- dependsOnKeyword: specifier,
916+ unexpectedBeforeDependsOnKeyword,
917+ dependsOnKeyword: dependsOnKeyword,
920918 leftParen: missingToken ( . leftParen) ,
921919 scopedKeyword: nil ,
922- arguments: arguments ,
920+ arguments: lifetimeSpecifierArgumentList ,
923921 rightParen: missingToken ( . rightParen) ,
924922 arena: self . arena
925923 )
@@ -947,15 +945,12 @@ extension Parser {
947945 } while keepGoing != nil && self . hasProgressed ( & loopProgress)
948946 let lifetimeSpecifierArgumentList = RawLifetimeSpecifierArgumentListSyntax ( elements: arguments, arena: self . arena)
949947 let ( unexpectedBeforeRightParen, rightParen) = self . expect ( . rightParen)
950- let argumentsSyntax = RawLifetimeSpecifierArgumentsSyntax (
951- arguments: lifetimeSpecifierArgumentList,
952- arena: self . arena
953- )
954948 let lifetimeSpecifier = RawLifetimeTypeSpecifierSyntax (
955- dependsOnKeyword: specifier,
949+ unexpectedBeforeDependsOnKeyword,
950+ dependsOnKeyword: dependsOnKeyword,
956951 leftParen: leftParen,
957952 scopedKeyword: scoped,
958- arguments: argumentsSyntax ,
953+ arguments: lifetimeSpecifierArgumentList ,
959954 unexpectedBeforeRightParen,
960955 rightParen: rightParen,
961956 arena: self . arena
@@ -981,7 +976,7 @@ extension Parser {
981976 SPECIFIER_PARSING: while canHaveParameterSpecifier {
982977 if let ( _, specifierHandle) = self . at ( anyIn: SimpleTypeSpecifierSyntax . SpecifierOptions. self) {
983978 specifiers. append ( parseSimpleTypeSpecifier ( specifierHandle: specifierHandle) )
984- } else if self . at ( TokenSpec ( . dependsOn) ) {
979+ } else if self . at ( . keyword ( . dependsOn) ) {
985980 if self . experimentalFeatures. contains ( . nonescapableTypes) {
986981 specifiers. append ( parseLifetimeTypeSpecifier ( ) )
987982 } else {
0 commit comments