package loc

  1. Overview
  2. Docs

When locations are created manually, such as from a given line number, to compute all the actual positions and offsets we need to access the original contents of the file and locate new lines characters in it. This cache serves this purpose.

type t
val path : t -> Fpath.t

Return the path that was used to create the cache.

val create : path:Fpath.t -> file_contents:string -> t

Create a cache from the name of a file and its contents.

OCaml

Innovation. Community. Security.