Module Fleche.Contents

type t = private {
  1. raw : string;
    (*

    That's the original, unprocessed document text, including markdown

    *)
  2. text : string;
    (*

    That's the text to be sent to the prover, already processed, and stripped from markdown, encoded in UTF-8

    *)
  3. last : Lang.Point.t;
    (*

    Last point of text, you can derive n_lines from here

    *)
  4. lines : string Stdlib.Array.t;
    (*

    text split in lines

    *)
}
module R : sig ... end
val make : uri:Lang.LUri.File.t -> raw:string -> t R.t

Process contents

val make_raw : raw:string -> t

Make an object of type t but don't process the text, this is only used internally to still provide some contents when make fails.

val extract_raw : contents:t -> range:Lang.Range.t -> string

extract_raw contents ~range Returns the sub-string of the raw part of the document