aboutsummaryrefslogtreecommitdiffhomepage
path: root/ide/coq.ml
diff options
context:
space:
mode:
authorGravatar Enrico Tassi <Enrico.Tassi@inria.fr>2014-01-22 10:27:41 +0100
committerGravatar Enrico Tassi <Enrico.Tassi@inria.fr>2014-01-26 14:20:52 +0100
commit3afdca3562b9dcadd9b16991bd8716f38a55f2c8 (patch)
treec4c8dbb63e8546244b4ff9aa9fc71140d27754b5 /ide/coq.ml
parenta2c200faca4cd20985836f1661e9b2059fd20651 (diff)
CoqIDE: command line for extra coqtop "flags"
Like the socket for the OCaml debugger
Diffstat (limited to 'ide/coq.ml')
-rw-r--r--ide/coq.ml14
1 files changed, 14 insertions, 0 deletions
diff --git a/ide/coq.ml b/ide/coq.ml
index bb0fdc089..c8ba8549b 100644
--- a/ide/coq.ml
+++ b/ide/coq.ml
@@ -381,6 +381,20 @@ let bind_self_as f =
let spawn_handle args respawner feedback_processor =
let prog = coqtop_path () in
let args = Array.of_list ("-async-proofs" :: "on" :: "-ideslave" :: args) in
+ let env =
+ match !Flags.ideslave_coqtop_flags with
+ | None -> None
+ | Some s ->
+ let open Str in
+ let open Array in
+ let opts = split_delim (regexp ",") s in
+ begin try
+ let erex = regexp "^extra-env=" in
+ let echunk = List.find (fun s -> string_match erex s 0) opts in
+ Some (append
+ (of_list (split_delim (regexp ";") (replace_first erex "" echunk)))
+ (Unix.environment ()))
+ with Not_found -> None end in
bind_self_as (fun handle ->
let proc, oc =
CoqTop.spawn ?env prog args (input_watch handle respawner feedback_processor) in