Debian Codegraph @

toplevel/load.ml

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 open Pp
12 open Coqargs
13
14 (******************************************************************************)
15 (* Interactive Load File Simulation *)
16 (******************************************************************************)
17
18 let load_init_file opts ~state =
19 if opts.pre.load_rcfile then
20 Topfmt.(in_phase ~phase:LoadingRcFile) (fun () ->
21 Coqrc.load_rcfile ~rcfile:opts.config.rcfile ~state) ()
22 else begin
23 Flags.if_verbose Feedback.msg_info (str"Skipping rcfile loading.");
24 state
25 end
26
27 let load_vernacular opts ~state =
28 List.fold_left
29 (fun state (f_in, echo) ->
30 let s = Loadpath.locate_file f_in in
31 (* Should make the beautify logic clearer *)
32 let load_vernac f = Vernac.load_vernac ~echo ~check:true ~state f in
33 if !Flags.beautify
34 then Flags.with_option Flags.beautify_file load_vernac f_in
35 else load_vernac s
36 ) state opts.pre.load_vernacular_list
37
38 let load_init_vernaculars opts ~state =
39 let state = load_init_file opts ~state in
40 let state = load_vernacular opts ~state in
41 state