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:
parent
55809d3146
commit
0f74cd324d
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user