1
1
mirror of https://github.com/github/semantic.git synced 2024-12-25 07:55:12 +03:00

Sources are constructed with a string.

This commit is contained in:
Rob Rix 2015-10-29 16:06:51 -04:00
parent 55809d3146
commit 0f74cd324d

View File

@ -7,6 +7,12 @@ extension String: ErrorType {}
typealias Term = Cofree<String, Info>
struct Source {
init?(_ argument: String) {
URL = NSURL(string: argument) ?? NSURL(fileURLWithPath: argument)
guard let type = URL.pathExtension else { return nil }
self.type = type
}
let URL: NSURL
let type: String
}