Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source
Source file msg.ml
12345678910111213141516171819202122232425262728293031323334353637383940414243letmsg?(pre="MSG")?posmsg=matchposwith|None->pre^": "^msg|Somep->pre^"["^Pos.to_stringp^"] "^msgleterr=msg~pre:"ERROR"letwarn=msg~pre:"WARNING"letbug=msg~pre:"BUG"letprint_msg?pre?posm=print_endline(matchpre,poswith|(None,None)->msgm|(Somepre,None)->msg~prem|(None,Somepos)->msg~posm|(Somepre,Somepos)->msg~pre~posm)letprint_err=print_msg~pre:"ERROR"letprint_warn=print_msg~pre:"WARNING"letprint_bug=print_msg~pre:"BUG"letmax_array_length_error="Out of memory, possibly because trying to construct array of size greater than "^(string_of_intArray.max_length)moduleTree=structtypet=Tofstring*tlistletleafmsg=T(msg,[])letadd_child(T(msg,childs))x=T(msg,childs@[x])letto_stringt=letrecloopdepth(T(msg,sub_msgs))=letpre=String.make(2*depth)' 'inletmsg=pre^msginifList.lengthsub_msgs=0thenmsgelsemsg^"\n"^(String.concat~sep:"\n"(List.map~f:(loop(depth+1))sub_msgs))inloop0tend