@@ -1414,7 +1414,6 @@ unsigned Lexer::lexCharacter(const char *&CurPtr, char StopQuote,
1414
1414
// / outstanding delimiters as it scans the string.
1415
1415
static const char *skipToEndOfInterpolatedExpression (const char *CurPtr,
1416
1416
const char *EndPtr,
1417
- DiagnosticEngine *Diags,
1418
1417
bool IsMultilineString) {
1419
1418
SmallVector<char , 4 > OpenDelimiters;
1420
1419
SmallVector<bool , 4 > AllowNewline;
@@ -1452,7 +1451,7 @@ static const char *skipToEndOfInterpolatedExpression(const char *CurPtr,
1452
1451
1453
1452
case ' #' :
1454
1453
if (inStringLiteral () ||
1455
- !(CustomDelimiterLen = advanceIfCustomDelimiter (CurPtr, Diags )))
1454
+ !(CustomDelimiterLen = advanceIfCustomDelimiter (CurPtr, nullptr )))
1456
1455
continue ;
1457
1456
assert (CurPtr[-1 ] == ' "' &&
1458
1457
" advanceIfCustomDelimiter() must stop at after the quote" );
@@ -1463,7 +1462,7 @@ static const char *skipToEndOfInterpolatedExpression(const char *CurPtr,
1463
1462
if (!inStringLiteral ()) {
1464
1463
// Open string literal.
1465
1464
OpenDelimiters.push_back (CurPtr[-1 ]);
1466
- AllowNewline.push_back (advanceIfMultilineDelimiter (CurPtr, Diags ));
1465
+ AllowNewline.push_back (advanceIfMultilineDelimiter (CurPtr, nullptr ));
1467
1466
CustomDelimiter.push_back (CustomDelimiterLen);
1468
1467
continue ;
1469
1468
}
@@ -1475,11 +1474,11 @@ static const char *skipToEndOfInterpolatedExpression(const char *CurPtr,
1475
1474
continue ;
1476
1475
1477
1476
// Multi-line string can only be closed by '"""'.
1478
- if (AllowNewline.back () && !advanceIfMultilineDelimiter (CurPtr, Diags ))
1477
+ if (AllowNewline.back () && !advanceIfMultilineDelimiter (CurPtr, nullptr ))
1479
1478
continue ;
1480
1479
1481
1480
// Check whether we have equivalent number of '#'s.
1482
- if (!delimiterMatches (CustomDelimiter.back (), CurPtr, Diags , true ))
1481
+ if (!delimiterMatches (CustomDelimiter.back (), CurPtr, nullptr , true ))
1483
1482
continue ;
1484
1483
1485
1484
// Close string literal.
@@ -1492,7 +1491,7 @@ static const char *skipToEndOfInterpolatedExpression(const char *CurPtr,
1492
1491
// We ignore invalid escape sequence here. They should be diagnosed in
1493
1492
// the real lexer functions.
1494
1493
if (inStringLiteral () &&
1495
- delimiterMatches (CustomDelimiter.back (), CurPtr, Diags )) {
1494
+ delimiterMatches (CustomDelimiter.back (), CurPtr, nullptr )) {
1496
1495
switch (*CurPtr++) {
1497
1496
case ' (' :
1498
1497
// Entering a recursive interpolated expression
@@ -1757,10 +1756,9 @@ void Lexer::lexStringLiteral(unsigned CustomDelimiterLen) {
1757
1756
&& *TmpPtr == ' (' ) {
1758
1757
// Consume tokens until we hit the corresponding ')'.
1759
1758
CurPtr = TmpPtr + 1 ;
1760
- const char *EndPtr =
1761
- skipToEndOfInterpolatedExpression (CurPtr, BufferEnd,
1762
- Diags, IsMultilineString);
1763
-
1759
+ const char *EndPtr = skipToEndOfInterpolatedExpression (CurPtr, BufferEnd,
1760
+ IsMultilineString);
1761
+
1764
1762
if (*EndPtr == ' )' ) {
1765
1763
// Successfully scanned the body of the expression literal.
1766
1764
CurPtr = EndPtr+1 ;
@@ -2231,9 +2229,8 @@ void Lexer::getStringLiteralSegments(
2231
2229
IsFirstSegment = false ;
2232
2230
2233
2231
// Find the closing ')'.
2234
- const char *End = skipToEndOfInterpolatedExpression (BytesPtr,
2235
- Str.getText ().end (),
2236
- Diags, MultilineString);
2232
+ const char *End = skipToEndOfInterpolatedExpression (
2233
+ BytesPtr, Str.getText ().end (), MultilineString);
2237
2234
assert (*End == ' )' && " invalid string literal interpolations should"
2238
2235
" not be returned as string literals" );
2239
2236
++End;
0 commit comments