123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869(**************************************************************************)(* *)(* Copyright 2015-2016 OCamlPro *)(* *)(* All rights reserved. This file is distributed under the terms of the *)(* GNU Lesser General Public License version 2.1, with the special *)(* exception on linking described in the file LICENSE. *)(* *)(**************************************************************************)moduleE=structtypeOpamStd.Config.E.t+=|ALLPARENSofbooloption|SKIPVERSIONCHECKSofbooloption|STRICTofbooloptionopenOpamStd.Config.Eletallparens=value(functionALLPARENSb->b|_->None)letskipversionchecks=value(functionSKIPVERSIONCHECKSb->b|_->None)letstrict=value(functionSTRICTb->b|_->None)endtypet={strict:bool;skip_version_checks:bool;all_parens:bool;}type'aoptions_fun=?strict:bool->?skip_version_checks:bool->?all_parens:bool->'aletdefault={strict=false;skip_version_checks=false;all_parens=false;}letsetkkt?strict?skip_version_checks?all_parens=let(+)xopt=matchoptwithSomex->x|None->xink{strict=t.strict+strict;skip_version_checks=t.skip_version_checks+skip_version_checks;all_parens=t.all_parens+all_parens;}letsett=setk(funx()->x)t(* Global configuration reference *)letr=refdefaultletupdate?noop:_=setk(funcfg()->r:=cfg)!rletinitkk=setk(setk(func->r:=c;k))!r?strict:(E.strict())?skip_version_checks:(E.skipversionchecks())?all_parens:(E.allparens())letinit?noop:_=initk(fun()->())