Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion location.ml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,11 @@ let slurp chan =
| n -> read_all (Bytes.sub buf 0 n :: chunks) in
read_all []

let slurp_string chan =
Bytes.to_string (slurp chan)

let of_file fname =
source fname (slurp (open_in fname))
source fname (slurp_string (open_in fname))

let of_string str =
source "<input>" str
Expand Down