Module Richpp
This module offers semi-structured pretty-printing.
type 'annotation located={annotation : 'annotation option;startpos : int;endpos : int;}Each annotation of the semi-structured document refers to the substring it annotates.
val rich_pp : width:int -> ?depth:int -> Pp.t -> Pp.pp_tag located Xml_datatype.gxmlrich_pp width ppcmdsreturns the interpretation ofppcmdsas a semi-structured document that represents (located) annotations of this string. Theget_annotationsfunction is used to convert tags into the desired annotation.widthsets the printing width of the formatter.
val annotations_positions : 'annotation located Xml_datatype.gxml -> ('annotation * (int * int)) listannotations_positions ssdocreturns a list associating each annotations with its position in the string from whichssdocis built.
val xml_of_rich_pp : ('annotation -> string) -> ('annotation -> (string * string) list) -> 'annotation located Xml_datatype.gxml -> Xml_datatype.xmlxml_of_rich_pp ssdocreturns an XML representation of the semi-structured documentssdoc.
Enriched text
type richpp= Xml_datatype.xml