- if CoercDb.is_a_coercion' deannot_he && !Acic2content.hide_coercions
- then
- (match CoercDb.is_a_coercion_to_funclass deannot_he with
- | None -> idref aid (last_n 1 (List.map k tl))
- | Some i -> idref aid (last_n (i+1) (List.map k tl)))
+ let coercion_info = CoercDb.is_a_coercion deannot_he in
+ if coercion_info <> None && !Acic2content.hide_coercions then
+ match coercion_info with
+ | None -> assert false
+ | Some (_,_,_,sats,cpos) ->
+ if cpos < List.length tl then
+ let _,rest =
+ try HExtlib.split_nth (cpos+sats+1) tl with Failure _ -> [],[]
+ in
+ if rest = [] then
+ idref aid (List.nth (List.map k tl) cpos)
+ else
+ idref aid (Ast.Appl (List.map k (List.nth tl cpos::rest)))
+ else
+ idref aid (Ast.Appl (List.map k tl))