@ -24,6 +24,7 @@ let all = {none with trace_all= true}
let config : config ref = ref none
let config : config ref = ref none
let parse s =
let parse s =
try
let default = Map . empty ( module String ) in
let default = Map . empty ( module String ) in
let index_from s i =
let index_from s i =
Option . merge ~ f : min
Option . merge ~ f : min
@ -64,13 +65,14 @@ let parse s =
Map . set m ~ key : mod_name
Map . set m ~ key : mod_name
~ data :
~ data :
{ trace_mod
{ trace_mod
; trace_funs = Map . set trace_funs ~ key : fun_name ~ data : enabled
; trace_funs =
}
Map . set trace_funs ~ key : fun_name ~ data : enabled }
| mod_name , None , enabled ->
| mod_name , None , enabled ->
Map . set m ~ key : mod_name
Map . set m ~ key : mod_name
~ data : { trace_mod = Some enabled ; trace_funs = default } )
~ data : { trace_mod = Some enabled ; trace_funs = default } )
in
in
{ none with trace_mods_funs }
Ok { none with trace_mods_funs }
with Assert_failure _ -> Error ( ` Msg ( " Invalid trace spec: " ^ s ) )
let init ? ( margin = 300 ) ~ config : c () =
let init ? ( margin = 300 ) ~ config : c () =
Format . set_margin margin ;
Format . set_margin margin ;