package ocp-index

  1. Overview
  2. Docs

Source file indexTypes.ml

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
(**************************************************************************)
(*                                                                        *)
(*  Copyright 2013 OCamlPro                                               *)
(*                                                                        *)
(*  All rights reserved.  This file is distributed under the terms of     *)
(*  the Lesser GNU Public License version 3.0.                            *)
(*                                                                        *)
(*  This software is distributed in the hope that it will be useful,      *)
(*  but WITHOUT ANY WARRANTY; without even the implied warranty of        *)
(*  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *)
(*  Lesser GNU General Public License for more details.                   *)
(*                                                                        *)
(**************************************************************************)

(* * This module contains open types, for use within the library only. Its
    interface should only be exported through closed types in LibIndex. *)

(** Internal representation of types *)
type ty = Outcometree.out_sig_item

(** The type of files we get our data from *)
type orig_file = Cmt of string | Cmti of string | Cmi of string

(** Contains the information on a given identifier *)
type info = { path: string list;
              orig_path: string list;
              kind: kind;
              name: string;
              ty: ty option;
              loc_sig: Location.t Lazy.t;
              loc_impl: Location.t Lazy.t;
              doc: string option Lazy.t;
              file: orig_file;
           (* library: string option *) }

(** The kind of elements that can be stored in the trie *)
and kind =
  | Type | Value | Exception
  | OpenType
  | Field of info | Variant of info
  | Method of info
  | Module | ModuleType
  | Class | ClassType
  | Keyword

(** Lazy trie structure holding the info on all identifiers *)
type t = (char, info) IndexTrie.t

(* * Raised when cmi/cmt/cmti files can't be loaded. Probably a different
    version of OCaml *)
exception Bad_format of string
OCaml

Innovation. Community. Security.