@@ -768,11 +768,10 @@ Parser::parseImplementsAttribute(SourceLoc AtLoc, SourceLoc Loc) {
768
768
}
769
769
770
770
if (!Status.shouldStopParsing ()) {
771
- MemberName =
772
- parseUnqualifiedDeclName (/* afterDot=*/ false , MemberNameLoc,
773
- diag::attr_implements_expected_member_name,
774
- /* allowOperators=*/ true ,
775
- /* allowZeroArgCompoundNames=*/ true );
771
+ MemberName = parseDeclNameRef (MemberNameLoc,
772
+ diag::attr_implements_expected_member_name,
773
+ DeclNameFlag::AllowZeroArgCompoundNames |
774
+ DeclNameFlag::AllowOperators);
776
775
if (!MemberName) {
777
776
Status.setIsParseError ();
778
777
}
@@ -1022,10 +1021,8 @@ bool Parser::parseDifferentiableAttributeArguments(
1022
1021
SyntaxContext, SyntaxKind::FunctionDeclName);
1023
1022
Diagnostic funcDiag (diag::attr_differentiable_expected_function_name.ID ,
1024
1023
{ label });
1025
- result.Name =
1026
- parseUnqualifiedDeclName (/* afterDot=*/ false , result.Loc ,
1027
- funcDiag, /* allowOperators=*/ true ,
1028
- /* allowZeroArgCompoundNames=*/ true );
1024
+ result.Name = parseDeclNameRef (result.Loc , funcDiag,
1025
+ DeclNameFlag::AllowZeroArgCompoundNames | DeclNameFlag::AllowOperators);
1029
1026
// If no trailing comma or 'where' clause, terminate parsing arguments.
1030
1027
if (Tok.isNot (tok::comma, tok::kw_where))
1031
1028
terminateParsingArgs = true ;
@@ -1129,10 +1126,11 @@ ParserResult<DerivativeAttr> Parser::parseDerivativeAttribute(SourceLoc atLoc,
1129
1126
SyntaxKind::FunctionDeclName);
1130
1127
// NOTE: Use `afterDot = true` and `allowDeinitAndSubscript = true` to
1131
1128
// enable, e.g. `@derivative(of: init)` and `@derivative(of: subscript)`.
1132
- original.Name = parseUnqualifiedDeclName (
1133
- /* afterDot*/ true , original.Loc ,
1134
- diag::attr_derivative_expected_original_name, /* allowOperators*/ true ,
1135
- /* allowZeroArgCompoundNames*/ true , /* allowDeinitAndSubscript*/ true );
1129
+ original.Name = parseDeclNameRef (original.Loc ,
1130
+ diag::attr_derivative_expected_original_name,
1131
+ DeclNameFlag::AllowZeroArgCompoundNames |
1132
+ DeclNameFlag::AllowKeywordsUsingSpecialNames |
1133
+ DeclNameFlag::AllowOperators);
1136
1134
}
1137
1135
if (consumeIfTrailingComma ())
1138
1136
return makeParserError ();
@@ -2060,10 +2058,11 @@ bool Parser::parseNewDeclAttribute(DeclAttributes &Attributes, SourceLoc AtLoc,
2060
2058
SyntaxKind::DeclName);
2061
2059
2062
2060
DeclNameLoc loc;
2063
- replacedFunction = parseUnqualifiedDeclName (
2064
- true , loc, diag::attr_dynamic_replacement_expected_function,
2065
- /* allowOperators*/ true , /* allowZeroArgCompoundNames*/ true ,
2066
- /* allowDeinitAndSubscript*/ true );
2061
+ replacedFunction = parseDeclNameRef (loc,
2062
+ diag::attr_dynamic_replacement_expected_function,
2063
+ DeclNameFlag::AllowZeroArgCompoundNames |
2064
+ DeclNameFlag::AllowKeywordsUsingSpecialNames |
2065
+ DeclNameFlag::AllowOperators);
2067
2066
}
2068
2067
}
2069
2068
@@ -2572,11 +2571,9 @@ bool Parser::parseConventionAttributeInternal(
2572
2571
return true ;
2573
2572
}
2574
2573
2575
- DeclNameLoc unusedWitnessMethodProtocolLoc;
2576
- convention.WitnessMethodProtocol = parseUnqualifiedDeclBaseName (
2577
- /* afterDot=*/ false , unusedWitnessMethodProtocolLoc,
2578
- diag::convention_attribute_witness_method_expected_protocol
2579
- );
2574
+ DeclNameLoc unusedLoc;
2575
+ convention.WitnessMethodProtocol = parseDeclNameRef (unusedLoc,
2576
+ diag::convention_attribute_witness_method_expected_protocol, {});
2580
2577
}
2581
2578
2582
2579
// Parse the ')'. We can't use parseMatchingToken if we're in
0 commit comments