Debian Codegraph @

lib/coqProject_file.mli

raw symbols SCIP
1 (************************************************************************)
2 (* * The Rocq Prover / The Rocq Development Team *)
3 (* v * Copyright INRIA, CNRS and contributors *)
4 (* <O___,, * (see version control and CREDITS file for authors & dates) *)
5 (* \VV/ **************************************************************)
6 (* // * This file is distributed under the terms of the *)
7 (* * GNU Lesser General Public License Version 2.1 *)
8 (* * (see LICENSE file for the text of the license) *)
9 (************************************************************************)
10
11 exception Parsing_error of string
12
13 type arg_source = CmdLine | ProjectFile
14
15 type 'a sourced = { thing : 'a; source : arg_source }
16
17 type meta_file = Absent | Present of string | Generate of string
18
19 type 'a project = {
20 project_file : string option;
21 makefile : string option;
22 native_compiler : native_compiler option;
23 (* the installation path for installing project documentation (relative to
24 * the user-contrib folder) *)
25 docroot : string option;
26
27 files : string sourced list; (* .v, .ml, .mlg, .mli, .mllib, .mlpack files *)
28 cmd_line_files : string sourced list;
29 meta_file : meta_file;
30
31 ml_includes : path sourced list;
32 r_includes : (path * logic_path) sourced list;
33 q_includes : (path * logic_path) sourced list;
34 extra_args : string sourced list;
35 defs : (string * string) sourced list;
36
37 extra_data : 'a;
38 }
39 and logic_path = string
40 and path = { path : string; canonical_path : string }
41 and native_compiler =
42 | NativeYes
43 | NativeNo
44 | NativeOndemand
45
46 val cmdline_args_to_project
47 : warning_fn:(string -> unit) -> curdir:string
48 -> parse_extra:(string -> string list -> 'a -> (string list * 'a) option)
49 -> 'a -> string list -> 'a project
50
51 exception UnableToOpenProjectFile of string
52
53 val read_project_file : warning_fn:(string -> unit) -> string -> unit project
54 (** [read_project_file warning_fn file] parses [file] as a Coq project;
55 use [warning_fn] for deprecate options;
56 raise [Parsing_error] on illegal options or arguments;
57 raise [UnableToOpenProjectFile msg] if the file could not be opened;
58 fails on some illegal non-project-file options *)
59
60 val coqtop_args_from_project : _ project -> string list
61 val find_project_file : from:string -> projfile_name:string -> string option
62
63 val all_files : _ project -> string sourced list
64 val files_by_suffix : string sourced list -> string list -> string sourced list
65
66 val map_sourced_list : ('a -> 'b) -> 'a sourced list -> 'b list
67
68 (** Only uses the elements with source=CmdLine *)
69 val map_cmdline : ('a -> 'b) -> 'a sourced list -> 'b list
70
71 val forget_source : 'a sourced -> 'a