package merlin-lib

  1. Overview
  2. Docs
Merlin's libraries

Install

dune-project
 Dependency

Authors

Maintainers

Sources

merlin-5.8-505.tbz
sha256=5642cde8486a84aad98fa5c590b70e8dcc6074d7fbdb3b9b8c46b2c5b42f653b
sha512=1d7a7751157e393d3ae248ef5ae24a6b4e81430666c61cc51a3d0ec35804523317036f3d7a3c7f18a7554337f4e5f5989fb677865b261ece3fd2b317903570ba

doc/merlin-lib.ocaml_utils/Ocaml_utils/Linkdeps/index.html

Module Ocaml_utils.LinkdepsSource

Sourcetype t

The state of the linking check. It keeps track of compilation units provided and required so far.

Sourcetype compunit = string
Sourcetype filename = string
Sourceval create : complete:bool -> t

create ~complete returns an empty state. If complete is true, missing compilation units will be treated as errors.

Sourceval add : t -> filename:filename -> compunit:compunit -> provides:compunit list -> requires:compunit list -> unit

add t ~filename ~compunit ~provides ~requires registers the compilation unit compunit found in filename to t.

  • provides are units and sub-units provided by compunit
  • requires are units required by compunit

add should be called in reverse topological order.

Sourceval required : t -> compunit -> bool

required t compunit returns true if compunit is a dependency of previously added compilation units.

Sourcetype compunit_and_source = {
  1. compunit : compunit;
  2. filename : filename;
}
Sourcetype error =
  1. | Missing_implementations of (compunit * compunit_and_source list) list
  2. | Multiple_definitions of (compunit * filename list) list
Sourceval check : t -> error option

check t should be called once all the compilation units to be linked have been added. It returns some error if:

  • There are some missing implementations and complete is true
  • Some implementation appear before their dependencies
Sourceval report_error : print_filename:string Format_doc.printer -> error Format_doc.format_printer
Sourceval report_error_doc : print_filename:string Format_doc.printer -> error Format_doc.printer