let rec string_of_ts_c_ref (doc_settings : t_doc_settings) (cref_table : t_cref_table) (c_ref_loc : t_path) (c_ref : Doc_types.ts_c_ref) : string =
match reference_of_ts_c_ref cref_table c_ref_loc c_ref with
|None -> (
match c_ref with
|Cs_c_ref id_c_ref ->
let _ : unit = IO.print_warning (String.concat "" [
"WARNING: id \'";
string_of_tr_id id_c_ref;
"\' referenced in ";
string_of_path doc_settings c_ref_loc;
" does not exist or is out of scope.";
]) in "??"
)
|Some (_, id_loc, _) ->
let sub_path = (path_from_common_ancestor c_ref_loc id_loc) in
match List.rev sub_path with
|hd::tl -> (
match hd with
|ABSTRACT_NODE | REFS_NODE -> (
match id_loc with
|(ITM_NODE (ITM_BIB_AUTO _))::_ | (ITM_NODE (ITM_BIB_CUSTOM _))::_ ->
string_of_shown_path doc_settings id_loc (List.rev tl)
|_ -> String.concat "\u{00A0}" [string_of_shown_path doc_settings id_loc (List.rev tl);"of"; string_of_path doc_settings [hd]]
)
|_ -> string_of_shown_path doc_settings id_loc sub_path
)
|[] -> raise (Error "path to id cannot be empty")