@@ -1401,7 +1401,7 @@ private pure nothrow @safe:
1401
1401
{
1402
1402
Token ident;
1403
1403
lexIdentifier(ident);
1404
- if (isNewline())
1404
+ if (! (range.index >= range.bytes.length) && isNewline())
1405
1405
popFrontWhitespaceAware();
1406
1406
else
1407
1407
error(" Newline expected" );
@@ -1426,14 +1426,15 @@ private pure nothrow @safe:
1426
1426
range.popFront();
1427
1427
}
1428
1428
}
1429
+ IdType type;
1429
1430
if (! (range.index >= range.bytes.length) && range.bytes[range.index] == ' "' )
1430
1431
{
1432
+ type = tok! " stringLiteral" ;
1433
+ lexStringSuffix(type);
1431
1434
range.popFront();
1432
1435
}
1433
1436
else
1434
1437
error(" `\" ` expected" );
1435
- IdType type = tok! " stringLiteral" ;
1436
- lexStringSuffix(type);
1437
1438
token = Token (type, cache.intern(range.slice(mark)), line, column, index);
1438
1439
}
1439
1440
@@ -2504,6 +2505,9 @@ void main() {
2504
2505
2505
2506
checkInvalidTrailingString(getTokensForParser(` x = "foo` , cf, &ca));
2506
2507
checkInvalidTrailingString(getTokensForParser(` x = r"foo` , cf, &ca));
2508
+ checkInvalidTrailingString(getTokensForParser(` x = x"00` , cf, &ca));
2507
2509
checkInvalidTrailingString(getTokensForParser(" x = `foo" , cf, &ca));
2508
2510
checkInvalidTrailingString(getTokensForParser(" x = q{foo" , cf, &ca));
2511
+ checkInvalidTrailingString(getTokensForParser(` x = q"foo` , cf, &ca));
2512
+ checkInvalidTrailingString(getTokensForParser(" x = '" , cf, &ca));
2509
2513
}
0 commit comments