@@ -569,8 +569,7 @@ ParserResult<AvailableAttr> Parser::parseExtendedAvailabilitySpecList(
569
569
}
570
570
571
571
auto Value = getStringLiteralIfNotInterpolated (
572
- AttrLoc, (" '" + ArgumentKindStr + " '" ).str (),
573
- /* AllowMultiline=*/ true );
572
+ AttrLoc, (" '" + ArgumentKindStr + " '" ).str ());
574
573
consumeToken ();
575
574
if (!Value) {
576
575
AnyArgumentInvalid = true ;
@@ -1462,8 +1461,7 @@ bool Parser::parseExternAttribute(DeclAttributes &Attributes,
1462
1461
return std::nullopt;
1463
1462
}
1464
1463
std::optional<StringRef> importModuleName =
1465
- getStringLiteralIfNotInterpolated (Loc, (" '" + AttrName + " '" ).str (),
1466
- /* AllowMultiline=*/ false );
1464
+ getStringLiteralIfNotInterpolated (Loc, (" '" + AttrName + " '" ).str ());
1467
1465
consumeToken (tok::string_literal);
1468
1466
1469
1467
if (!importModuleName.has_value ()) {
@@ -3240,8 +3238,8 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
3240
3238
return makeParserSuccess ();
3241
3239
}
3242
3240
3243
- AsmName = getStringLiteralIfNotInterpolated (
3244
- Loc, (" '" + AttrName + " '" ).str (), /* AllowMultiline= */ false );
3241
+ AsmName =
3242
+ getStringLiteralIfNotInterpolated ( Loc, (" '" + AttrName + " '" ).str ());
3245
3243
3246
3244
consumeToken (tok::string_literal);
3247
3245
@@ -3311,7 +3309,7 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
3311
3309
}
3312
3310
3313
3311
auto Name = getStringLiteralIfNotInterpolated (
3314
- Loc, (" '" + AttrName + " '" ).str (), /* AllowMultiline= */ false );
3312
+ Loc, (" '" + AttrName + " '" ).str ());
3315
3313
3316
3314
consumeToken (tok::string_literal);
3317
3315
@@ -3398,7 +3396,7 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
3398
3396
}
3399
3397
3400
3398
auto Value = getStringLiteralIfNotInterpolated (
3401
- Loc, (" '" + AttrName + " '" ).str (), /* AllowMultiline= */ false );
3399
+ Loc, (" '" + AttrName + " '" ).str ());
3402
3400
3403
3401
consumeToken (tok::string_literal);
3404
3402
@@ -3461,8 +3459,8 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
3461
3459
// Parse the next string literal as the original module name.
3462
3460
auto ModuleNameLoc = Tok.getLoc ();
3463
3461
if (Tok.is (tok::string_literal)) {
3464
- auto NameOp = getStringLiteralIfNotInterpolated (
3465
- Tok. getLoc (), " original module name" , /* AllowMultiline= */ false );
3462
+ auto NameOp = getStringLiteralIfNotInterpolated (Tok. getLoc (),
3463
+ " original module name" );
3466
3464
if (NameOp.has_value ())
3467
3465
OriginalModuleName = *NameOp;
3468
3466
consumeToken ();
@@ -3551,8 +3549,7 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
3551
3549
diagnose (ColonLoc, diag::attr_private_import_expected_sourcefile_name);
3552
3550
return makeParserSuccess ();
3553
3551
}
3554
- filename = getStringLiteralIfNotInterpolated (Loc, " _private" ,
3555
- /* AllowMultiline=*/ false );
3552
+ filename = getStringLiteralIfNotInterpolated (Loc, " _private" );
3556
3553
if (!filename.has_value ()) {
3557
3554
diagnose (ColonLoc, diag::attr_private_import_expected_sourcefile_name);
3558
3555
return makeParserSuccess ();
@@ -3829,8 +3826,8 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
3829
3826
return makeParserSuccess ();
3830
3827
}
3831
3828
3832
- std::optional<StringRef> value = getStringLiteralIfNotInterpolated (
3833
- Tok.getLoc (), flag, /* AllowMultiline= */ false );
3829
+ std::optional<StringRef> value =
3830
+ getStringLiteralIfNotInterpolated ( Tok.getLoc (), flag);
3834
3831
if (!value)
3835
3832
return makeParserSuccess ();
3836
3833
Token stringTok = Tok;
@@ -4569,8 +4566,7 @@ bool Parser::parseConventionAttributeInternal(SourceLoc atLoc, SourceLoc attrLoc
4569
4566
diagnose (Tok, diag::convention_attribute_ctype_expected_string);
4570
4567
return true ;
4571
4568
}
4572
- if (auto ty = getStringLiteralIfNotInterpolated (Tok.getLoc (), " (C type)" ,
4573
- /* AllowMultiline=*/ false )) {
4569
+ if (auto ty = getStringLiteralIfNotInterpolated (Tok.getLoc (), " (C type)" )) {
4574
4570
cType = Located<StringRef>(ty.value (), Tok.getLoc ());
4575
4571
}
4576
4572
consumeToken (tok::string_literal);
@@ -7276,8 +7272,8 @@ ParserStatus Parser::parseLineDirective(bool isLine) {
7276
7272
return makeParserError ();
7277
7273
}
7278
7274
7279
- Filename = getStringLiteralIfNotInterpolated (Loc, " '#sourceLocation' " ,
7280
- /* AllowMultiline= */ false );
7275
+ Filename =
7276
+ getStringLiteralIfNotInterpolated (Loc, " '#sourceLocation' " );
7281
7277
if (!Filename.has_value ())
7282
7278
return makeParserError ();
7283
7279
SourceLoc filenameLoc = consumeToken (tok::string_literal);
@@ -7295,11 +7291,6 @@ ParserStatus Parser::parseLineDirective(bool isLine) {
7295
7291
}
7296
7292
SmallString<16 > buffer;
7297
7293
auto text = stripUnderscoresIfNeeded (Tok.getText (), buffer);
7298
- if (text.find_first_not_of (" 0123456789" ) != StringRef::npos) {
7299
- // Disallow non-decimal line numbers in Swift 6.
7300
- diagnose (Tok, diag::expected_line_directive_number)
7301
- .warnUntilSwiftVersion (6 );
7302
- }
7303
7294
if (text.getAsInteger (0 , StartLine)) {
7304
7295
diagnose (Tok, diag::expected_line_directive_number);
7305
7296
return makeParserError ();
@@ -7347,9 +7338,8 @@ ParserStatus Parser::parseLineDirective(bool isLine) {
7347
7338
diagnose (Tok, diag::expected_line_directive_name);
7348
7339
return makeParserError ();
7349
7340
}
7350
-
7351
- Filename = getStringLiteralIfNotInterpolated (Loc, " '#line'" ,
7352
- /* AllowMultiline=*/ false );
7341
+
7342
+ Filename = getStringLiteralIfNotInterpolated (Loc, " '#line'" );
7353
7343
if (!Filename.has_value ())
7354
7344
return makeParserError ();
7355
7345
}
0 commit comments