mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Parser] Consistently use consumeIdentifier() for normal identifiers.
consumeIdentifier() provides the general way in which we consume an identifier token and fill in an Identifier. Use it consistently in the parser.
This commit is contained in:
@@ -864,7 +864,12 @@ bool Parser::parseSpecificIdentifier(StringRef expected, SourceLoc &loc,
|
||||
/// its name in Result. Otherwise, emit an error and return true.
|
||||
bool Parser::parseAnyIdentifier(Identifier &Result, SourceLoc &Loc,
|
||||
const Diagnostic &D) {
|
||||
if (Tok.is(tok::identifier) || Tok.isAnyOperator()) {
|
||||
if (Tok.is(tok::identifier)) {
|
||||
Loc = consumeIdentifier(&Result);
|
||||
return false;
|
||||
}
|
||||
|
||||
if (Tok.isAnyOperator()) {
|
||||
Result = Context.getIdentifier(Tok.getText());
|
||||
Loc = Tok.getLoc();
|
||||
consumeToken();
|
||||
|
||||
Reference in New Issue
Block a user