Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit 6fdc56a9 authored by Sylvain Dailler's avatar Sylvain Dailler
Browse files

Added transformation with args to list-transform.

parent 273efba6
......@@ -349,6 +349,12 @@ let lookup_transform_with_args_l s =
try snd (Hstr.find transforms_with_args_l s)
with Not_found -> raise (UnknownTrans s)
let list_transforms_with_args () =
Hstr.fold (fun k (desc,_) acc -> (k, desc)::acc) transforms_with_args []
let list_transforms_with_args_l () =
Hstr.fold (fun k (desc,_) acc -> (k, desc)::acc) transforms_with_args_l []
let register_transform_with_args ~desc s p =
if Hstr.mem transforms_with_args s then raise (KnownTrans s);
Hstr.replace transforms_with_args s (desc, fun _ -> p)
......
......@@ -168,6 +168,9 @@ val named : string -> 'a trans -> 'a trans
type trans_with_args = string list -> Env.env -> task trans
type trans_with_args_l = string list -> Env.env -> task tlist
val list_transforms_with_args : unit -> (string * Pp.formatted) list
val list_transforms_with_args_l : unit -> (string * Pp.formatted) list
val register_transform_with_args : desc:Pp.formatted -> string -> trans_with_args -> unit
val register_transform_with_args_l : desc:Pp.formatted -> string -> trans_with_args_l -> unit
......
......@@ -171,7 +171,9 @@ let sort_pair (x,_) (y,_) = String.compare x y
let list_transforms _args =
let l =
List.rev_append (Trans.list_transforms ()) (Trans.list_transforms_l ())
List.rev_append
(List.rev_append (Trans.list_transforms ()) (Trans.list_transforms_l ()))
(List.rev_append (Trans.list_transforms_with_args ()) (Trans.list_transforms_with_args_l ()))
in
let print_trans_desc fmt (x,r) =
fprintf fmt "@[<hov 2>%s@\n@[<hov>%a@]@]" x Pp.formatted r
......
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