Module Odoc_model.Location_Source
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
A specific character
type span = Odoc_parser.Loc.span = {file : string;start : Odoc_model.Location_.point;end_ : Odoc_model.Location_.point;
}A range of characters between start and end_ in a particular file
val span : Odoc_model.Location_.span list -> Odoc_model.Location_.spanspan 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 -> Odoc_model.Location_.span -> Odoc_model.Location_.spanThis adjusts only the column number, implicitly assuming that the offset does not move the location across a newline character.
val nudge_end : int -> Odoc_model.Location_.span -> Odoc_model.Location_.spanThis 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 = {location : Odoc_model.Location_.span;value : 'a;
}Describes values located at a particular span
val at :
Odoc_model.Location_.span ->
'a ->
'a Odoc_model.Location_.with_locationConstructor for with_location
val location :
'a Odoc_model.Location_.with_location ->
Odoc_model.Location_.spanReturns the location of a located value
val value : 'a Odoc_model.Location_.with_location -> 'aReturns the value of a located value
val map :
('a -> 'b) ->
'a Odoc_model.Location_.with_location ->
'b Odoc_model.Location_.with_locationMap over a located value without changing its location
val same :
_ Odoc_model.Location_.with_location ->
'b ->
'b Odoc_model.Location_.with_locationsame x y retuns the value y wrapped in a with_location whose location is that of x
val spans_multiple_lines : _ Odoc_model.Location_.with_location -> boolspans_multiple_lines x checks to see whether x is located on a single line or whether it covers more than one.
val set_end_as_offset_from_start :
int ->
Odoc_model.Location_.span ->
Odoc_model.Location_.spanval in_string :
string ->
offset:int ->
length:int ->
Odoc_model.Location_.span ->
Odoc_model.Location_.span