File tree Expand file tree Collapse file tree 3 files changed +7
-19
lines changed Expand file tree Collapse file tree 3 files changed +7
-19
lines changed Original file line number Diff line number Diff line change @@ -459,8 +459,7 @@ class Parser {
459
459
}
460
460
461
461
SourceLoc consumeIdentifier (Identifier *Result = nullptr ) {
462
- assert (Tok.isAny (tok::identifier, tok::kw_self, tok::kw_Self,
463
- /* for Swift3 */ tok::kw_throws, tok::kw_rethrows));
462
+ assert (Tok.isAny (tok::identifier, tok::kw_self, tok::kw_Self));
464
463
if (Result)
465
464
*Result = Context.getIdentifier (Tok.getText ());
466
465
return consumeToken ();
Original file line number Diff line number Diff line change @@ -901,13 +901,9 @@ void Lexer::lexDollarIdent() {
901
901
}
902
902
903
903
if (CurPtr == tokStart + 1 ) {
904
- // It is always an error to see a standalone '$' when not in Swift 3
905
- // compatibility mode.
906
- if (!LangOpts.isSwiftVersion3 ()) {
907
- // Offer to replace '$' with '`$`'.
908
- diagnose (tokStart, diag::standalone_dollar_identifier)
909
- .fixItReplaceChars (getSourceLoc (tokStart), getSourceLoc (CurPtr), " `$`" );
910
- }
904
+ // It is an error to see a standalone '$'. Offer to replace '$' with '`$`'.
905
+ diagnose (tokStart, diag::standalone_dollar_identifier)
906
+ .fixItReplaceChars (getSourceLoc (tokStart), getSourceLoc (CurPtr), " `$`" );
911
907
return formToken (tok::identifier, tokStart);
912
908
}
913
909
Original file line number Diff line number Diff line change @@ -778,23 +778,16 @@ void Parser::StructureMarkerRAII::diagnoseOverflow() {
778
778
bool Parser::parseIdentifier (Identifier &Result, SourceLoc &Loc,
779
779
const Diagnostic &D) {
780
780
switch (Tok.getKind ()) {
781
- case tok::kw_throws:
782
- case tok::kw_rethrows:
783
- if (!Context.isSwiftVersion3 ())
784
- break ;
785
- // Swift3 accepts 'throws' and 'rethrows'
786
- LLVM_FALLTHROUGH;
787
781
case tok::kw_self:
788
782
case tok::kw_Self:
789
783
case tok::identifier:
790
784
Loc = consumeIdentifier (&Result);
791
785
return false ;
792
786
default :
793
- break ;
787
+ checkForInputIncomplete ();
788
+ diagnose (Tok, D);
789
+ return true ;
794
790
}
795
- checkForInputIncomplete ();
796
- diagnose (Tok, D);
797
- return true ;
798
791
}
799
792
800
793
bool Parser::parseSpecificIdentifier (StringRef expected, SourceLoc &loc,
You can’t perform that action at this time.
0 commit comments