package grace

  1. Overview
  2. Docs
A fancy diagnostics library that allows your compilers to exit with grace

Install

Dune Dependency

Authors

Maintainers

Sources

grace-0.2.0.tbz
sha256=821df54882c9253eac69f47bcf3a71ffdc61c77fdae42587c32aada5b56cfeae
sha512=007afa83251da3ddecd874e120ea89dce0253c387a64a5fece69069d3486ec5eb6c82d6bf0febaf23dd322bd9eaadc2f7882e33f05a2e1fa18a41294e7dc3ba1

doc/grace.source_reader/Grace_source_reader/Line/index.html

Module Grace_source_reader.LineSource

Sourcetype t = {
  1. idx : Grace.Line_index.t;
  2. range : Grace.Range.t;
}

The type of a line.

include Sexplib0.Sexpable.S with type t := t
Sourceval t_of_sexp : Sexplib0.Sexp.t -> t
Sourceval sexp_of_t : t -> Sexplib0.Sexp.t
Sourceval of_line_index : Source_descr.t -> Grace.Line_index.t -> t

of_line_index sd idx returns the line at index idx in source sd.

Sourceval of_byte_index : Source_descr.t -> Grace.Byte_index.t -> t

of_byte_index sd idx returns the line containing idx in source sd.

start t returns the byte index of the (inclusive) start position of the line.

stop t returns the byte index of the (exclusive) stop position of the line.

split t returns the pair of byte indices of the line t.

Sourceval last : Source_descr.t -> t

last sd returns the last line in the source sd.

Sourceval slice : t -> sd:Source_descr.t -> string

slice t ~sd reads the slice of bytes defined by the line's range.

  • raises Invalid_argment

    if the source descriptor's underlying source is not equal to the line range's source.

OCaml

Innovation. Community. Security.