@@ -569,8 +569,7 @@ ParserResult<AvailableAttr> Parser::parseExtendedAvailabilitySpecList(
569569 }
570570
571571 auto Value = getStringLiteralIfNotInterpolated (
572- AttrLoc, (" '" + ArgumentKindStr + " '" ).str (),
573- /* AllowMultiline=*/ true );
572+ AttrLoc, (" '" + ArgumentKindStr + " '" ).str ());
574573 consumeToken ();
575574 if (!Value) {
576575 AnyArgumentInvalid = true ;
@@ -1462,8 +1461,7 @@ bool Parser::parseExternAttribute(DeclAttributes &Attributes,
14621461 return std::nullopt ;
14631462 }
14641463 std::optional<StringRef> importModuleName =
1465- getStringLiteralIfNotInterpolated (Loc, (" '" + AttrName + " '" ).str (),
1466- /* AllowMultiline=*/ false );
1464+ getStringLiteralIfNotInterpolated (Loc, (" '" + AttrName + " '" ).str ());
14671465 consumeToken (tok::string_literal);
14681466
14691467 if (!importModuleName.has_value ()) {
@@ -3240,8 +3238,8 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
32403238 return makeParserSuccess ();
32413239 }
32423240
3243- AsmName = getStringLiteralIfNotInterpolated (
3244- Loc, (" '" + AttrName + " '" ).str (), /* AllowMultiline= */ false );
3241+ AsmName =
3242+ getStringLiteralIfNotInterpolated ( Loc, (" '" + AttrName + " '" ).str ());
32453243
32463244 consumeToken (tok::string_literal);
32473245
@@ -3311,7 +3309,7 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
33113309 }
33123310
33133311 auto Name = getStringLiteralIfNotInterpolated (
3314- Loc, (" '" + AttrName + " '" ).str (), /* AllowMultiline= */ false );
3312+ Loc, (" '" + AttrName + " '" ).str ());
33153313
33163314 consumeToken (tok::string_literal);
33173315
@@ -3398,7 +3396,7 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
33983396 }
33993397
34003398 auto Value = getStringLiteralIfNotInterpolated (
3401- Loc, (" '" + AttrName + " '" ).str (), /* AllowMultiline= */ false );
3399+ Loc, (" '" + AttrName + " '" ).str ());
34023400
34033401 consumeToken (tok::string_literal);
34043402
@@ -3461,8 +3459,8 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
34613459 // Parse the next string literal as the original module name.
34623460 auto ModuleNameLoc = Tok.getLoc ();
34633461 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" );
34663464 if (NameOp.has_value ())
34673465 OriginalModuleName = *NameOp;
34683466 consumeToken ();
@@ -3551,8 +3549,7 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
35513549 diagnose (ColonLoc, diag::attr_private_import_expected_sourcefile_name);
35523550 return makeParserSuccess ();
35533551 }
3554- filename = getStringLiteralIfNotInterpolated (Loc, " _private" ,
3555- /* AllowMultiline=*/ false );
3552+ filename = getStringLiteralIfNotInterpolated (Loc, " _private" );
35563553 if (!filename.has_value ()) {
35573554 diagnose (ColonLoc, diag::attr_private_import_expected_sourcefile_name);
35583555 return makeParserSuccess ();
@@ -3829,8 +3826,8 @@ ParserStatus Parser::parseNewDeclAttribute(DeclAttributes &Attributes,
38293826 return makeParserSuccess ();
38303827 }
38313828
3832- std::optional<StringRef> value = getStringLiteralIfNotInterpolated (
3833- Tok.getLoc (), flag, /* AllowMultiline= */ false );
3829+ std::optional<StringRef> value =
3830+ getStringLiteralIfNotInterpolated ( Tok.getLoc (), flag);
38343831 if (!value)
38353832 return makeParserSuccess ();
38363833 Token stringTok = Tok;
@@ -4569,8 +4566,7 @@ bool Parser::parseConventionAttributeInternal(SourceLoc atLoc, SourceLoc attrLoc
45694566 diagnose (Tok, diag::convention_attribute_ctype_expected_string);
45704567 return true ;
45714568 }
4572- if (auto ty = getStringLiteralIfNotInterpolated (Tok.getLoc (), " (C type)" ,
4573- /* AllowMultiline=*/ false )) {
4569+ if (auto ty = getStringLiteralIfNotInterpolated (Tok.getLoc (), " (C type)" )) {
45744570 cType = Located<StringRef>(ty.value (), Tok.getLoc ());
45754571 }
45764572 consumeToken (tok::string_literal);
@@ -7276,8 +7272,8 @@ ParserStatus Parser::parseLineDirective(bool isLine) {
72767272 return makeParserError ();
72777273 }
72787274
7279- Filename = getStringLiteralIfNotInterpolated (Loc, " '#sourceLocation' " ,
7280- /* AllowMultiline= */ false );
7275+ Filename =
7276+ getStringLiteralIfNotInterpolated (Loc, " '#sourceLocation' " );
72817277 if (!Filename.has_value ())
72827278 return makeParserError ();
72837279 SourceLoc filenameLoc = consumeToken (tok::string_literal);
@@ -7295,11 +7291,6 @@ ParserStatus Parser::parseLineDirective(bool isLine) {
72957291 }
72967292 SmallString<16 > buffer;
72977293 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- }
73037294 if (text.getAsInteger (0 , StartLine)) {
73047295 diagnose (Tok, diag::expected_line_directive_number);
73057296 return makeParserError ();
@@ -7347,9 +7338,8 @@ ParserStatus Parser::parseLineDirective(bool isLine) {
73477338 diagnose (Tok, diag::expected_line_directive_name);
73487339 return makeParserError ();
73497340 }
7350-
7351- Filename = getStringLiteralIfNotInterpolated (Loc, " '#line'" ,
7352- /* AllowMultiline=*/ false );
7341+
7342+ Filename = getStringLiteralIfNotInterpolated (Loc, " '#line'" );
73537343 if (!Filename.has_value ())
73547344 return makeParserError ();
73557345 }
0 commit comments