package merlin-lib

  1. Overview
  2. Docs
Merlin's libraries

Install

dune-project
 Dependency

Authors

Maintainers

Sources

merlin-5.7-505.preview.tbz
sha256=a3047606d06580e251ee8acbeb67f80f1d059238f879e187e10de40b4ec61be7
sha512=871f4e8f1111d086985172a9157812d5e22fd746edeffa8bdb5363f5c8cef2308da36a57d989ae77becec32eaa6ea4e8ef67f9b0247cbd409537701644db563f

doc/merlin-lib.kernel/Merlin_kernel/Msource/index.html

Module Merlin_kernel.MsourceSource

Sourcetype t

Merlin representation of a textual source code

It bundles filename and a content, and offers functions for computing positions in the source.

Sourcemodule Digest : sig ... end

Minimal Digest utilities around t

Sourceval make : string -> t

Making a content from name and contents.

Position management

Sourcetype position = [
  1. | `Start
  2. | `Offset of int
  3. | `Logical of int * int
  4. | `End
]
Sourceval equal_position : position -> position -> bool
Sourceval get_offset : t -> [< position ] -> [> `Offset of int ]
Sourceval get_logical : t -> [< position ] -> [> `Logical of int * int ]
Sourceval compare_position : t -> position -> position -> int
Sourceval get_lexing_pos : t -> filename:string -> [< position ] -> Lexing.position

Managing content

Sourceval substitute : t -> [< position ] -> [< position | `Length of int ] -> string -> t

Updating content

Sourceval text : t -> string

Source code of the file

Sourceval print_position : unit -> [< position ] -> string