1
1
mirror of https://github.com/github/semantic.git synced 2024-12-26 00:12:29 +03:00

Add a readFile function.

This commit is contained in:
Rob Rix 2015-10-27 18:29:27 -04:00
parent 0eb13e39c0
commit 9af1cb41a8

View File

@ -28,6 +28,11 @@ extension TSInput {
}
}
func readFile(path: String) -> String? {
guard let data = try? NSString(contentsOfFile: path, encoding: NSUTF8StringEncoding) else { return nil }
return data as String?
}
func termWithInput(input: TSInput) -> Cofree<String, Range<Int>>? {
let document = ts_document_make()
defer { ts_document_free(document) }