CoercDb.use_coercions := saved_use_coercions;
raise exn
+let disambiguate_thing =
+ let profiler = CicUtil.profile "disambiguate_thing" in
+ fun ~aliases ~universe
+ ~(f:?fresh_instances:bool ->
+ aliases:DisambiguateTypes.environment ->
+ universe:DisambiguateTypes.multiple_environment option ->
+ 'a -> 'b)
+ ~(set_aliases: DisambiguateTypes.environment -> 'b -> 'b)
+ (thing: 'a)
+ -> profiler.CicUtil.profile
+ (disambiguate_thing ~aliases ~universe ~f ~set_aliases) thing
+
+let disambiguate_thing ~aliases ~universe
+ ~(f:?fresh_instances:bool ->
+ aliases:DisambiguateTypes.environment ->
+ universe:DisambiguateTypes.multiple_environment option ->
+ 'a -> 'b)
+ ~(set_aliases: DisambiguateTypes.environment -> 'b -> 'b)
+ (thing: 'a)
+=
+ Obj.magic disambiguate_thing ~aliases ~universe ~f ~set_aliases thing
+
let set_aliases aliases (choices, user_asked) =
(List.map (fun (_, a, b, c) -> aliases, a, b, c) choices),
user_asked
assert (fresh_instances = None);
let f = Disambiguator.disambiguate_obj ~dbd ~uri in
disambiguate_thing ~aliases ~universe ~f ~set_aliases obj
-
with Unix.Unix_error _ as exc -> raise (UnableToInclude path)
;;
+let profiler_include = CicUtil.profile "include"
+
let eval_command opts status cmd =
let status,cmd = disambiguate_command status cmd in
let cmd,notation_ids' = CicNotation.process_notation cmd in
raise (IncludedFileNotCompiled moopath) in
let stream = Stream.of_channel ic in
let status = ref status in
- !eval_from_stream_ref status stream (fun _ _ -> ());
+ profiler_include.CicUtil.profile
+ (!eval_from_stream_ref status stream) (fun _ _ -> ());
close_in ic;
!status
| GrafiteAst.Set (loc, name, value) ->