Skip to content

Commit bed2ce4

Browse files
committed
[NFC] Improve wording and usage of subscript/deinit flag
1 parent b5f02c3 commit bed2ce4

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

include/swift/Parse/Parser.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1422,7 +1422,7 @@ class Parser {
14221422

14231423
/// If passed, 'deinit' and 'subscript' should be parsed as special names,
14241424
/// not ordinary identifiers.
1425-
UseSpecialNamesForDeinitAndSubscript = AllowKeywords | 1 << 2,
1425+
AllowKeywordsUsingSpecialNames = AllowKeywords | 1 << 2,
14261426

14271427
/// If passed, compound names with argument lists are allowed, unless they
14281428
/// have empty argument lists.

lib/Parse/ParseDecl.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1129,8 +1129,8 @@ ParserResult<DerivativeAttr> Parser::parseDerivativeAttribute(SourceLoc atLoc,
11291129
original.Name = parseDeclNameRef(original.Loc,
11301130
diag::attr_derivative_expected_original_name,
11311131
DeclNameFlag::AllowZeroArgCompoundNames |
1132-
DeclNameFlag::AllowKeywords | DeclNameFlag::AllowOperators |
1133-
DeclNameFlag::UseSpecialNamesForDeinitAndSubscript);
1132+
DeclNameFlag::AllowKeywordsUsingSpecialNames |
1133+
DeclNameFlag::AllowOperators);
11341134
}
11351135
if (consumeIfTrailingComma())
11361136
return makeParserError();
@@ -2061,8 +2061,8 @@ bool Parser::parseNewDeclAttribute(DeclAttributes &Attributes, SourceLoc AtLoc,
20612061
replacedFunction = parseDeclNameRef(loc,
20622062
diag::attr_dynamic_replacement_expected_function,
20632063
DeclNameFlag::AllowZeroArgCompoundNames |
2064-
DeclNameFlag::AllowKeywords | DeclNameFlag::AllowOperators |
2065-
DeclNameFlag::UseSpecialNamesForDeinitAndSubscript);
2064+
DeclNameFlag::AllowKeywordsUsingSpecialNames |
2065+
DeclNameFlag::AllowOperators);
20662066
}
20672067
}
20682068

lib/Parse/ParseExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2176,7 +2176,7 @@ DeclNameRef Parser::parseDeclNameRef(DeclNameLoc &loc,
21762176
baseNameLoc = consumeToken();
21772177
} else if (flags.contains(DeclNameFlag::AllowKeywords) && Tok.isKeyword()) {
21782178
bool specialDeinitAndSubscript =
2179-
flags.contains(DeclNameFlag::UseSpecialNamesForDeinitAndSubscript);
2179+
flags.contains(DeclNameFlag::AllowKeywordsUsingSpecialNames);
21802180

21812181
// Syntax highlighting should treat this token as an identifier and
21822182
// not as a keyword.

0 commit comments

Comments
 (0)