Commit 8ab7b281 authored by Sylvain Dailler's avatar Sylvain Dailler
Browse files

Adding transformation doc in the completion. (first attempt)

parent 20df9505
...@@ -1934,7 +1934,7 @@ let add_submenu_prover (shortcut,prover_name,prover_parseable_name) = ...@@ -1934,7 +1934,7 @@ let add_submenu_prover (shortcut,prover_name,prover_parseable_name) =
let init_completion provers transformations strategies commands = let init_completion provers transformations strategies commands =
(* add the names of all the the transformations *) (* add the names of all the the transformations *)
List.iter (fun s -> add_completion_entry (s,"transformation")) transformations; List.iter add_completion_entry transformations;
(* add the name of the commands *) (* add the name of the commands *)
List.iter (fun s -> add_completion_entry (s,"command")) commands; List.iter (fun s -> add_completion_entry (s,"command")) commands;
(* todo: add queries *) (* todo: add queries *)
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
(* Information that the IDE may want to have *) (* Information that the IDE may want to have *)
type prover = string type prover = string
type transformation = string type transformation = (string * string)
type strategy = string type strategy = string
...@@ -30,7 +30,7 @@ type global_information = ...@@ -30,7 +30,7 @@ type global_information =
(* hidden_provers : string list; *) (* hidden_provers : string list; *)
(* session_time_limit : int; *) (* session_time_limit : int; *)
(* session_mem_limit : int; *) (* session_mem_limit : int; *)
(* session_nb_processes : int; *) (* session_nb_processes : int; *)
(* session_cntexample : bool; *) (* session_cntexample : bool; *)
(* main_dir : string *) (* main_dir : string *)
} }
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
(********************************************************************) (********************************************************************)
type prover = string type prover = string
type transformation = string (* Name and description *)
type transformation = (string * string)
type strategy = string type strategy = string
type node_ID = int type node_ID = int
......
...@@ -1042,7 +1042,7 @@ end ...@@ -1042,7 +1042,7 @@ end
(s,n,p) :: acc) (Whyconf.get_provers config) [] (s,n,p) :: acc) (Whyconf.get_provers config) []
in in
load_strategies c; load_strategies c;
let transformation_list = List.map fst (list_transforms ()) in let transformation_list = List.map (fun (a, b) -> (a, Format.sprintf "%( %)" b)) (list_transforms ()) in
let strategies_list = list_strategies c in let strategies_list = list_strategies c in
let infos = let infos =
{ {
......
...@@ -34,7 +34,11 @@ let convert_infos (i: global_information) = ...@@ -34,7 +34,11 @@ let convert_infos (i: global_information) =
in in
Record (convert_record Record (convert_record
["provers", List (List.map convert_prover i.provers); ["provers", List (List.map convert_prover i.provers);
"transformations", List (List.map (fun x -> String x) i.transformations); "transformations",
List (List.map
(fun (a, b) ->
Record (convert_record ["name_t", String a; "desc_t", String b]))
i.transformations);
"strategies", List (List.map convert_strategy i.strategies); "strategies", List (List.map convert_strategy i.strategies);
"commands", List (List.map (fun x -> String x) i.commands)]) "commands", List (List.map (fun x -> String x) i.commands)])
...@@ -567,6 +571,12 @@ let parse_infos j = ...@@ -567,6 +571,12 @@ let parse_infos j =
try try
let pr = get_list (get_field j "provers") in let pr = get_list (get_field j "provers") in
let tr = get_list (get_field j "transformations") in let tr = get_list (get_field j "transformations") in
let tr =
List.map (fun j ->
try
get_string (get_field j "name_t"),
get_string (get_field j "desc_t")
with | _ -> raise (NotInfos "transformations")) tr in
let str = get_list (get_field j "strategies") in let str = get_list (get_field j "strategies") in
let com = get_list (get_field j "commands") in let com = get_list (get_field j "commands") in
{provers = List.map (fun j -> try {provers = List.map (fun j -> try
...@@ -574,7 +584,7 @@ let parse_infos j = ...@@ -574,7 +584,7 @@ let parse_infos j =
get_string (get_field j "prover_name"), get_string (get_field j "prover_name"),
get_string (get_field j "prover_parseable_name")) get_string (get_field j "prover_parseable_name"))
with Not_found -> raise (NotInfos "provers")) pr; with Not_found -> raise (NotInfos "provers")) pr;
transformations = List.map (fun j -> match j with | String x -> x | _ -> raise (NotInfos "transformations")) tr; transformations = tr;
strategies = List.map (fun j -> try strategies = List.map (fun j -> try
(get_string (get_field j "strategy_shortcut"), (get_string (get_field j "strategy_shortcut"),
get_string (get_field j "strategy_name")) get_string (get_field j "strategy_name"))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment