File tree 3 files changed +32
-6
lines changed
3 files changed +32
-6
lines changed Original file line number Diff line number Diff line change @@ -614,7 +614,7 @@ return non-nil."
614
614
" isolated" " each" ))
615
615
(member (swift-mode:token:text next-token)
616
616
'(" any" " some" " inout" " borrowing" " consuming" " throws"
617
- " rethrows" " in" " where" " isolated" )))
617
+ " rethrows" " in" " where" " isolated" " each " )))
618
618
nil )
619
619
620
620
; ; Before async
@@ -731,6 +731,12 @@ return non-nil."
731
731
" let" " var" " throw" " import" ))
732
732
nil )
733
733
734
+ ; ; Suppress import semicolon after `repeat' unless followed by a open
735
+ ; ; curly bracket.
736
+ ((and (equal (swift-mode:token:text previous-token) " repeat" )
737
+ (not (eq (swift-mode:token:type next-token) '{ )))
738
+ nil )
739
+
734
740
; ; Inserts implicit semicolon before keywords that starts a new
735
741
; ; statement.
736
742
((member (swift-mode:token:text next-token)
Original file line number Diff line number Diff line change @@ -863,20 +863,20 @@ func foo()
863
863
864
864
865
865
// Value and Type Parameter Packs
866
- // https://github.com/apple/swift-evolution/blob/main/proposals/0393-parameter-packs.md#introduction
866
+ // https://github.com/apple/swift-evolution/blob/main/proposals/0393-parameter-packs.md
867
867
// https://github.com/apple/swift-evolution/blob/main/proposals/0398-variadic-types.md
868
868
869
869
func constrain< each S : Sequence > (
870
870
_: repeat
871
- each // swift-mode:test:known-bug
872
- S // swift-mode:test:known-bug
871
+ each
872
+ S
873
873
) where (
874
874
repeat
875
- ( // swift-mode:test:known-bug
875
+ (
876
876
each
877
877
S
878
878
)
879
- . Element
879
+ . Element
880
880
) == ( Int , String ) {
881
881
}
882
882
Original file line number Diff line number Diff line change 332
332
foo ( )
333
333
}
334
334
335
+ // Pack iteration
336
+ // https://github.com/swiftlang/swift-evolution/blob/main/proposals/0408-pack-iteration.md
337
+ for element
338
+ in
339
+ repeat
340
+ each
341
+ element {
342
+ }
343
+
344
+ for (left, right)
345
+ in
346
+ repeat
347
+ (
348
+ each
349
+ lhs,
350
+ each
351
+ rhs
352
+ ) {
353
+ }
354
+
335
355
336
356
// While statements
337
357
You can’t perform that action at this time.
0 commit comments