be35cef1ea
This patch fixes syntax highlighting for the following scenario: ``` Type<GenericType>.call() ``` Highlighting generic types is especially tricky, since we want them to be highlighted when appearing at the call site, like above - but we don’t want to highlight them when they are being declared. Hopefully with this fix all/most edge cases are covered.
18 lines
356 B
Swift
18 lines
356 B
Swift
/**
|
|
* Splash
|
|
* Copyright (c) John Sundell 2018
|
|
* MIT license - see LICENSE.md
|
|
*/
|
|
|
|
import Foundation
|
|
|
|
extension Equatable {
|
|
func isAny(of candidates: Self...) -> Bool {
|
|
return candidates.contains(self)
|
|
}
|
|
|
|
func isAny<S: Sequence>(of candidates: S) -> Bool where S.Element == Self {
|
|
return candidates.contains(self)
|
|
}
|
|
}
|