123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181(*
* Copyright (c) 2015 Leo White <leo@lpw25.net>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*)openTypesopenFormatletfmt_style_kindfx=matchxwith|SK_bold->fprintff"SK_bold"|SK_italic->fprintff"SK_italic"|SK_emphasize->fprintff"SK_emphasize"|SK_center->fprintff"SK_center"|SK_left->fprintff"SK_left"|SK_right->fprintff"SK_right"|SK_superscript->fprintff"SK_superscript"|SK_subscript->fprintff"SK_subscript"|SK_customs->fprintff"SK_custom %s"sletfmt_ref_kindfx=matchxwith|RK_element->fprintff"RK_element"|RK_module->fprintff"RK_module"|RK_module_type->fprintff"RK_module_type"|RK_class->fprintff"RK_class"|RK_class_type->fprintff"RK_class_type"|RK_value->fprintff"RK_value"|RK_type->fprintff"RK_type"|RK_exception->fprintff"RK_exception"|RK_attribute->fprintff"RK_attribute"|RK_method->fprintff"RK_method"|RK_section->fprintff"RK_section"|RK_recfield->fprintff"RK_recfield"|RK_const->fprintff"RK_const"|RK_link->fprintff"RK_link"|RK_customs->fprintff"RK_custom %s"sletfmt_see_reffx=matchxwith|See_urls->fprintff"See_url %s"s|See_files->fprintff"See_file %s"s|See_docs->fprintff"See_doc %s"sletlineifs=fprintff"%s"(String.make((2*i)mod72)' ');fprintffsletlistifppfl=matchlwith|[]->lineippf"[]\n";|_::_->lineippf"[\n";List.iter(f(i+1)ppf)l;lineippf"]\n"letoptionifppfx=matchxwith|None->lineippf"None\n";|Somex->lineippf"Some\n";f(i+1)ppfxletstringippfs=lineippf"\"%s\"\n"sletspecial_ref_kindippfx=lineippf"special_ref_kind\n";leti=i+1inmatchxwith|SRK_module_listsl->lineippf"SRK_module_list\n";lististringppfsl|SRK_index_list->lineippf"SRK_index_list\n"letrectext_elementippfx=lineippf"text_element\n";leti=i+1inmatchxwith|Raws->lineippf"Raw\n";stringippfs|Codes->lineippf"Code\n";stringippfs|PreCodes->lineippf"PreCode\n";stringippfs|Verbatims->lineippf"Verbatim\n";stringippfs|Style(sk,txt)->lineippf"Style %a\n"fmt_style_kindsk;textippftxt|Listtxtl->lineippf"List\n";listitextppftxtl|Enumtxtl->lineippf"Enum\n";listitextppftxtl|Newline->lineippf"Newline\n"|Title(n,so,txt)->lineippf"Title %d\n"n;optionistringppfso;textippftxt|Ref(rk,s,txto)->lineippf"Ref %a\n"fmt_ref_kindrk;stringippfs;optionitextppftxto|Special_refsrk->lineippf"Special\n";special_ref_kindippfsrk|Target(so,s)->lineippf"Target\n";optionistringppfso;stringippfsandtextippfx=lineippf"text\n";list(i+1)text_elementppfxlettagippfx=lineippf"tag\n";leti=i+1inmatchxwithAuthors->lineippf"Author\n";stringippfs|Versions->lineippf"Version\n";stringippfs|See(sr,txt)->lineippf"See %a\n"fmt_see_refsr;textippftxt|Sinces->lineippf"Since\n";stringippfs|Before(s,txt)->lineippf"Before\n";stringippfs;textippftxt|Deprecatedtxt->lineippf"Deprecated\n";textippftxt|Param(s,txt)->lineippf"Param\n";stringippfs;textippftxt|Raised_exception(s,txt)->lineippf"Raised_exception\n";stringippfs;textippftxt|Return_valuetxt->lineippf"Return_value\n";textippftxt|Inline->lineippf"Inline\n"|Custom(s,txt)->lineippf"Custom %s\n"s;textippftxt|Canonicals->lineippf"Canonical %s"sletdocumentationippf(txt,tags)=lineippf"Cinfo\n";text(i+1)ppftxt;list(i+1)tagppftagsletppppfx=documentation0ppfx