Skip to content

Commit 35e8218

Browse files
author
David Ungar
committed
Back off and strategically retreat from more sensible ranges for TapExpressions and their subexpressions
1 parent a40b694 commit 35e8218

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lib/Parse/ParseExpr.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1913,6 +1913,7 @@ ParserResult<Expr> Parser::parseExprStringLiteral() {
19131913

19141914
// The start location of the entire string literal.
19151915
SourceLoc Loc = Tok.getLoc();
1916+
SourceLoc EndLoc = Loc.getAdvancedLoc(Tok.getLength());
19161917

19171918
StringRef OpenDelimiterStr, OpenQuoteStr, CloseQuoteStr, CloseDelimiterStr;
19181919
unsigned DelimiterLength = Tok.getCustomDelimiterLen();
@@ -2032,9 +2033,7 @@ ParserResult<Expr> Parser::parseExprStringLiteral() {
20322033
Status = parseStringSegments(Segments, EntireTok, InterpolationVar,
20332034
Stmts, LiteralCapacity, InterpolationCount);
20342035

2035-
// At this point, PreviousLoc points to the last token parsed within
2036-
// the body, so use that for the brace statement location.
2037-
auto Body = BraceStmt::create(Context, Loc, Stmts, PreviousLoc,
2036+
auto Body = BraceStmt::create(Context, Loc, Stmts, EndLoc,
20382037
/*implicit=*/false);
20392038
AppendingExpr = new (Context) TapExpr(nullptr, Body);
20402039
}

0 commit comments

Comments
 (0)