package odoc

  1. Overview
  2. Docs
OCaml documentation generator

Install

Dune Dependency

Authors

Maintainers

Sources

odoc-2.1.1.tbz
sha256=f574dbd28cd0fc3a2b95525c4bb95ddf6d1f6408bb4fe12157fa537884f987fd
sha512=1c545c281a7022a167f028fff8cec6fb3f2f82da0881431be74e7a4281c5353ed83bfbdb4d9d9e08af6755dbe3505c052c5e5b58cdeb08c57aed5e89c0f15e91

doc/odoc.model/Odoc_model/Location_/index.html

Module Odoc_model.Location_

include module type of struct include Odoc_parser.Loc end

This module concerns locations in source files, both points indicating a specific character and spans between two points.

Basic types

type point = Odoc_parser.Loc.point = {
  1. line : int;
  2. column : int;
}

A specific character

type span = Odoc_parser.Loc.span = {
  1. file : string;
  2. start : point;
  3. end_ : point;
}

A range of characters between start and end_ in a particular file

val span : span list -> span

span spans takes a list of spans and returns a single span starting at the start of the first span and ending at the end of the final span

val nudge_start : int -> span -> span

This adjusts only the column number, implicitly assuming that the offset does not move the location across a newline character.

Located values

type +'a with_location = 'a Odoc_parser.Loc.with_location = {
  1. location : span;
  2. value : 'a;
}

Describes values located at a particular span

val at : span -> 'a -> 'a with_location

Constructor for with_location

val location : 'a with_location -> span

Returns the location of a located value

val value : 'a with_location -> 'a

Returns the value of a located value

val map : ('a -> 'b) -> 'a with_location -> 'b with_location

Map over a located value without changing its location

val same : _ with_location -> 'b -> 'b with_location

same x y retuns the value y wrapped in a with_location whose location is that of x

val set_end_as_offset_from_start : int -> span -> span
val in_string : string -> offset:int -> length:int -> span -> span
val pp : Format.formatter -> span -> unit
val pp_span_start : Format.formatter -> span -> unit
val span_equal : span -> span -> bool
OCaml

Innovation. Community. Security.