+ and aux_attributes xmlattrs mathonly xref pos prec uris t =
+ let new_level = ref None in
+ let new_xref = ref None in
+ let new_uris = ref [] in
+ let new_xmlattrs = ref [] in
+ let rec aux_attribute =
+ function
+ | A.AttributedTerm (attr, t) ->
+ (match attr with
+ | `Loc _
+ | `Raw _ -> ()
+ | `Level (child_prec, child_assoc) ->
+ new_level := Some (child_prec, child_assoc)
+ | `IdRef xref -> new_xref := Some xref
+ | `Href hrefs -> new_uris := hrefs
+ | `XmlAttrs attrs -> new_xmlattrs := attrs);
+ aux_attribute t
+ | t ->
+ (match !new_level with
+ | None -> aux !new_xmlattrs mathonly new_xref pos prec new_uris t
+ | Some (child_prec, child_assoc) ->
+ let t' =
+ aux !new_xmlattrs mathonly new_xref pos child_prec new_uris t
+ in
+ add_parens child_prec child_assoc pos prec t')
+ in
+ aux_attribute t
+(* function