package ocamlformat-mlx-lib

  1. Overview
  2. Docs
OCaml .mlx Code Formatter

Install

Dune Dependency

Authors

Maintainers

Sources

ocamlformat-mlx-0.27.0.tbz
sha256=6a40faa182faee55f32bc92387b7e7f97818e160e0f4ef0e0032c0b8b70b86d1
sha512=7df487ebdcddff3529886e034fa9d5476c765c60926b11b8d86fb0e42bea3ee41f693c898e7f95bfc19ca9fa0116825c040a3e027c1e3b7505ebe6c6508540ec

doc/ocamlformat-mlx-lib.odoc_parser/Ocamlformat_odoc_parser/Loc/index.html

Module Ocamlformat_odoc_parser.LocSource

Locations in files.

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

Basic types

Sourcetype point = {
  1. line : int;
  2. column : int;
}

A specific character

Sourcetype span = {
  1. file : string;
  2. start : point;
  3. end_ : point;
}

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

Sourceval 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

Sourceval 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.

Sourceval nudge_end : 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

Sourcetype +'a with_location = {
  1. location : span;
  2. value : 'a;
}

Describes values located at a particular span

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

Constructor for with_location

Sourceval location : 'a with_location -> span

Returns the location of a located value

Sourceval value : 'a with_location -> 'a

Returns the value of a located value

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

Map over a located value without changing its location

Sourceval 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

Sourceval spans_multiple_lines : _ with_location -> bool

spans_multiple_lines x checks to see whether x is located on a single line or whether it covers more than one.

OCaml

Innovation. Community. Security.