|
19 | 19 |
|
20 | 20 | #include "swift/AST/ASTContext.h"
|
21 | 21 | #include "swift/AST/ASTNode.h"
|
22 |
| -#include "swift/AST/DiagnosticsParse.h" |
23 | 22 | #include "swift/AST/Expr.h"
|
24 | 23 | #include "swift/AST/LayoutConstraint.h"
|
25 | 24 | #include "swift/AST/LifetimeDependence.h"
|
@@ -543,29 +542,7 @@ class Parser {
|
543 | 542 | /// diagnose it if not permitted in this mode.
|
544 | 543 | /// \param diagnoseDollarPrefix Whether to diagnose dollar-prefixed
|
545 | 544 | /// identifiers in addition to a standalone '$'.
|
546 |
| - void diagnoseDollarIdentifier(const Token &tok, |
547 |
| - bool diagnoseDollarPrefix) { |
548 |
| - assert(tok.getText()[0] == '$'); |
549 |
| - |
550 |
| - // If '$' is not guarded by backticks, offer |
551 |
| - // to replace it with '`$`'. |
552 |
| - if (Tok.getRawText() == "$") { |
553 |
| - diagnose(Tok.getLoc(), diag::standalone_dollar_identifier) |
554 |
| - .fixItReplace(Tok.getLoc(), "`$`"); |
555 |
| - return; |
556 |
| - } |
557 |
| - |
558 |
| - if (!diagnoseDollarPrefix) |
559 |
| - return; |
560 |
| - |
561 |
| - if (tok.getText().size() == 1 || Context.LangOpts.EnableDollarIdentifiers || |
562 |
| - isInSILMode() || L->isSwiftInterface() || |
563 |
| - isInMacroExpansion(tok.getLoc())) |
564 |
| - return; |
565 |
| - |
566 |
| - diagnose(tok.getLoc(), diag::dollar_identifier_decl, |
567 |
| - Context.getIdentifier(tok.getText())); |
568 |
| - } |
| 545 | + void diagnoseDollarIdentifier(const Token &tok, bool diagnoseDollarPrefix); |
569 | 546 |
|
570 | 547 | /// Retrieve the location just past the end of the previous
|
571 | 548 | /// source location.
|
|
0 commit comments