From 4264aec518d5407f345c58e18e014e15e9ae96af Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Tue, 5 Jan 2021 11:34:35 +0100 Subject: [sysinit] new component for system initialization This component holds the code for initializing Coq: - parsing arguments not specific to the toplevel - initializing all components from vernac downwards (no stm) This commit moves stm specific arguments parsing to stm/stmargs.ml --- toplevel/workerLoop.ml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'toplevel/workerLoop.ml') diff --git a/toplevel/workerLoop.ml b/toplevel/workerLoop.ml index 59e10b09a0..b0d7bb6f78 100644 --- a/toplevel/workerLoop.ml +++ b/toplevel/workerLoop.ml @@ -9,9 +9,10 @@ (************************************************************************) let worker_parse_extra ~opts extra_args = - (), extra_args + let stm_opts, extra_args = Stmargs.parse_args ~init:Stm.AsyncOpts.default_opts extra_args in + ((),stm_opts), extra_args -let worker_init init () ~opts = +let worker_init init ((),_) ~opts = Flags.quiet := true; init (); Coqtop.init_toploop opts @@ -30,6 +31,6 @@ let start ~init ~loop name = help = worker_specific_usage name; opts = Coqargs.default; init = worker_init init; - run = (fun () ~opts:_ _state (* why is state not used *) -> loop ()); + run = (fun ((),_) ~opts:_ _state (* why is state not used *) -> loop ()); } in start_coq custom -- cgit v1.2.3 From 4c4d6cfacf92b555546055a45edc19b68245b83c Mon Sep 17 00:00:00 2001 From: Enrico Tassi Date: Wed, 6 Jan 2021 14:19:59 +0100 Subject: [sysinit] move initialization code from coqtop to here We also spill (some) non-generic arguments and initialization code out of coqargs and to coqtop, namely colors for the terminal. There are more of these, left to later commits. --- toplevel/workerLoop.ml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'toplevel/workerLoop.ml') diff --git a/toplevel/workerLoop.ml b/toplevel/workerLoop.ml index b0d7bb6f78..e72940d189 100644 --- a/toplevel/workerLoop.ml +++ b/toplevel/workerLoop.ml @@ -8,11 +8,11 @@ (* * (see LICENSE file for the text of the license) *) (************************************************************************) -let worker_parse_extra ~opts extra_args = +let worker_parse_extra extra_args = let stm_opts, extra_args = Stmargs.parse_args ~init:Stm.AsyncOpts.default_opts extra_args in ((),stm_opts), extra_args -let worker_init init ((),_) ~opts = +let worker_init init ((),_) _injections ~opts = Flags.quiet := true; init (); Coqtop.init_toploop opts @@ -28,9 +28,9 @@ let start ~init ~loop name = let open Coqtop in let custom = { parse_extra = worker_parse_extra; - help = worker_specific_usage name; - opts = Coqargs.default; - init = worker_init init; + usage = worker_specific_usage name; + initial_args = Coqargs.default; + init_extra = worker_init init; run = (fun ((),_) ~opts:_ _state (* why is state not used *) -> loop ()); } in start_coq custom -- cgit v1.2.3