@@ -1120,7 +1120,7 @@ static Optional<AccessorKind> isAccessorLabel(const Token &token) {
11201120// / or to `nullptr` if not. A missing base type is not considered an error.
11211121static bool parseBaseTypeForQualifiedDeclName (Parser &P, TypeRepr *&baseType) {
11221122 baseType = nullptr ;
1123- Parser::BacktrackingScope backtrack (P);
1123+ Parser::CancellableBacktrackingScope backtrack (P);
11241124
11251125 // If base type cannot be parsed, return false (no error).
11261126 if (!P.canParseBaseTypeForQualifiedDeclName ())
@@ -3028,7 +3028,7 @@ bool Parser::canParseTypeAttribute() {
30283028// / \returns true on error, false on success
30293029static bool parseDifferentiableTypeAttributeArgument (
30303030 Parser &P, TypeAttributes &Attributes, bool emitDiagnostics) {
3031- Parser::BacktrackingScope backtrack (P);
3031+ Parser::CancellableBacktrackingScope backtrack (P);
30323032
30333033 // Match '( <identifier> )', and store the identifier token to `argument`.
30343034 if (!P.consumeIf (tok::l_paren))
@@ -3226,7 +3226,7 @@ bool Parser::parseTypeAttribute(TypeAttributes &Attributes, SourceLoc AtLoc,
32263226 SyntaxParsingContext TokListContext (SyntaxContext, SyntaxKind::TokenList);
32273227
32283228 if (Tok.is (tok::l_paren) && getEndOfPreviousLoc () == Tok.getLoc ()) {
3229- BacktrackingScope backtrack (*this );
3229+ CancellableBacktrackingScope backtrack (*this );
32303230 skipSingle ();
32313231 // If we found '->', or 'throws' after paren, it's likely a parameter
32323232 // of function type.
@@ -5046,7 +5046,7 @@ bool Parser::canDelayMemberDeclParsing(bool &HasOperatorDeclarations,
50465046
50475047 // Skip until the matching right curly bracket; if we find a pound directive,
50485048 // we can't lazily parse.
5049- BacktrackingScope BackTrack (*this );
5049+ CancellableBacktrackingScope BackTrack (*this );
50505050 bool HasPoundDirective;
50515051 bool HasNestedTypeDeclarations;
50525052 skipUntilMatchingRBrace (*this ,
@@ -5975,7 +5975,7 @@ ParserStatus Parser::parseGetSet(ParseDeclOptions Flags,
59755975 };
59765976
59775977 // Prepare backtracking for implicit getter.
5978- Optional<BacktrackingScope > backtrack;
5978+ Optional<CancellableBacktrackingScope > backtrack;
59795979 backtrack.emplace (*this );
59805980
59815981 bool Invalid = false ;
@@ -7114,7 +7114,7 @@ Parser::parseDeclEnumCase(ParseDeclOptions Flags,
71147114 // For recovery, see if the user typed something resembling a switch
71157115 // "case" label.
71167116 {
7117- BacktrackingScope backtrack (*this );
7117+ CancellableBacktrackingScope backtrack (*this );
71187118 llvm::SaveAndRestore<decltype (InVarOrLetPattern)>
71197119 T (InVarOrLetPattern, Parser::IVOLP_InMatchingPattern);
71207120 parseMatchingPattern (/* isExprBasic*/ false );
0 commit comments