@@ -568,8 +568,7 @@ ParserResult<AvailableAttr> Parser::parseExtendedAvailabilitySpecList(
568
568
}
569
569
570
570
auto Value = getStringLiteralIfNotInterpolated (
571
- AttrLoc, (" '" + ArgumentKindStr + " '" ).str (),
572
- /* AllowMultiline=*/ true );
571
+ AttrLoc, (" '" + ArgumentKindStr + " '" ).str ());
573
572
consumeToken ();
574
573
if (!Value) {
575
574
AnyArgumentInvalid = true ;
@@ -1461,8 +1460,7 @@ bool Parser::parseExternAttribute(DeclAttributes &Attributes,
1461
1460
return std::nullopt;
1462
1461
}
1463
1462
llvm::Optional<StringRef> importModuleName =
1464
- getStringLiteralIfNotInterpolated (Loc, (" '" + AttrName + " '" ).str (),
1465
- /* AllowMultiline=*/ false );
1463
+ getStringLiteralIfNotInterpolated (Loc, (" '" + AttrName + " '" ).str ());
1466
1464
consumeToken (tok::string_literal);
1467
1465
1468
1466
if (!importModuleName.has_value ()) {
@@ -3242,8 +3240,8 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
3242
3240
return makeParserSuccess ();
3243
3241
}
3244
3242
3245
- AsmName = getStringLiteralIfNotInterpolated (
3246
- Loc, (" '" + AttrName + " '" ).str (), /* AllowMultiline= */ false );
3243
+ AsmName =
3244
+ getStringLiteralIfNotInterpolated ( Loc, (" '" + AttrName + " '" ).str ());
3247
3245
3248
3246
consumeToken (tok::string_literal);
3249
3247
@@ -3314,7 +3312,7 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
3314
3312
}
3315
3313
3316
3314
auto Name = getStringLiteralIfNotInterpolated (
3317
- Loc, (" '" + AttrName + " '" ).str (), /* AllowMultiline= */ false );
3315
+ Loc, (" '" + AttrName + " '" ).str ());
3318
3316
3319
3317
consumeToken (tok::string_literal);
3320
3318
@@ -3401,7 +3399,7 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
3401
3399
}
3402
3400
3403
3401
auto Value = getStringLiteralIfNotInterpolated (
3404
- Loc, (" '" + AttrName + " '" ).str (), /* AllowMultiline= */ false );
3402
+ Loc, (" '" + AttrName + " '" ).str ());
3405
3403
3406
3404
consumeToken (tok::string_literal);
3407
3405
@@ -3464,8 +3462,8 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
3464
3462
// Parse the next string literal as the original module name.
3465
3463
auto ModuleNameLoc = Tok.getLoc ();
3466
3464
if (Tok.is (tok::string_literal)) {
3467
- auto NameOp = getStringLiteralIfNotInterpolated (
3468
- Tok. getLoc (), " original module name" , /* AllowMultiline= */ false );
3465
+ auto NameOp = getStringLiteralIfNotInterpolated (Tok. getLoc (),
3466
+ " original module name" );
3469
3467
if (NameOp.has_value ())
3470
3468
OriginalModuleName = *NameOp;
3471
3469
consumeToken ();
@@ -3554,8 +3552,7 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
3554
3552
diagnose (ColonLoc, diag::attr_private_import_expected_sourcefile_name);
3555
3553
return makeParserSuccess ();
3556
3554
}
3557
- filename = getStringLiteralIfNotInterpolated (Loc, " _private" ,
3558
- /* AllowMultiline=*/ false );
3555
+ filename = getStringLiteralIfNotInterpolated (Loc, " _private" );
3559
3556
if (!filename.has_value ()) {
3560
3557
diagnose (ColonLoc, diag::attr_private_import_expected_sourcefile_name);
3561
3558
return makeParserSuccess ();
@@ -3828,8 +3825,8 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
3828
3825
return makeParserSuccess ();
3829
3826
}
3830
3827
3831
- llvm::Optional<StringRef> value = getStringLiteralIfNotInterpolated (
3832
- Tok.getLoc (), flag, /* AllowMultiline= */ false );
3828
+ llvm::Optional<StringRef> value =
3829
+ getStringLiteralIfNotInterpolated ( Tok.getLoc (), flag);
3833
3830
if (!value)
3834
3831
return makeParserSuccess ();
3835
3832
Token stringTok = Tok;
@@ -4555,8 +4552,7 @@ bool Parser::parseConventionAttributeInternal(SourceLoc atLoc, SourceLoc attrLoc
4555
4552
diagnose (Tok, diag::convention_attribute_ctype_expected_string);
4556
4553
return true ;
4557
4554
}
4558
- if (auto ty = getStringLiteralIfNotInterpolated (Tok.getLoc (), " (C type)" ,
4559
- /* AllowMultiline=*/ false )) {
4555
+ if (auto ty = getStringLiteralIfNotInterpolated (Tok.getLoc (), " (C type)" )) {
4560
4556
cType = Located<StringRef>(ty.value (), Tok.getLoc ());
4561
4557
}
4562
4558
consumeToken (tok::string_literal);
@@ -7197,8 +7193,8 @@ ParserStatus Parser::parseLineDirective(bool isLine) {
7197
7193
return makeParserError ();
7198
7194
}
7199
7195
7200
- Filename = getStringLiteralIfNotInterpolated (Loc, " '#sourceLocation' " ,
7201
- /* AllowMultiline= */ false );
7196
+ Filename =
7197
+ getStringLiteralIfNotInterpolated (Loc, " '#sourceLocation' " );
7202
7198
if (!Filename.has_value ())
7203
7199
return makeParserError ();
7204
7200
SourceLoc filenameLoc = consumeToken (tok::string_literal);
@@ -7216,11 +7212,6 @@ ParserStatus Parser::parseLineDirective(bool isLine) {
7216
7212
}
7217
7213
SmallString<16 > buffer;
7218
7214
auto text = stripUnderscoresIfNeeded (Tok.getText (), buffer);
7219
- if (text.find_first_not_of (" 0123456789" ) != StringRef::npos) {
7220
- // Disallow non-decimal line numbers in Swift 6.
7221
- diagnose (Tok, diag::expected_line_directive_number)
7222
- .warnUntilSwiftVersion (6 );
7223
- }
7224
7215
if (text.getAsInteger (0 , StartLine)) {
7225
7216
diagnose (Tok, diag::expected_line_directive_number);
7226
7217
return makeParserError ();
@@ -7268,9 +7259,8 @@ ParserStatus Parser::parseLineDirective(bool isLine) {
7268
7259
diagnose (Tok, diag::expected_line_directive_name);
7269
7260
return makeParserError ();
7270
7261
}
7271
-
7272
- Filename = getStringLiteralIfNotInterpolated (Loc, " '#line'" ,
7273
- /* AllowMultiline=*/ false );
7262
+
7263
+ Filename = getStringLiteralIfNotInterpolated (Loc, " '#line'" );
7274
7264
if (!Filename.has_value ())
7275
7265
return makeParserError ();
7276
7266
}
0 commit comments