Skip to content

Commit d880053

Browse files
authored
Merge pull request #7050 from rintaro/parse-diag-consecutiveids
[Parse] Improve diagnostics for consecutive identifiers
2 parents 9dc03b4 + 9b4f549 commit d880053

File tree

6 files changed

+166
-233
lines changed

6 files changed

+166
-233
lines changed

include/swift/Parse/Parser.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -464,9 +464,6 @@ class Parser {
464464
/// Parse an #endif.
465465
bool parseEndIfDirective(SourceLoc &Loc);
466466

467-
/// True if Tok is the second consecutive identifier in a variable decl.
468-
bool isSecondVarIdentifier();
469-
470467
public:
471468
InFlightDiagnostic diagnose(SourceLoc Loc, Diagnostic Diag) {
472469
if (Diags.isDiagnosticPointsToFirstBadToken(Diag.getID()) &&
@@ -496,7 +493,8 @@ class Parser {
496493

497494
/// Add a fix-it to remove the space in consecutive identifiers.
498495
/// Add a camel-cased option if it is different than the first option.
499-
void diagnoseConsecutiveIDs(Token First, Token Second);
496+
void diagnoseConsecutiveIDs(StringRef First, SourceLoc FirstLoc,
497+
StringRef DeclKindName);
500498

501499
/// \brief Check whether the current token starts with '<'.
502500
bool startsWithLess(Token Tok) {

0 commit comments

Comments
 (0)