jon.recoil.org

Source file config.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
(**************************************************************************)
(*                                                                        *)
(*                                 OCaml                                  *)
(*                                                                        *)
(*             Xavier Leroy, projet Cristal, INRIA Rocquencourt           *)
(*                                                                        *)
(*   Copyright 1996 Institut National de Recherche en Informatique et     *)
(*     en Automatique.                                                    *)
(*                                                                        *)
(*   All rights reserved.  This file is distributed under the terms of    *)
(*   the GNU Lesser General Public License version 2.1, with the          *)
(*   special exception on linking described in the file LICENSE.          *)
(*                                                                        *)
(**************************************************************************)

(***********************************************************************)
(**                                                                   **)
(**               WARNING WARNING WARNING                             **)
(**                                                                   **)
(** When you change this file, you must make the parallel change      **)
(** in config.mlbuild                                                 **)
(**                                                                   **)
(***********************************************************************)

(* merlin-jst: All magic numbers ending in `500` (or higher) should not change when we
   upgrade the upstream Merlin version.  Otherwise, this should track
   `utils/config.mlp` from the compiler.  Also, the above warning comment about
   `config.mlbuild` is outdated and can be ignored. *)

(* The main OCaml version string has moved to ../VERSION *)
let version = Sys.ocaml_version

(* When bumping this number, be sure to also update ../typing/magic_numbers.ml *)
let cmi_magic_number = "Caml1999I578"

let as_debug_prefix_map_flag = ""

let ast_impl_magic_number = "Caml1999M578"
let ast_intf_magic_number = "Caml1999N578"
let cmt_magic_number = "Caml1999T578"
let cms_magic_number = "Caml1999S578"
let index_magic_number = "Merl2023I578"

let interface_suffix = ref ".mli"

let max_tag = 245

type name_mangling_scheme =
  | Flat
  | Structured

let name_mangling_scheme = Flat

let flat_float_array = false

let reserved_header_bits = 8
let runtime5 = true
let syntax_quotations = true

let merlin = true

module Magic_numbers = struct
  type t =
    { cmi_magic_number : string;
      ast_intf_magic_number : string;
      ast_impl_magic_number : string;
      cmt_magic_number : string;
      cms_magic_number : string;
      index_magic_number : string
    }

  let current =
    { cmi_magic_number;
      ast_intf_magic_number;
      ast_impl_magic_number;
      cmt_magic_number;
      cms_magic_number;
      index_magic_number
    }

  let to_json t =
    let nums =
      [ ("cmi_magic_number", t.cmi_magic_number);
        ("ast_intf_magic_number", t.ast_intf_magic_number);
        ("ast_impl_magic_number", t.ast_impl_magic_number);
        ("cmt_magic_number", t.cmt_magic_number);
        ("cms_magic_number", t.cms_magic_number);
        ("index_magic_number", t.index_magic_number)
      ]
    in
    `Assoc
      (List.map
         (fun (key, value) -> (key, Merlin_utils.Std.Json.string value))
         nums)
end

let config_var _ = failwith "Config.config_var is unimplemented in Merlin"

let print_config _ = failwith "print_config is unimplemented in Merlin"