-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add IntSet, a (inefficient) implementation of IndexSet
- Loading branch information
Showing
5 changed files
with
426 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
// Copyright 2023 Skip | ||
// | ||
// This is free software: you can redistribute and/or modify it | ||
// under the terms of the GNU Lesser General Public License 3.0 | ||
// as published by the Free Software Foundation https://fsf.org | ||
|
||
// SKIP SYMBOLFILE | ||
|
||
#if SKIP | ||
|
||
public struct IntSet: BidirectionalCollection, SetAlgebra { | ||
public typealias Index = Int | ||
public typealias Element = Int | ||
|
||
public init(integersIn range: any RangeExpression<Int>) { | ||
} | ||
|
||
public init(integer: Int) { | ||
} | ||
|
||
public init() { | ||
} | ||
|
||
@available(*, unavailable) | ||
public var rangeView: Any { | ||
fatalError() | ||
} | ||
|
||
@available(*, unavailable) | ||
public func rangeView(of range: any RangeExpression<Int>) -> Any { | ||
} | ||
|
||
public func integerGreaterThan(_ integer: Int) -> Int? { | ||
return nil | ||
} | ||
|
||
public func integerLessThan(_ integer: Int) -> Int? { | ||
return nil | ||
} | ||
|
||
public func integerGreaterThanOrEqualTo(_ integer: Int) -> Int? { | ||
return nil | ||
} | ||
|
||
public func integerLessThanOrEqualTo(_ integer: Int) -> Int? { | ||
return nil | ||
} | ||
|
||
@available(*, unavailable) | ||
public func indexRange(in range: any RangeExpression<Int>) -> Range<Int> { | ||
fatalError() | ||
} | ||
|
||
public func count(in range: any RangeExpression<Int>) -> Int { | ||
return 0 | ||
} | ||
|
||
public func contains(integersIn range: any RangeExpression<Int>) -> Bool { | ||
return false | ||
} | ||
|
||
public func contains(integersIn indexSet: IntSet) -> Bool { | ||
return false | ||
} | ||
|
||
public func intersects(integersIn range: any RangeExpression<Int>) -> Bool { | ||
return false | ||
} | ||
|
||
public mutating func insert(integersIn range: any RangeExpression<Int>) { | ||
} | ||
|
||
public mutating func remove(integersIn range: any RangeExpression<Int>) { | ||
} | ||
|
||
public func filteredIndexSet(in range: any RangeExpression<Int>, includeInteger: (Int) throws -> Bool) rethrows -> IntSet { | ||
return self | ||
} | ||
|
||
public func filteredIndexSet(includeInteger: (Int) throws -> Bool) rethrows -> IntSet { | ||
return self | ||
} | ||
|
||
@available(*, unavailable) | ||
public mutating func shift(startingAt integer: Int, by delta: Int) { | ||
} | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.