let node_of_dsp_line (doc_settings : t_doc_settings) (path : t_path) (auto_nr : int) (a : Doc_types.tr_dsp_line) : t_node =
match a.fld_dsp_line_lbl with
| Some (Cu_lbl_auto Cs_lbl_auto) -> (
let lvl : int = lvl_of_path path in
let lbl : string = doc_settings.auto_numbering lvl auto_nr in
match a.fld_dsp_line_id with
|None -> DSP_LINE_NODE (DSP_AUTO lbl)
|Some id -> (
match doc_settings.expand_tag id.fld_id_tag with
|None -> DSP_LINE_NODE (DSP_AUTO lbl)
|Some (_,tag) -> DSP_LINE_NODE (DSP_TAG_AUTO (tag, lbl))
)
)
| Some (Cu_lbl_custom (Cs_lbl_custom (s : string))) -> (
match a.fld_dsp_line_id with
|None -> DSP_LINE_NODE (DSP_CUSTOM s)
|Some id -> (
match doc_settings.expand_tag id.fld_id_tag with
|None -> DSP_LINE_NODE (DSP_CUSTOM s)
|Some (_,tag) -> DSP_LINE_NODE (DSP_TAG_CUSTOM (tag,s))
)
)
| None -> DSP_LINE_NODE DSP_NONE