File tree Expand file tree Collapse file tree 5 files changed +24
-86
lines changed Expand file tree Collapse file tree 5 files changed +24
-86
lines changed Original file line number Diff line number Diff line change @@ -362,7 +362,7 @@ extension Parser {
362
362
let additionalArgs = self . parseArgumentListElements (
363
363
pattern: . none,
364
364
flavor: . attributeArguments,
365
- allowTrailingComma: true
365
+ allowTrailingComma: false
366
366
)
367
367
return [ roleElement] + additionalArgs
368
368
}
@@ -852,11 +852,6 @@ extension Parser {
852
852
arena: self . arena
853
853
)
854
854
)
855
-
856
- // If this was a trailing closure then there are no more elements
857
- if self . at ( . rightParen) {
858
- break
859
- }
860
855
} while keepGoing != nil
861
856
return RawBackDeployedAttributeArgumentsSyntax (
862
857
unexpectedBeforeLabel,
@@ -888,11 +883,6 @@ extension Parser {
888
883
arena: self . arena
889
884
)
890
885
)
891
-
892
- // If this was a trailing closure then there are no more elements
893
- if self . at ( . rightParen) {
894
- break
895
- }
896
886
} while keepGoing != nil
897
887
898
888
return RawOriginallyDefinedInAttributeArgumentsSyntax (
@@ -1011,11 +1001,6 @@ extension Parser {
1011
1001
arena: self . arena
1012
1002
)
1013
1003
)
1014
-
1015
- // If this was a trailing closure then there are no more elements
1016
- if self . at ( . rightParen) {
1017
- break
1018
- }
1019
1004
} while keepGoing != nil
1020
1005
1021
1006
return RawDocumentationAttributeArgumentListSyntax ( elements: arguments, arena: self . arena)
Original file line number Diff line number Diff line change @@ -47,11 +47,6 @@ extension Parser {
47
47
arena: self . arena
48
48
)
49
49
)
50
-
51
- // If this was a trailing closure, there are no more elements
52
- if self . at ( . rightParen) {
53
- break
54
- }
55
50
} while keepGoing != nil
56
51
&& self . hasProgressed ( & availabilityArgumentProgress)
57
52
}
Original file line number Diff line number Diff line change @@ -470,31 +470,13 @@ final class AttributeTests: ParserTestCase {
470
470
"""
471
471
)
472
472
473
- assertParse (
474
- """
475
- @backDeployed(
476
- before: macOS 12.0,
477
- )
478
- struct Foo {}
479
- """
480
- )
481
-
482
473
assertParse (
483
474
"""
484
475
@backDeployed(before: macos 12.0, iOS 15.0)
485
476
struct Foo {}
486
477
"""
487
478
)
488
479
489
- assertParse (
490
- """
491
- @backDeployed(
492
- before: macos 12.0,
493
- iOS 15.0,)
494
- struct Foo {}
495
- """
496
- )
497
-
498
480
assertParse (
499
481
"""
500
482
@available(macOS 11.0, *)
@@ -555,16 +537,6 @@ final class AttributeTests: ParserTestCase {
555
537
"""
556
538
)
557
539
558
- assertParse (
559
- """
560
- @_originallyDefinedIn(
561
- module: " ToasterKit " ,
562
- macOS 10.15,
563
- )
564
- struct Vehicle {}
565
- """
566
- )
567
-
568
540
assertParse (
569
541
"""
570
542
@_originallyDefinedIn(module: " ToasterKit " , macOS 10.15, iOS 13)
@@ -874,26 +846,6 @@ final class AttributeTests: ParserTestCase {
874
846
}
875
847
"""
876
848
)
877
-
878
- assertParse (
879
- """
880
- @attached(
881
- member,
882
- names: named(deinit),
883
- )
884
- macro m()
885
- """
886
- )
887
-
888
- assertParse (
889
- """
890
- @attached(
891
- extension,
892
- conformances: P1, P2,
893
- )
894
- macro AddAllConformances()
895
- """
896
- )
897
849
}
898
850
899
851
func testAttachedExtensionAttribute( ) {
Original file line number Diff line number Diff line change @@ -400,7 +400,17 @@ final class AvailabilityQueryTests: ParserTestCase {
400
400
"""
401
401
if #available(OSX 10.51,1️⃣) {
402
402
}
403
- """
403
+ """ ,
404
+ diagnostics: [
405
+ DiagnosticSpec (
406
+ message: " expected version restriction in availability argument " ,
407
+ fixIts: [ " insert version restriction " ]
408
+ )
409
+ ] ,
410
+ fixedSource: """
411
+ if #available(OSX 10.51, <#identifier#>) {
412
+ }
413
+ """
404
414
)
405
415
}
406
416
Original file line number Diff line number Diff line change @@ -381,9 +381,19 @@ final class AvailabilityQueryUnavailabilityTests: ParserTestCase {
381
381
func testAvailabilityQueryUnavailability23( ) {
382
382
assertParse (
383
383
"""
384
- if #unavailable(OSX 10.51,) {
384
+ if #unavailable(OSX 10.51,1️⃣ ) {
385
385
}
386
- """
386
+ """ ,
387
+ diagnostics: [
388
+ DiagnosticSpec (
389
+ message: " expected version restriction in availability argument " ,
390
+ fixIts: [ " insert version restriction " ]
391
+ )
392
+ ] ,
393
+ fixedSource: """
394
+ if #unavailable(OSX 10.51, <#identifier#>) {
395
+ }
396
+ """
387
397
)
388
398
}
389
399
@@ -601,18 +611,4 @@ final class AvailabilityQueryUnavailabilityTests: ParserTestCase {
601
611
]
602
612
)
603
613
}
604
-
605
- func testTrailingComma( ) {
606
- assertParse (
607
- """
608
- func fooDeprecated() {
609
- if #available(
610
- iOS 18.0,
611
- macOS 14.0,
612
- *,
613
- ) {}
614
- }
615
- """
616
- )
617
- }
618
614
}
You can’t perform that action at this time.
0 commit comments