-
Notifications
You must be signed in to change notification settings - Fork 46
Improve templates for the Swift standard library #35
Comments
Do you have a list of types you'd like to be covered? Otherwise, there could be multiple PRs, each covering one to a few classes at a time. |
Yeah, multiple PRs would definitely be best. I don't have a list yet. I thought about maybe using something like the documentation to create a list, at least so we can be sure we considered everything (even though we won't be able to translate everything). |
Alright, when I find the time I'll go over it and look at possible classes and methods that need translating. |
So I dug through the documentation link you provided and came up with a list of types and functions that should be looked at in how they are translated. Most are covered already. I will dump this list here as you are currently working on the SourceKit AST version of gryphon if I am not mistaken. What do you think? Bool
Int
Double
Float
Range
ClosedRange
Error
Result
Optional
String
Character
Unicode
StaticString
Array
Dictionary
Set
OptionSet
Equatable
Comparable
Identifiable
Hashable
Hasher
CustomStringConvertible
LosslessStringConvertible
CustomDebugStringConvertible
CaseIterable
RawRepresentable
Encodable
Decodable
CodingKey
CodingUserInfoKey
Encoder
Decoder
ExpressibleByArrayLiteral
ExpressibleByDictionaryLiteral
ExpressibleByIntegerLiteral
ExpressibleByFloatLiteral
ExpressibleByBooleanLiteral
ExpressibleByNilLiteral
ExpressibleByStringLiteral
ExpressibleByExtendedGraphemeClusterLiteral
ExpressibleByUnicodeScalarLiteral
ExpressibleByStringInterpolation
CommandLine
TextOutputStream
TextOutputStreamable
CustomReflectable
CustomLeafReflectable
CustomPlaygroundDisplayConvertible
KeyPath
PartialKeyPath
AnyKeyPath
WritableKeyPath
ReferenceWritableKeyPath func print(Any, separator: String, terminator: String)
func print<Target>(Any, separator: String, terminator: String, to: inout Target)
func readLine(strippingNewLine: Bool) -> String?
func debugPrint(Any, separator: String, terminator: String)
func debugPrint<Target>(Any, separator: String, terminator: String, to: inout Target)
func dump<T>(_ value: T, name: String? = nil, indent: Int = 0, maxDepth: Int = .max, maxItems: Int = .max) -> T
func dump<T, TargetStream>(_ value: T, to target: inout TargetStream, name: String? = nil, indent: Int = 0, maxDepth: Int = .max, maxItems: Int = .max) -> T where TargetStream : TextOutputStream
func assert(_ condition: @autoclosure () -> Bool, _ message: @autoclosure () -> String = String(), file: StaticString = #file, line: UInt = #line)
func assertionFailure(_ message: @autoclosure () -> String = String(), file: StaticString = #file, line: UInt = #line)
func precondition(_ condition: @autoclosure () -> Bool, _ message: @autoclosure () -> String = String(), file: StaticString = #file, line: UInt = #line)
func preconditionFailure(_ message: @autoclosure () -> String = String(), file: StaticString = #file, line: UInt = #line) -> Never
func fatalError(_ message: @autoclosure () -> String = String(), file: StaticString = #file, line: UInt = #line) -> Never
´´´ |
Looks great! Yeah, I'm working on SourceKit right now, but this could be done in parallel if you want to. Based on your list, I created a new Status.md file we can use to track development. I'm not sure I like how it turned out though, so suggestions for improving it are welcome. If you want to begin implementing the new templates, I'd probably start with the easier "concrete" types (
In any case, let me know if you need help! |
The templates file currently covers a few parts of the Swift standard library, mainly Strings and Arrays. This issue will be used to keep track of expanding the standard library support to other types and methods.
The text was updated successfully, but these errors were encountered: