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:
parent
0eb13e39c0
commit
9af1cb41a8
@ -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) }
|
||||
|
Loading…
Reference in New Issue
Block a user