@@ -1120,7 +1120,7 @@ static Optional<AccessorKind> isAccessorLabel(const Token &token) {
1120
1120
// / or to `nullptr` if not. A missing base type is not considered an error.
1121
1121
static bool parseBaseTypeForQualifiedDeclName (Parser &P, TypeRepr *&baseType) {
1122
1122
baseType = nullptr ;
1123
- Parser::BacktrackingScope backtrack (P);
1123
+ Parser::CancellableBacktrackingScope backtrack (P);
1124
1124
1125
1125
// If base type cannot be parsed, return false (no error).
1126
1126
if (!P.canParseBaseTypeForQualifiedDeclName ())
@@ -3028,7 +3028,7 @@ bool Parser::canParseTypeAttribute() {
3028
3028
// / \returns true on error, false on success
3029
3029
static bool parseDifferentiableTypeAttributeArgument (
3030
3030
Parser &P, TypeAttributes &Attributes, bool emitDiagnostics) {
3031
- Parser::BacktrackingScope backtrack (P);
3031
+ Parser::CancellableBacktrackingScope backtrack (P);
3032
3032
3033
3033
// Match '( <identifier> )', and store the identifier token to `argument`.
3034
3034
if (!P.consumeIf (tok::l_paren))
@@ -3226,7 +3226,7 @@ bool Parser::parseTypeAttribute(TypeAttributes &Attributes, SourceLoc AtLoc,
3226
3226
SyntaxParsingContext TokListContext (SyntaxContext, SyntaxKind::TokenList);
3227
3227
3228
3228
if (Tok.is (tok::l_paren) && getEndOfPreviousLoc () == Tok.getLoc ()) {
3229
- BacktrackingScope backtrack (*this );
3229
+ CancellableBacktrackingScope backtrack (*this );
3230
3230
skipSingle ();
3231
3231
// If we found '->', or 'throws' after paren, it's likely a parameter
3232
3232
// of function type.
@@ -5046,7 +5046,7 @@ bool Parser::canDelayMemberDeclParsing(bool &HasOperatorDeclarations,
5046
5046
5047
5047
// Skip until the matching right curly bracket; if we find a pound directive,
5048
5048
// we can't lazily parse.
5049
- BacktrackingScope BackTrack (*this );
5049
+ CancellableBacktrackingScope BackTrack (*this );
5050
5050
bool HasPoundDirective;
5051
5051
bool HasNestedTypeDeclarations;
5052
5052
skipUntilMatchingRBrace (*this ,
@@ -5975,7 +5975,7 @@ ParserStatus Parser::parseGetSet(ParseDeclOptions Flags,
5975
5975
};
5976
5976
5977
5977
// Prepare backtracking for implicit getter.
5978
- Optional<BacktrackingScope > backtrack;
5978
+ Optional<CancellableBacktrackingScope > backtrack;
5979
5979
backtrack.emplace (*this );
5980
5980
5981
5981
bool Invalid = false ;
@@ -7114,7 +7114,7 @@ Parser::parseDeclEnumCase(ParseDeclOptions Flags,
7114
7114
// For recovery, see if the user typed something resembling a switch
7115
7115
// "case" label.
7116
7116
{
7117
- BacktrackingScope backtrack (*this );
7117
+ CancellableBacktrackingScope backtrack (*this );
7118
7118
llvm::SaveAndRestore<decltype (InVarOrLetPattern)>
7119
7119
T (InVarOrLetPattern, Parser::IVOLP_InMatchingPattern);
7120
7120
parseMatchingPattern (/* isExprBasic*/ false );
0 commit comments