12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091(******************************************************************************)(* *)(* Monolith *)(* *)(* François Pottier *)(* *)(* Copyright Inria. All rights reserved. This file is distributed under the *)(* terms of the GNU Lesser General Public License as published by the Free *)(* Software Foundation, either version 3 of the License, or (at your *)(* option) any later version, as described in the file LICENSE. *)(* *)(******************************************************************************)includePPrinttype'aprinter='a->documentletblockdoc=nest2(break0^^doc)^^break0letparensdoc=lparen^^blockdoc^^rparenletraw_applydocs=group(flow(break1)docs)letapplydocdocs=raw_apply(doc::docs)lettoplevel_letpatbody=group(utf8string"let "^^pat^^utf8string" ="^^nest2(break1^^body)^^utf8string";;")letoutputbdoc=ToBuffer.pretty0.978b(groupdoc)letunit=!^"()"letbool=OCaml.boolletexne=!^(Printexc.to_stringe)letchar=OCaml.charletstring=OCaml.stringletinti=utf8format(ifi<0then"(%d)"else"%d")iletoptionf=function|None->!^"None"|Somex->parens(!^"Some "^^fx)letresultf1f2=function|Okx->parens(!^"Ok "^^f1x)|Errorx->parens(!^"Error "^^f2x)letpairf1f2(x1,x2)=OCaml.tuple[f1x1;f2x2]letlist=OCaml.flowing_listletarray=OCaml.flowing_arrayletcommentdoc=group(break1^^!^"(* "^^doc^^!^" *)")letcandidate_findsdoc=comment(!^"candidate finds "^^doc)letassert_doc=apply(!^"assert")[parensdoc]